From 50880983cc2e561ff1fa901559bda1b49ea15eef Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 23 Sep 2021 22:20:03 +0300 Subject: [PATCH] Give JavascriptSubtitlesOctopus time to dispose itself --- src/plugins/htmlVideoPlayer/plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index f1a0f427d..eeef1d518 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -1065,7 +1065,10 @@ function tryRemoveElement(elem) { // HACK: Clear JavascriptSubtitlesOctopus: it gets disposed when an error occurs htmlVideoPlayer.#currentSubtitlesOctopus = null; - onErrorInternal(htmlVideoPlayer, 'mediadecodeerror'); + // HACK: Give JavascriptSubtitlesOctopus time to dispose itself + setTimeout(() => { + onErrorInternal(htmlVideoPlayer, 'mediadecodeerror'); + }, 0); }, timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,