@ffmpeg/core and @ffmpeg/core-mt missing export for the ffmpeg-core.worker.js file.
Montaire opened this issue · 0 comments
Montaire commented
Describe the bug
From the @ffmpeg/core
, @ffmpeg/core-mt
it is not possible to import the ffmpeg-core.worker.js with the import directive.
To Reproduce
import ffmpegCoreUrl from '@ffmpeg/core-mt?url';
import ffmpegWasmUrl from '@ffmpeg/core-mt/wasm?url';
import ffmpegWorkerUrl from '@ffmpeg/core-mt/worker?url'; //Missing
await ffmpeg.load({
coreURL: await toBlobURL(ffmpegCoreUrl, 'text/javascript'),
wasmURL: await toBlobURL(ffmpegWasmUrl, 'application/wasm'),
workerURL: await toBlobURL(ffmpegWorkerUrl, 'text/javascript')
});
Expected behavior
Something like this should load the files.
Additional context
This is required for asset bundlers to resolve the urls, like Vite.
The worker in package.json should solve the issue.
"exports": {
".": {
"import": "./dist/esm/ffmpeg-core.js",
"require": "./dist/umd/ffmpeg-core.js"
},
"./wasm": {
"import": "./dist/esm/ffmpeg-core.wasm",
"require": "./dist/umd/ffmpeg-core.wasm"
},
"./worker": {
"import": "./dist/esm/ffmpeg-core.worker.js",
"require": "./dist/umd/ffmpeg-core.worker.js"
}
},