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

Show error if player not found

This commit is contained in:
Dmitry Lyzo 2021-09-05 23:15:04 +03:00
parent 04c4e03ac1
commit fa1d270a2f
2 changed files with 13 additions and 1 deletions

View file

@ -2153,7 +2153,7 @@ class PlaybackManager {
}, onInterceptorRejection);
}
function onInterceptorRejection() {
function cancelPlayback() {
const player = self._currentPlayer;
if (player) {
@ -2162,7 +2162,10 @@ class PlaybackManager {
}
Events.trigger(self, 'playbackcancelled');
}
function onInterceptorRejection() {
cancelPlayback();
return Promise.reject();
}
@ -2238,6 +2241,14 @@ class PlaybackManager {
promise = Promise.resolve();
}
if (!player) {
return promise.then(() => {
cancelPlayback();
loading.hide();
showPlaybackInfoErrorMessage(self, 'ErrorPlayerNotFound');
});
}
if (!isServerItem(item) || item.MediaType === 'Book') {
return promise.then(function () {
const streamInfo = createStreamInfoFromUrlItem(item);