完成视频渲染

This commit is contained in:
2026-04-25 18:34:54 +08:00
parent 261acf8bc1
commit bd3698d508
2 changed files with 42 additions and 14 deletions

View File

@@ -159,8 +159,12 @@ class UIRenderer {
this.renderRemoteVideo(state.session.remoteUser); // 渲染远程视频
this.renderUserList(state.session.localUser, state.session.remoteUser, state.participants); // 渲染用户列表
// Host端精准更新发送者participant tile的占位背景
if (changes.participantId) {
this.renderParticipantVideoPlaceholder(changes.participantId, !state.session.remoteUser.mediaState.video);
// 只有Host端需要处理participantId对应的tile占位符Participant端没有其他Participant的视频流
if (changes.participantId && state.session.localUser.isHost) {
// 从participants Map中读取该participant的video状态而非remoteUser多Participant场景remoteUser不精确
const pInfo = state.participants[changes.participantId];
const showPlaceholder = pInfo ? !pInfo.mediaState.video : true;
this.renderParticipantVideoPlaceholder(changes.participantId, showPlaceholder);
}
break;
case 'USER_LIST_UPDATE':