From 6a888f9b171118df80483b9018d5f143d7a52488 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Mon, 14 Jun 2021 14:08:55 +0800 Subject: [PATCH] Update FAQ in README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 3ed98be..5a8a4ba 100644 --- a/README.md +++ b/README.md @@ -159,3 +159,19 @@ Also you can check this series of posts to learn more fundamental concepts: - https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-2-compile-with-emscripten/ - https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-3-v0.1/ - https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-4-v0.2/ + +### Why it doesn't work in my local environment? + +When calling `ffmpeg.load()`, by default it looks for `http://localhost:3000/node_modules/@ffmpeg/core/dist/` to download essential files (ffmpeg-core.js, ffmpeg-core.wasm, ffmpeg-core.worker.js). It is necessary to make sure you have those files served there. + +If you have those files serving in other location, you can rewrite the default behavior when calling `createFFmpeg()`: + +```javascript +const { createFFmpeg } = FFmpeg; +const ffmpeg = createFFmpeg({ + corePath: "http://localhost:3000/public/ffmpeg-core.js", + // Use public address if you don't want to host your own. + // corePath: 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js' + log: true, +}); +```