增加了自动总结
parent
4df2f40e9c
commit
ed628738d2
|
|
@ -125,6 +125,7 @@ const CreateMeeting = ({ user }) => {
|
||||||
const formDataUpload = new FormData();
|
const formDataUpload = new FormData();
|
||||||
formDataUpload.append('audio_file', audioFile);
|
formDataUpload.append('audio_file', audioFile);
|
||||||
formDataUpload.append('meeting_id', meetingId);
|
formDataUpload.append('meeting_id', meetingId);
|
||||||
|
formDataUpload.append('auto_summarize', 'false');
|
||||||
|
|
||||||
await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
|
await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 300px 280px 1fr;
|
grid-template-columns: 300px 280px 1fr;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 左侧列:用户卡片和知识库入口垂直排列 */
|
/* 左侧列:用户卡片和知识库入口垂直排列 */
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,23 @@ const MeetingDetails = ({ user }) => {
|
||||||
clearInterval(summaryPollInterval);
|
clearInterval(summaryPollInterval);
|
||||||
setSummaryPollInterval(null);
|
setSummaryPollInterval(null);
|
||||||
}
|
}
|
||||||
|
// 停止音频播放
|
||||||
|
if (audioRef.current) {
|
||||||
|
audioRef.current.pause();
|
||||||
|
audioRef.current.currentTime = 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [meeting_id]);
|
}, [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
|
// Cleanup interval when status changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -262,13 +277,37 @@ const MeetingDetails = ({ user }) => {
|
||||||
// Fetch audio file if available
|
// Fetch audio file if available
|
||||||
try {
|
try {
|
||||||
const audioResponse = await apiClient.get(`${baseUrl}${audioEndpoint}`);
|
const audioResponse = await apiClient.get(`${baseUrl}${audioEndpoint}`);
|
||||||
// Construct URL using uploads path and relative path from database
|
// Use streaming API endpoint for Safari compatibility (supports HTTP Range requests)
|
||||||
setAudioUrl(`${baseUrl}${audioResponse.data.file_path}`);
|
setAudioUrl(`${baseUrl}/api/meetings/${meeting_id}/audio/stream`);
|
||||||
setAudioFileName(audioResponse.data.file_name);
|
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) {
|
} catch (audioError) {
|
||||||
console.warn('No audio file available:', audioError);
|
console.warn('No audio file available:', audioError);
|
||||||
setAudioUrl(null);
|
setAudioUrl(null);
|
||||||
setAudioFileName(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
|
// Fetch transcript segments from database
|
||||||
|
|
@ -397,6 +436,7 @@ const MeetingDetails = ({ user }) => {
|
||||||
formDataUpload.append('audio_file', audioFile);
|
formDataUpload.append('audio_file', audioFile);
|
||||||
formDataUpload.append('meeting_id', meeting_id);
|
formDataUpload.append('meeting_id', meeting_id);
|
||||||
formDataUpload.append('force_replace', 'true');
|
formDataUpload.append('force_replace', 'true');
|
||||||
|
formDataUpload.append('auto_summarize', 'false');
|
||||||
|
|
||||||
const response = await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
|
const response = await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -1226,6 +1266,7 @@ const MeetingDetails = ({ user }) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<audio
|
<audio
|
||||||
|
key={audioUrl || 'no-audio'} // 使用audioUrl作为key,确保切换会议时重新创建audio元素
|
||||||
ref={audioRef}
|
ref={audioRef}
|
||||||
onTimeUpdate={handleTimeUpdate}
|
onTimeUpdate={handleTimeUpdate}
|
||||||
onLoadedMetadata={handleLoadedMetadata}
|
onLoadedMetadata={handleLoadedMetadata}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue