jassub
jassub copied to clipboard
Firefox: Adding subtitle before playback throw an error of Offset renderer
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)