From 9338b36b8ed89257221bce5bb94f0bf8a2476196 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 23 Sep 2021 21:12:16 +0300 Subject: [PATCH] Clear JavascriptSubtitlesOctopus when an error occurs --- src/plugins/htmlVideoPlayer/plugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 611240be3e..cf477bfd9d 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -1062,6 +1062,9 @@ function tryRemoveElement(elem) { workerUrl: `${appRouter.baseUrl()}/libraries/subtitles-octopus-worker.js`, legacyWorkerUrl: `${appRouter.baseUrl()}/libraries/subtitles-octopus-worker-legacy.js`, onError() { + // HACK: Clear JavascriptSubtitlesOctopus: it gets disposed when an error occurs + htmlVideoPlayer.#currentSubtitlesOctopus = null; + onErrorInternal(htmlVideoPlayer, 'mediadecodeerror'); }, timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,