Clear data when player is destroyed

This commit is contained in:
Dmitry Lyzo 2021-09-11 23:58:26 +03:00
parent 6b4c4d3140
commit 94bbe803c1

View file

@ -3103,6 +3103,7 @@ class PlaybackManager {
const newPlayer = nextItem ? getPlayer(nextItem.item, nextItemPlayOptions) : null;
if (newPlayer !== player) {
data.streamInfo = null;
destroyPlayer(player);
removeCurrentPlayer(player);
}
@ -3111,9 +3112,6 @@ class PlaybackManager {
showPlaybackInfoErrorMessage(self, 'PlaybackError' + displayErrorCode);
} else if (nextItem) {
self.nextTrack();
} else {
// Nothing more to play - clear data
data.streamInfo = null;
}
}