diff --git a/.DS_Store b/.DS_Store index d38f521..ec943fa 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/dist.zip b/dist.zip index a81236d..7ba799f 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/src/pages/CreateMeeting.jsx b/src/pages/CreateMeeting.jsx index 1353a24..4247ea4 100644 --- a/src/pages/CreateMeeting.jsx +++ b/src/pages/CreateMeeting.jsx @@ -125,6 +125,7 @@ const CreateMeeting = ({ user }) => { const formDataUpload = new FormData(); formDataUpload.append('audio_file', audioFile); formDataUpload.append('meeting_id', meetingId); + formDataUpload.append('auto_summarize', 'false'); await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, { headers: { diff --git a/src/pages/Dashboard.css b/src/pages/Dashboard.css index c7c41d5..d549135 100644 --- a/src/pages/Dashboard.css +++ b/src/pages/Dashboard.css @@ -80,7 +80,6 @@ display: grid; grid-template-columns: 300px 280px 1fr; gap: 2rem; - margin-bottom: 2rem; } /* 左侧列:用户卡片和知识库入口垂直排列 */ diff --git a/src/pages/MeetingDetails.jsx b/src/pages/MeetingDetails.jsx index 572159f..85d69f7 100644 --- a/src/pages/MeetingDetails.jsx +++ b/src/pages/MeetingDetails.jsx @@ -124,8 +124,23 @@ const MeetingDetails = ({ user }) => { clearInterval(summaryPollInterval); setSummaryPollInterval(null); } + // 停止音频播放 + if (audioRef.current) { + audioRef.current.pause(); + audioRef.current.currentTime = 0; + } }; }, [meeting_id]); + + // 监听audioUrl变化,确保音频正确重置 + useEffect(() => { + // 当audioUrl变化时,停止当前播放并重置audio元素 + if (audioRef.current) { + audioRef.current.pause(); + audioRef.current.currentTime = 0; + audioRef.current.load(); // 重新加载audio元素 + } + }, [audioUrl]); // Cleanup interval when status changes useEffect(() => { @@ -262,13 +277,37 @@ const MeetingDetails = ({ user }) => { // Fetch audio file if available try { const audioResponse = await apiClient.get(`${baseUrl}${audioEndpoint}`); - // Construct URL using uploads path and relative path from database - setAudioUrl(`${baseUrl}${audioResponse.data.file_path}`); + // Use streaming API endpoint for Safari compatibility (supports HTTP Range requests) + setAudioUrl(`${baseUrl}/api/meetings/${meeting_id}/audio/stream`); setAudioFileName(audioResponse.data.file_name); + + // 重置音频状态(新会议的音频) + setIsPlaying(false); + setCurrentTime(0); + setDuration(0); + setAudioLoading(true); + setAudioCanPlay(false); + setAudioBuffering(false); + setAudioError(null); + setCurrentSubtitle(''); + setCurrentSpeaker(''); + setCurrentHighlightIndex(-1); } catch (audioError) { console.warn('No audio file available:', audioError); setAudioUrl(null); setAudioFileName(null); + + // 重置音频状态(无音频) + setIsPlaying(false); + setCurrentTime(0); + setDuration(0); + setAudioLoading(false); + setAudioCanPlay(false); + setAudioBuffering(false); + setAudioError(null); + setCurrentSubtitle(''); + setCurrentSpeaker(''); + setCurrentHighlightIndex(-1); } // Fetch transcript segments from database @@ -397,6 +436,7 @@ const MeetingDetails = ({ user }) => { formDataUpload.append('audio_file', audioFile); formDataUpload.append('meeting_id', meeting_id); formDataUpload.append('force_replace', 'true'); + formDataUpload.append('auto_summarize', 'false'); const response = await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, { headers: { @@ -1226,6 +1266,7 @@ const MeetingDetails = ({ user }) => { )}