Fix playground bug

This commit is contained in:
Jerome Wu 2023-07-27 00:32:56 +08:00
parent 4c6a1252d3
commit c87cf457be
2 changed files with 6 additions and 6 deletions

View File

@ -4,11 +4,11 @@ export const CORE_URL = `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd
export const CORE_MT_URL = `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`; export const CORE_MT_URL = `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
export const CORE_SIZE = { export const CORE_SIZE = {
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 111646, [`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 109667,
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 31967534, [`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 31598677,
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 130002, [`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 127674,
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32441947, [`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32077318,
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2978, [`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2915,
}; };
export const SAMPLE_FILES = { export const SAMPLE_FILES = {

View File

@ -22,6 +22,7 @@ export default function Playground() {
const ffmpeg = useRef(new FFmpeg()); const ffmpeg = useRef(new FFmpeg());
const load = async (mt: boolean = false) => { const load = async (mt: boolean = false) => {
setState(State.LOADING);
const setProgress = ({ url: _url, received: _received }) => { const setProgress = ({ url: _url, received: _received }) => {
setURL(_url as string); setURL(_url as string);
setReceived(_received); setReceived(_received);
@ -48,7 +49,6 @@ export default function Playground() {
setProgress setProgress
) )
: ""; : "";
setState(State.LOADING);
ffmpeg.current.terminate(); ffmpeg.current.terminate();
await ffmpeg.current.load({ await ffmpeg.current.load({
coreURL, coreURL,