diff --git a/WebApp/client/public/onebyone/renderer.js b/WebApp/client/public/onebyone/renderer.js index f7244cc..13f571f 100644 --- a/WebApp/client/public/onebyone/renderer.js +++ b/WebApp/client/public/onebyone/renderer.js @@ -203,6 +203,40 @@ class UIRenderer { this.elements.remoteStatus.textContent = this.getStatusText(remoteUser.status); } + // 当远程视频关闭时显示占位符 + if (this.elements.remoteVideoPlaceholder) { + const shouldShowPlaceholder = !remoteUser.mediaState.video; + toggleElement(this.elements.remoteVideoPlaceholder, shouldShowPlaceholder); + + // 更新占位符文本内容 + if (shouldShowPlaceholder) { + const placeholderContent = this.elements.remoteVideoPlaceholder.querySelector('.text-center'); + if (placeholderContent) { + const titleElement = placeholderContent.querySelector('p.text-white.text-lg.font-medium'); + if (titleElement) { + titleElement.textContent = '对方摄像头已关闭'; + } + const subtitleElement = placeholderContent.querySelector('p.text-sm.text-gray-400'); + if (subtitleElement) { + subtitleElement.textContent = '对方暂时关闭了视频'; + } + } + } else { + // 恢复默认占位符文本 + const placeholderContent = this.elements.remoteVideoPlaceholder.querySelector('.text-center'); + if (placeholderContent) { + const titleElement = placeholderContent.querySelector('p.text-white.text-lg.font-medium'); + if (titleElement) { + titleElement.textContent = '等待对方连接...'; + } + const subtitleElement = placeholderContent.querySelector('p.text-sm.text-gray-400'); + if (subtitleElement) { + subtitleElement.textContent = '请确保对方已加入通话'; + } + } + } + } + // 渲染说话状态 if (this.elements.remoteSpeakingIndicator) { toggleElement(this.elements.remoteSpeakingIndicator, remoteUser.mediaState.isSpeaking);