【m】增加多用户连接

This commit is contained in:
2026-04-23 15:22:24 +08:00
parent cb32582c98
commit 852a169c30
8 changed files with 797 additions and 155 deletions

View File

@@ -174,6 +174,10 @@ class UIRenderer {
// 通话结束 - 渲染通话结束界面
this.renderCallEnded();
break;
case 'PARTICIPANT_LEFT':
// participant离开 - 更新UI但房间仍然存在
this.renderParticipantLeft(changes.connectionId);
break;
}
}
@@ -892,6 +896,19 @@ class UIRenderer {
window.location.href = './endcall/endcall.html';
}
// 渲染participant离开host端房间仍然存在
renderParticipantLeft(connectionId) {
console.log(`Participant left: ${connectionId}, updating UI`);
// 更新远程用户状态显示为离线
if (this.elements.remoteNetworkIndicator) {
this.elements.remoteNetworkIndicator.className = 'w-2 h-2 bg-gray-500 rounded-full';
}
// 显示断开连接的遮罩层(如果存在)
if (this.elements.disconnectedOverlay) {
this.elements.disconnectedOverlay.classList.remove('hidden');
}
}
// 获取状态文本
getStatusText(status) {
const statusMap = {