mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Issue #5486: When changing player types, destroy old player
Signed-off-by: Kevin G <kevin@myplaceonline.com>
This commit is contained in:
parent
3a73467dba
commit
e11c8900c4
1 changed files with 11 additions and 2 deletions
|
@ -3423,7 +3423,7 @@ export class PlaybackManager {
|
||||||
const nextItemPlayOptions = nextItem ? (nextItem.item.playOptions || getDefaultPlayOptions()) : getDefaultPlayOptions();
|
const nextItemPlayOptions = nextItem ? (nextItem.item.playOptions || getDefaultPlayOptions()) : getDefaultPlayOptions();
|
||||||
const newPlayer = nextItem ? getPlayer(nextItem.item, nextItemPlayOptions) : null;
|
const newPlayer = nextItem ? getPlayer(nextItem.item, nextItemPlayOptions) : null;
|
||||||
|
|
||||||
if (newPlayer !== player) {
|
if (!newPlayer) {
|
||||||
data.streamInfo = null;
|
data.streamInfo = null;
|
||||||
destroyPlayer(player);
|
destroyPlayer(player);
|
||||||
removeCurrentPlayer(player);
|
removeCurrentPlayer(player);
|
||||||
|
@ -3431,12 +3431,21 @@ export class PlaybackManager {
|
||||||
|
|
||||||
if (errorOccurred) {
|
if (errorOccurred) {
|
||||||
showPlaybackInfoErrorMessage(self, 'PlaybackError' + displayErrorCode);
|
showPlaybackInfoErrorMessage(self, 'PlaybackError' + displayErrorCode);
|
||||||
} else if (nextItem) {
|
} else if (newPlayer) {
|
||||||
const apiClient = ServerConnections.getApiClient(nextItem.item.ServerId);
|
const apiClient = ServerConnections.getApiClient(nextItem.item.ServerId);
|
||||||
|
|
||||||
apiClient.getCurrentUser().then(function (user) {
|
apiClient.getCurrentUser().then(function (user) {
|
||||||
if (user.Configuration.EnableNextEpisodeAutoPlay || nextMediaType !== MediaType.Video) {
|
if (user.Configuration.EnableNextEpisodeAutoPlay || nextMediaType !== MediaType.Video) {
|
||||||
self.nextTrack();
|
self.nextTrack();
|
||||||
|
|
||||||
|
if (newPlayer !== player) {
|
||||||
|
Events.trigger(self, 'playbackstop', [{
|
||||||
|
player: player,
|
||||||
|
state: state,
|
||||||
|
nextItem: nextItem,
|
||||||
|
nextMediaType: nextItem.MediaType
|
||||||
|
}]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue