Give JavascriptSubtitlesOctopus time to dispose itself

This commit is contained in:
Dmitry Lyzo 2021-09-23 22:20:03 +03:00
parent 9f6fdfdd72
commit 50880983cc

View file

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