1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix: don't set temp variable

This commit is contained in:
Ivan Schurawel 2023-02-19 10:56:10 -05:00 committed by Ivan Schurawel
parent 2caa2851b9
commit 032d03d201

View file

@ -245,12 +245,6 @@ function tryRemoveElement(elem) {
* @type {any | null | undefined}
*/
#currentSecondaryTrackEvents;
/**
* Used to temporarily store the text track when
* force-clearing the `activeCue` for certain browsers
* @type {TextTrack | null | undefined}
*/
#currentTextTrack;
/**
* @type {string[] | undefined}
*/
@ -650,19 +644,13 @@ function tryRemoveElement(elem) {
* Forces the active cue to clear by disabling then re-enabling the track.
* The track mode is reverted inside of a 0ms timeout to free up the track
* and allow it to disable and clear the active cue.
* The track needs to be temporarily stored in order for us to access it
* inside the timeout. The stored value is reset after it is used.
* @private
*/
forceClearTextTrackActiveCues(currentTrack) {
if (currentTrack.activeCues) {
this.#currentTextTrack = currentTrack;
currentTrack.mode = 'disabled';
setTimeout(() => {
if (this.#currentTextTrack) {
this.#currentTextTrack.mode = 'showing';
this.#currentTextTrack = null;
}
currentTrack.mode = 'showing';
}, 0);
}
}