Fix theme song playback when switching items with different themes

When you change an item with a theme to an item with a different theme, the
backdrop tries to access the player. The latter has not yet started playing the
new theme (`streamInfo` is null), but is already considered playing. A runtime
error occurs when referring to null `streamInfo` (to check if the content type
matches).

To fix the problem, set `streamInfo` just before playback starts.
This commit is contained in:
Dmitry Lyzo 2022-01-31 23:44:07 +03:00
parent 0d3550c534
commit d997d63d11

View file

@ -2385,8 +2385,11 @@ class PlaybackManager {
streamInfo.fullscreen = playOptions.fullscreen;
getPlayerData(player).isChangingStream = false;
getPlayerData(player).maxStreamingBitrate = maxBitrate;
const playerData = getPlayerData(player);
playerData.isChangingStream = false;
playerData.maxStreamingBitrate = maxBitrate;
playerData.streamInfo = streamInfo;
return player.play(streamInfo).then(function () {
loading.hide();