ThaUnknown / jassub

Displays subtitles in .ass format via JavaScript. Supports all SSA/ASS features, easily integrates with HTML5 videos.
https://thaunknown.github.io/jassub
MIT License
69 stars 11 forks source link

Firefox: Adding subtitle before playback throw an error of Offset renderer #31

Open zoriya opened 11 months ago

zoriya commented 11 months ago

When the offset renderer is enabled, and you run new Jassub(...) with a video that as not started playing, this error is thrown:

Uncaught DOMException: OffscreenCanvas.width setter: Cannot set width of placeholder canvas transferred to worker.
    _render jassub.js:681
    _onmessage jassub.js:783
    onmessage jassub.js:120
    JASSUB jassub.js:120

This is my new call:

new Jassub({
    video: player.current,
    workerUrl: "/_next/static/chunks/jassub-worker.js",
    wasmUrl: "/_next/static/chunks/jassub-worker.wasm",
    legacyWasmUrl: "/_next/static/chunks/jassub-worker.wasm.js",
    subUrl: value.link,
    fonts: fonts,
});

(Since September 2023, OffscreenCanvas is stable in FF, so this is not like #10)

ThaUnknown commented 11 months ago

just firefox things, feel free to disable offscreen canvas in ff, i cba fixing this for firefox for the 5th time, they simply can't implement it properly