Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ffmpeg/core and @ffmpeg/core-mt missing export for the ffmpeg-core.worker.js file. #758

Open
Montaire opened this issue Jun 10, 2024 · 0 comments

Comments

@Montaire
Copy link

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"
    }
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant