Clear JavascriptSubtitlesOctopus when an error occurs

This commit is contained in:
Dmitry Lyzo 2021-09-23 21:12:16 +03:00
parent a18cd96012
commit 9338b36b8e

View File

@ -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,