From d997d63d11e337ff4827009bdee5a4e0e04dfabc Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Mon, 31 Jan 2022 23:44:07 +0300 Subject: [PATCH] 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. --- src/components/playback/playbackmanager.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 5e926f5f40..a03e25f036 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -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();