同new_male 分支一样修改问题
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m7s

This commit is contained in:
宋居成 2025-08-11 15:24:05 +08:00
parent 15374be668
commit 7075e58331
2 changed files with 21 additions and 12 deletions

View File

@ -334,6 +334,8 @@ class WebRTCChat {
}
// 设置视频流
this.recordedVideoBuffer.style.zIndex = "1";
this.recordedVideo.style.zIndex = "2";
this.currentVideoStream = defaultStream;
this.recordedVideo.srcObject = defaultStream;
this.recordedVideoBuffer.srcObject = this.precreatedStreams.get(this.interactionVideo);
@ -360,6 +362,10 @@ class WebRTCChat {
};
checkReady();
});
this.avatarContainer.style.display = 'none';
// 隐藏等待连接提示
this.hideConnectionWaiting();
// 确保视频开始播放
try {
@ -1117,10 +1123,11 @@ class WebRTCChat {
hideConnectionWaiting() {
if (this.connectionWaiting) {
this.connectionWaiting.classList.remove('show');
// 等待动画完成后隐藏元素
setTimeout(() => {
this.connectionWaiting.style.display = 'none';
}, 300);
this.connectionWaiting.style.display = 'none';
// // 等待动画完成后隐藏元素
// setTimeout(() => {
// this.connectionWaiting.style.display = 'none';
// }, 300);
}
}
@ -1162,13 +1169,16 @@ class WebRTCChat {
this.startButton.style.opacity = '0.5'
this.stopButton.disabled = false;
// 隐藏头像,显示视频
if (this.videoContainer) {
this.videoContainer.classList.add('calling');
}
// 显示结束通话按钮
this.stopButton.style.display = 'block';
// 隐藏头像,显示视频
if (this.videoContainer) {
this.videoContainer.classList.add('calling');
}
this.updateAudioStatus('已连接', 'connected');
this.logMessage('音频通话已开始', 'success');
@ -1186,8 +1196,7 @@ class WebRTCChat {
// 开始播放当前场景的默认视频
// await this.precreateImportantVideos();
// 隐藏等待连接提示
this.hideConnectionWaiting();
} catch (error) {
this.logMessage(`开始通话失败: ${error.message}`, 'error');

View File

@ -68,7 +68,7 @@ async function processAudioQueue() {
const sayName = '8-4-sh'
const targetVideo = window.webrtcApp.interactionVideo
// 如果是第一个音频片段,触发视频切换
if (isFirstChunk && sayName != window.webrtcApp.currentVideoTag && window.webrtcApp && window.webrtcApp.switchVideoStream) {
if (sayName != window.webrtcApp.currentVideoTag && window.webrtcApp && window.webrtcApp.switchVideoStream) {
try {
console.log('--------------触发视频切换:', sayName);
window.webrtcApp.switchVideoStream(targetVideo, 'audio', '8-4-sh');