Update react-vite-app to mt version
This commit is contained in:
parent
f0fda4cd9b
commit
6d115051eb
@ -9,7 +9,7 @@ function App() {
|
|||||||
const messageRef = useRef(null);
|
const messageRef = useRef(null);
|
||||||
|
|
||||||
const load = async () => {
|
const load = async () => {
|
||||||
const baseURL = "https://unpkg.com/@ffmpeg/core@0.12.1/dist/esm";
|
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.2/dist/esm";
|
||||||
const ffmpeg = ffmpegRef.current;
|
const ffmpeg = ffmpegRef.current;
|
||||||
ffmpeg.on("log", ({ message }) => {
|
ffmpeg.on("log", ({ message }) => {
|
||||||
messageRef.current.innerHTML = message;
|
messageRef.current.innerHTML = message;
|
||||||
@ -22,6 +22,10 @@ function App() {
|
|||||||
`${baseURL}/ffmpeg-core.wasm`,
|
`${baseURL}/ffmpeg-core.wasm`,
|
||||||
"application/wasm"
|
"application/wasm"
|
||||||
),
|
),
|
||||||
|
workerURL: await toBlobURL(
|
||||||
|
`${baseURL}/ffmpeg-core.worker.js`,
|
||||||
|
"text/javascript"
|
||||||
|
),
|
||||||
});
|
});
|
||||||
setLoaded(true);
|
setLoaded(true);
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import react from '@vitejs/plugin-react'
|
import react from "@vitejs/plugin-react";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
})
|
server: {
|
||||||
|
headers: {
|
||||||
|
"Cross-Origin-Opener-Policy": "same-origin",
|
||||||
|
"Cross-Origin-Embedder-Policy": "require-corp",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user