1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #1806 from matjaz321/unavailable-yt-video-trailer-bug-fix

Bug fix for: Cannot exit unavailable/private trailers
This commit is contained in:
Bill Thornton 2020-11-21 15:25:13 -05:00 committed by GitHub
commit b212dbaba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 6 deletions

View file

@ -2240,13 +2240,14 @@ class PlaybackManager {
const streamInfo = createStreamInfoFromUrlItem(item);
streamInfo.fullscreen = playOptions.fullscreen;
getPlayerData(player).isChangingStream = false;
return player.play(streamInfo).then(function () {
return player.play(streamInfo).then(() => {
loading.hide();
onPlaybackStartedFn();
onPlaybackStarted(player, playOptions, streamInfo);
}, function () {
// TODO: show error message
}).catch((errorCode) => {
self.stop(player);
loading.hide();
showPlaybackInfoErrorMessage(self, errorCode || 'ErrorDefault');
});
});
}
@ -2935,7 +2936,7 @@ class PlaybackManager {
state.NextMediaType = nextMediaType;
if (isServerItem(streamInfo.item)) {
if (streamInfo && isServerItem(streamInfo.item)) {
if (player.supportsProgress === false && state.PlayState && !state.PlayState.PositionTicks) {
state.PlayState.PositionTicks = streamInfo.item.RunTimeTicks;
}

View file

@ -5,6 +5,14 @@ import loading from '../../components/loading/loading';
/* globals YT */
const errorCodes = {
2: 'YoutubeBadRequest',
5: 'YoutubePlaybackError',
100: 'YoutubeNotFound',
101: 'YoutubeDenied',
150: 'YoutubeDenied'
};
function zoomIn(elem, iterations) {
const keyframes = [
{ transform: 'scale3d(.2, .2, .2) ', opacity: '.6', offset: 0 },
@ -139,7 +147,8 @@ function setCurrentSrc(instance, elem, options) {
} else if (event.data === YT.PlayerState.PAUSED) {
Events.trigger(instance, 'pause');
}
}
},
'onError': (e) => reject(errorCodes[e.data] || 'ErrorDefault')
},
playerVars: {
controls: 0,

View file

@ -1449,5 +1449,9 @@
"LabelAllowedAudioChannels": "Maximum Allowed Audio Channels",
"LabelSelectAudioChannels": "Channels",
"LabelSelectMono": "Mono",
"LabelSelectStereo": "Stereo"
"LabelSelectStereo": "Stereo",
"YoutubeBadRequest": "Bad request.",
"YoutubePlaybackError": "Requested video cannot be played.",
"YoutubeNotFound": "Video not found.",
"YoutubeDenied": "Requested video is not allowed to be played in embedded players."
}