mirror of https://github.com/VERT-sh/VERT.git
fix: audio uploading not working (#15)
This commit is contained in:
parent
592bd1c1d9
commit
576202eea7
|
@ -30,7 +30,8 @@ export class FFmpegConverter extends Converter {
|
||||||
if (!browser) return;
|
if (!browser) return;
|
||||||
this.ffmpeg = new FFmpeg();
|
this.ffmpeg = new FFmpeg();
|
||||||
(async () => {
|
(async () => {
|
||||||
const baseURL = "https://unpkg.com/@ffmpeg/core@latest/dist/esm";
|
const baseURL =
|
||||||
|
"https://cdn.jsdelivr.net/npm/@ffmpeg/core@0.12.6/dist/esm";
|
||||||
await this.ffmpeg.load({
|
await this.ffmpeg.load({
|
||||||
coreURL: `${baseURL}/ffmpeg-core.js`,
|
coreURL: `${baseURL}/ffmpeg-core.js`,
|
||||||
wasmURL: `${baseURL}/ffmpeg-core.wasm`,
|
wasmURL: `${baseURL}/ffmpeg-core.wasm`,
|
||||||
|
|
|
@ -41,13 +41,14 @@
|
||||||
// get the blob
|
// get the blob
|
||||||
canvas.toBlob(
|
canvas.toBlob(
|
||||||
(blob) => {
|
(blob) => {
|
||||||
if (blob === null)
|
|
||||||
reject("Failed to convert image to blob");
|
|
||||||
resolve({
|
resolve({
|
||||||
file: f,
|
file: f,
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
blobUrl: URL.createObjectURL(blob!),
|
blobUrl:
|
||||||
|
blob === null
|
||||||
|
? ""
|
||||||
|
: URL.createObjectURL(blob),
|
||||||
id: Math.random().toString(36).substring(2),
|
id: Math.random().toString(36).substring(2),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -55,6 +56,16 @@
|
||||||
0.75,
|
0.75,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
img.onerror = () => {
|
||||||
|
resolve({
|
||||||
|
file: f,
|
||||||
|
from,
|
||||||
|
to,
|
||||||
|
blobUrl: "",
|
||||||
|
id: Math.random().toString(36).substring(2),
|
||||||
|
});
|
||||||
|
};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue