From 98207228d6de0254af5782fc979cc12c68549903 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Mon, 17 Jun 2024 20:04:39 +0300 Subject: [PATCH 1/2] Fix current aspect ratio reset The media element may still have some CSS styles related to aspect ratio, so we need to reset the current aspect ratio after destroying the media element. --- src/plugins/htmlVideoPlayer/plugin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index f26e89cc92..cc7a6c5663 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -862,6 +862,8 @@ export class HtmlVideoPlayer { videoElement.parentNode.removeChild(videoElement); } + this._currentAspectRatio = null; + const dlg = this.#videoDialog; if (dlg) { this.#videoDialog = null; @@ -1170,7 +1172,6 @@ export class HtmlVideoPlayer { this.destroyStoredTrackInfo(targetTrackIndex); this.#currentClock = null; - this._currentAspectRatio = null; const octopus = this.#currentAssRenderer; if (octopus) { From f507bfb016b5ae031bc0e4728e085a58518e9f91 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Mon, 17 Jun 2024 20:09:11 +0300 Subject: [PATCH 2/2] Remove libjass leftovers --- src/plugins/htmlVideoPlayer/plugin.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index cc7a6c5663..5885147cb0 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -209,10 +209,6 @@ export class HtmlVideoPlayer { * @type {number | null} */ #audioTrackIndexToSetOnPlaying; - /** - * @type {null | undefined} - */ - #currentClock; /** * @type {any | null | undefined} */ @@ -1171,8 +1167,6 @@ export class HtmlVideoPlayer { this.destroyNativeTracks(videoElement, targetTrackIndex); this.destroyStoredTrackInfo(targetTrackIndex); - this.#currentClock = null; - const octopus = this.#currentAssRenderer; if (octopus) { octopus.dispose(); @@ -1500,16 +1494,6 @@ export class HtmlVideoPlayer { * @private */ updateSubtitleText(timeMs) { - const clock = this.#currentClock; - if (clock) { - try { - clock.seek(timeMs / 1000); - } catch (err) { - console.error(`error in libjass: ${err}`); - } - return; - } - const allTrackEvents = [this.#currentTrackEvents, this.#currentSecondaryTrackEvents]; const subtitleTextElements = [this.#videoSubtitlesElem, this.#videoSecondarySubtitlesElem];