From 5a90495561d5d91af899741a15c4b96653d90be3 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Jul 2025 17:59:20 +0800 Subject: [PATCH] fix --- src-tauri/tauri.conf.json | 2 +- src/components/VideoPlayer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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')