From 1731519143edfbbd58132acd30db45c7f87f2713 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Mon, 11 Aug 2025 15:21:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=89=E5=BE=85=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E9=BB=98=E8=AE=A4=E8=A7=86=E9=A2=91=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E8=AF=BB=E6=96=87=E6=9C=AC=E4=B8=8D?= =?UTF-8?q?=E9=9F=B3=E9=A2=91=E7=94=9F=E6=88=90=E6=85=A2=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=92=AD=E6=94=BE=E5=8F=A3=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 12 +++++++----- src/minimaxi_stream.js | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index cca2936..4a43ae6 100644 --- a/src/index.js +++ b/src/index.js @@ -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,7 +362,11 @@ class WebRTCChat { }; checkReady(); }); - + this.avatarContainer.style.display = 'none'; + + // 隐藏等待连接提示 + this.hideConnectionWaiting(); + // 确保视频开始播放 try { await this.recordedVideo.play(); @@ -1165,13 +1171,9 @@ class WebRTCChat { // 隐藏头像,显示视频 if (this.videoContainer) { - this.avatarContainer.style.display = 'none'; this.videoContainer.classList.add('calling'); } - - // 隐藏等待连接提示 - this.hideConnectionWaiting(); // 显示结束通话按钮 this.stopButton.style.display = 'block'; diff --git a/src/minimaxi_stream.js b/src/minimaxi_stream.js index 3b8a5ce..f50f201 100644 --- a/src/minimaxi_stream.js +++ b/src/minimaxi_stream.js @@ -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');