From 1f6825154c9d07253ec00dad871db1e3ff39d8d7 Mon Sep 17 00:00:00 2001 From: altqx Date: Sat, 1 Aug 2026 23:05:04 +0700 Subject: [PATCH] Conditionally prewarm libbitsub workers and exclude module-worker glue asset from the ES5 syntax scan --- .escheckrc | 1 + src/plugins/htmlVideoPlayer/plugin.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.escheckrc b/.escheckrc index 5cdc1dd4d3..f7bf7779c8 100644 --- a/.escheckrc +++ b/.escheckrc @@ -4,6 +4,7 @@ "not": [ "./dist/libraries/pdf.worker.js", "./dist/libraries/worker-bundle.js", + "./dist/libbitsub.*.js", "./dist/serviceworker.js" ] } diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 9b4db45281..4a5951b47b 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -507,9 +507,11 @@ export class HtmlVideoPlayer { if (options.resetSubtitleOffset !== false) this.resetSubtitleOffset(); - void import('libbitsub') - .then(({ warmup }) => warmup()) - .catch((error) => console.warn('[libbitsub] worker prewarm failed; renderer fallback will be used', error)); + if (appSettings.get('subtitlerenderpgs') === 'true') { + void import('libbitsub') + .then(({ warmup }) => warmup()) + .catch((error) => console.warn('[libbitsub] worker prewarm failed; renderer fallback will be used', error)); + } const elem = await this.createMediaElement(options); this.#applyAspectRatio(options.aspectRatio || this.getAspectRatio());