mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Restore promise rejects
This commit is contained in:
parent
70b9aa4611
commit
2280d98785
1 changed files with 8 additions and 11 deletions
|
@ -2267,7 +2267,7 @@ class PlaybackManager {
|
||||||
if (item.IsPlaceHolder) {
|
if (item.IsPlaceHolder) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
showPlaybackInfoErrorMessage(self, 'PlaybackErrorPlaceHolder');
|
showPlaybackInfoErrorMessage(self, 'PlaybackErrorPlaceHolder');
|
||||||
return Promise.resolve();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalize defaults to simplfy checks throughout the process
|
// Normalize defaults to simplfy checks throughout the process
|
||||||
|
@ -2284,16 +2284,17 @@ class PlaybackManager {
|
||||||
// TODO: This should be the media type requested, not the original media type
|
// TODO: This should be the media type requested, not the original media type
|
||||||
const mediaType = item.MediaType;
|
const mediaType = item.MediaType;
|
||||||
|
|
||||||
|
if (playOptions.fullscreen) {
|
||||||
|
loading.show();
|
||||||
|
}
|
||||||
|
|
||||||
return runInterceptors(item, playOptions)
|
return runInterceptors(item, playOptions)
|
||||||
.catch(onInterceptorRejection)
|
.catch(onInterceptorRejection)
|
||||||
.then(() => detectBitrate(apiClient, item, mediaType, playOptions))
|
.then(() => detectBitrate(apiClient, item, mediaType))
|
||||||
.then((bitrate) => {
|
.then((bitrate) => {
|
||||||
return playAfterBitrateDetect(bitrate, item, playOptions, onPlaybackStartedFn, prevSource)
|
return playAfterBitrateDetect(bitrate, item, playOptions, onPlaybackStartedFn, prevSource)
|
||||||
.catch(onPlaybackRejection);
|
.catch(onPlaybackRejection);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
|
||||||
/* NOTE: Any errors should already be handled, but interceptors will reject to prevent playback. */
|
|
||||||
})
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
if (playOptions.fullscreen) {
|
if (playOptions.fullscreen) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
@ -2333,7 +2334,7 @@ class PlaybackManager {
|
||||||
|
|
||||||
showPlaybackInfoErrorMessage(self, displayErrorCode);
|
showPlaybackInfoErrorMessage(self, displayErrorCode);
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyPlayer(player) {
|
function destroyPlayer(player) {
|
||||||
|
@ -2492,14 +2493,10 @@ class PlaybackManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectBitrate(apiClient, item, mediaType, playOptions) {
|
function detectBitrate(apiClient, item, mediaType) {
|
||||||
// FIXME: This is gnarly, but don't want to change too much here in a bugfix
|
// FIXME: This is gnarly, but don't want to change too much here in a bugfix
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (playOptions.fullscreen) {
|
|
||||||
loading.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isServerItem(item) || itemHelper.isLocalItem(item)) {
|
if (!isServerItem(item) || itemHelper.isLocalItem(item)) {
|
||||||
return Promise.reject('skip bitrate detection');
|
return Promise.reject('skip bitrate detection');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue