1
0
Fork 0
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:
Kevin G 2025-01-07 17:27:13 -06:00
parent 3a73467dba
commit e11c8900c4
No known key found for this signature in database
GPG key ID: 836C48CA579F01BF

View file

@ -3423,7 +3423,7 @@ export class PlaybackManager {
const nextItemPlayOptions = nextItem ? (nextItem.item.playOptions || getDefaultPlayOptions()) : getDefaultPlayOptions();
const newPlayer = nextItem ? getPlayer(nextItem.item, nextItemPlayOptions) : null;
if (newPlayer !== player) {
if (!newPlayer) {
data.streamInfo = null;
destroyPlayer(player);
removeCurrentPlayer(player);
@ -3431,12 +3431,21 @@ export class PlaybackManager {
if (errorOccurred) {
showPlaybackInfoErrorMessage(self, 'PlaybackError' + displayErrorCode);
} else if (nextItem) {
} else if (newPlayer) {
const apiClient = ServerConnections.getApiClient(nextItem.item.ServerId);
apiClient.getCurrentUser().then(function (user) {
if (user.Configuration.EnableNextEpisodeAutoPlay || nextMediaType !== MediaType.Video) {
self.nextTrack();
if (newPlayer !== player) {
Events.trigger(self, 'playbackstop', [{
player: player,
state: state,
nextItem: nextItem,
nextMediaType: nextItem.MediaType
}]);
}
}
});
}