Add VobSub deband settings to renderVobSub

This commit is contained in:
altqx
2026-04-10 20:14:28 +07:00
parent 41297041c1
commit 7f9f689ff1
+9
View File
@@ -188,6 +188,8 @@ function getDefaultProfile() {
}
const PRIMARY_TEXT_TRACK_INDEX = 0;
const VOBSUB_DEBAND_THRESHOLD = 64;
const VOBSUB_DEBAND_RANGE = 15;
const SECONDARY_TEXT_TRACK_INDEX = 1;
export class HtmlVideoPlayer {
@@ -1432,6 +1434,13 @@ export class HtmlVideoPlayer {
...this.createBitmapSubtitleRendererOptions(videoElement, track, item, targetTextTrackIndex),
fileName: getSubtitleFileNameHint(track)
};
const onLoaded = options.onLoaded;
options.onLoaded = () => {
this.#currentPgsRenderer?.setDebandEnabled?.(true);
this.#currentPgsRenderer?.setDebandThreshold?.(VOBSUB_DEBAND_THRESHOLD);
this.#currentPgsRenderer?.setDebandRange?.(VOBSUB_DEBAND_RANGE);
onLoaded?.();
};
import('libbitsub').then((libbitsub) => {
this.#currentPgsRenderer = new libbitsub.VobSubRenderer(options);
}).catch((error) => {