diff --git a/src/App.tsx b/src/App.tsx index fc7b8f0..4488bf5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect } from 'react' import { Routes, Route } from 'react-router-dom' import Layout from './components/Layout' import HomePage from './pages/HomePage' @@ -17,7 +17,38 @@ import KVTestPage from './pages/KVTestPage' import TextVideoGeneratorPage from './pages/TextVideoGeneratorPage' import PythonCoreTestPage from './pages/PythonCoreTestPage' import PythonEnvManagerPage from './pages/PythonEnvManagerPage' +import * as path from '@tauri-apps/api/path'; +import { convertFileSrc } from '@tauri-apps/api/core' + function App() { + async function testPath(){ + console.log({ + appCacheDir: await path.appCacheDir(), + appConfigDir: await path.appConfigDir(), + appDataDir: await path.appDataDir(), + appLocalDataDir: await path.appLocalDataDir(), + audioDir: await path.audioDir(), + cacheDir: await path.cacheDir(), + configDir: await path.configDir(), + dataDir: await path.dataDir(), + desktopDir: await path.desktopDir(), + documentDir: await path.documentDir(), + downloadDir: await path.downloadDir(), + executableDir: await path.executableDir(), + fontDir: await path.fontDir(), + homeDir: await path.homeDir(), + localDataDir: await path.localDataDir(), + pictureDir: await path.pictureDir(), + publicDir: await path.publicDir(), + }) + + const mp4 = await path.join(await path.publicDir(), '1.mp4') + const url = convertFileSrc(mp4) + console.log({mp4, url}) + } + useEffect(()=>{ + testPath() + }, []) return ( {/* 项目详情页 - 无侧边栏布局 */} diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index 5981df5..52f83b2 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -1,7 +1,6 @@ import React, { useState, useRef, useEffect } from 'react' import { Play, Pause, Volume2, VolumeX, Maximize2, X, AlertCircle } from 'lucide-react' import { convertFileSrc, invoke } from '@tauri-apps/api/core' - interface VideoPlayerProps { videoPath: string isOpen: boolean