diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 11c1597..3d6d48d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -25,7 +25,7 @@ } ], "security": { - "csp": "default-src 'self'; img-src 'self' asset: data: http://asset.localhost; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' ipc: http://ipc.localhost", + "csp": "default-src 'self'; img-src 'self' asset: data: http://asset.localhost; media-src 'self' asset: http://asset.localhost; video-src 'self' asset: http://asset.localhost; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' ipc: http://ipc.localhost", "assetProtocol": { "enable": true, "scope": [ diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index 91ae97d..cc15de9 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -59,7 +59,7 @@ const VideoPlayer: React.FC = ({ // 尝试多种方法加载视频 const tryLoadVideo = async (path: string) => { // 根据路径类型选择不同的加载策略 - const src = convertFileSrc(path, 'file') + const src = convertFileSrc(path) console.log(`try load video src`, src) setVideoSrc(src) setLoadingMethod('convertFileSrc')