diff --git a/src/App.tsx b/src/App.tsx index 6b09a69..d6749b8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,7 +24,7 @@ async function testPath() { const filePath = await path.join(appDataDirPath, 'assets/video.mp4'); const assetUrl = convertFileSrc(filePath); const path2 = `C:\\Users\\imeep\\.mixvideo\\temp\\video_storage\\0af48d09-7b7f-4453-84e6-e7b2b33f7726.mp4` - const assetUrl2 = convertFileSrc(path2); + const assetUrl2 = convertFileSrc(path2, 'file'); console.log({ filePath, assetUrl, assetUrl2, path2 }) } diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index ec2432d..ce264ae 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -59,9 +59,7 @@ const VideoPlayer: React.FC = ({ // 尝试多种方法加载视频 const tryLoadVideo = async (path: string) => { // 根据路径类型选择不同的加载策略 - const videoPath = path.split('\\').filter(it => it.length > 0).join('/') - console.log(`try load video videoPath`, {videoPath, path}) - const src = convertFileSrc(videoPath) + const src = convertFileSrc(path, 'file') console.log(`try load video src`, src) setVideoSrc(src) setLoadingMethod('convertFileSrc')