From 4c50f778891c21bf449fefd0ff0a24327dd6f119 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Mon, 11 Aug 2025 14:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8A=A0=E8=BD=BD=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E5=9C=A8=E8=A7=86=E9=A2=91=E5=87=BA=E6=9D=A5=E5=89=8D?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/index.js b/src/index.js index d88608e..cca2936 100644 --- a/src/index.js +++ b/src/index.js @@ -1117,10 +1117,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); } } @@ -1161,14 +1162,21 @@ class WebRTCChat { this.startButton.disabled = true; this.startButton.style.opacity = '0.5' this.stopButton.disabled = false; + + // 隐藏头像,显示视频 + if (this.videoContainer) { + this.avatarContainer.style.display = 'none'; + + this.videoContainer.classList.add('calling'); + } + + // 隐藏等待连接提示 + this.hideConnectionWaiting(); // 显示结束通话按钮 this.stopButton.style.display = 'block'; - // 隐藏头像,显示视频 - if (this.videoContainer) { - this.videoContainer.classList.add('calling'); - } + this.updateAudioStatus('已连接', 'connected'); this.logMessage('音频通话已开始', 'success'); @@ -1186,8 +1194,7 @@ class WebRTCChat { // 开始播放当前场景的默认视频 // await this.precreateImportantVideos(); - // 隐藏等待连接提示 - this.hideConnectionWaiting(); + } catch (error) { this.logMessage(`开始通话失败: ${error.message}`, 'error');