Add mime type in usage

This commit is contained in:
Jerome Wu 2023-07-28 00:00:45 +08:00
parent fdf682eab0
commit 7fae2e8b34

View File

@ -31,8 +31,14 @@ function() {
// toBlobURL is used to bypass CORS issue, urls with the same // toBlobURL is used to bypass CORS issue, urls with the same
// domain can be used directly. // domain can be used directly.
await ffmpeg.load({ await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`), coreURL: await toBlobURL(
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`), `${baseURL}/ffmpeg-core.js`,
"text/javascript",
),
wasmURL: await toBlobURL(
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm",
),
}); });
setLoaded(true); setLoaded(true);
} }
@ -89,9 +95,18 @@ function() {
// toBlobURL is used to bypass CORS issue, urls with the same // toBlobURL is used to bypass CORS issue, urls with the same
// domain can be used directly. // domain can be used directly.
await ffmpeg.load({ await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`), coreURL: await toBlobURL(
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`), `${baseURL}/ffmpeg-core.js`,
workerURL: await toBlobURL(`${baseURL}/ffmpeg-core.worker.js`), "text/javascript",
),
wasmURL: await toBlobURL(
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm",
),
workerURL: await toBlobURL(
`${baseURL}/ffmpeg-core.worker.js`,
"text/javascript",
),
thread: true, thread: true,
}); });
setLoaded(true); setLoaded(true);
@ -148,8 +163,14 @@ function() {
// toBlobURL is used to bypass CORS issue, urls with the same // toBlobURL is used to bypass CORS issue, urls with the same
// domain can be used directly. // domain can be used directly.
await ffmpeg.load({ await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`), coreURL: await toBlobURL(
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`), `${baseURL}/ffmpeg-core.js`,
"text/javascript",
),
wasmURL: await toBlobURL(
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm",
),
}); });
setLoaded(true); setLoaded(true);
} }
@ -203,8 +224,14 @@ function() {
// toBlobURL is used to bypass CORS issue, urls with the same // toBlobURL is used to bypass CORS issue, urls with the same
// domain can be used directly. // domain can be used directly.
await ffmpeg.load({ await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`), coreURL: await toBlobURL(
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`), `${baseURL}/ffmpeg-core.js`,
"text/javascript",
),
wasmURL: await toBlobURL(
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm",
),
}); });
setLoaded(true); setLoaded(true);
} }