From 98207228d6de0254af5782fc979cc12c68549903 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Mon, 17 Jun 2024 20:04:39 +0300 Subject: [PATCH] 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) {