Skip to content

Commit

Permalink
Use toBlobURL in single thread version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromewu committed Jul 26, 2023
1 parent d523037 commit 7c355f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/website/docs/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ a ~31 MB ffmpeg-core.wasm.
// import { FFmpeg } from '@ffmpeg/ffmpeg';
// import { fetchFile } from '@ffmpeg/util';
function() {
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
const [loaded, setLoaded] = useState(false);
const ffmpegRef = useRef(new FFmpeg());
const videoRef = useRef(null);
Expand All @@ -27,7 +28,10 @@ function() {
ffmpeg.on("log", ({ message }) => {
messageRef.current.innerHTML = message;
});
await ffmpeg.load();
await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`),
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`),
});
setLoaded(true);
}

Expand Down

0 comments on commit 7c355f4

Please sign in to comment.