ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.25k stars 839 forks source link

Uncaught ReferenceError: FFmpeg is not defined #256

Open FabioNevesRezende opened 3 years ago

FabioNevesRezende commented 3 years ago

I was having the SharedArrayBuffer error as described in this other issue and to fix I added the cross origin isolation as suggested by adding the headers

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

After that, now when I try to run the code I just got Uncaught ReferenceError: FFmpeg is not defined. The error is happening on Firefox

My code is:

<script  src="https://unpkg.com/@ffmpeg/ffmpeg@0.10.0/dist/ffmpeg.min.js"></script>
<script>

    const { createFFmpeg, fetchFile } = FFmpeg; //error happens here
    const ffmpegInstance = createFFmpeg({
        corePath: 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js',
        log: true,
    });
 </script> 

On Brave browser the process ran ok without having to add the Cross origin headers and also FFmpeg variable was defined.

tejas36026 commented 10 months ago

hey did you solved the error? i am gettting the same error

Heaney-555 commented 3 months ago

I am also getting the same error at the same place.

GuoQichen commented 3 months ago

try window.FFmpeg instead ?