From c7f31c0fac2f4060fc2f12dd0076e922657ac4c7 Mon Sep 17 00:00:00 2001 From: Ivan Schurawel Date: Fri, 10 Feb 2023 13:52:53 -0500 Subject: [PATCH] fix: pass player to playbackManager --- src/plugins/htmlVideoPlayer/plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index ca07c2d7a5..700eedd141 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -480,7 +480,7 @@ function tryRemoveElement(elem) { secondaryTrackValid = false; } // secondary track should not be shown if primary track is no longer a valid pair - if (initialSubtitleStream && !playbackManager.trackHasSecondarySubtitleSupport(initialSubtitleStream)) { + if (initialSubtitleStream && !playbackManager.trackHasSecondarySubtitleSupport(initialSubtitleStream, this)) { secondaryTrackValid = false; } } else { @@ -488,11 +488,11 @@ function tryRemoveElement(elem) { } // Get the secondary track that has been set during this watch session - let currentSecondaryTrackIndex = playbackManager.getSecondarySubtitleStreamIndex(); + let currentSecondaryTrackIndex = playbackManager.getSecondarySubtitleStreamIndex(this); if (!secondaryTrackValid) { currentSecondaryTrackIndex = -1; - playbackManager.setSecondarySubtitleStreamIndex(currentSecondaryTrackIndex); + playbackManager.setSecondarySubtitleStreamIndex(currentSecondaryTrackIndex, this); } this.#secondarySubtitleTrackIndexToSetOnPlaying = currentSecondaryTrackIndex == null ? -1 : currentSecondaryTrackIndex;