优化频繁切换用户身份系统卡顿

This commit is contained in:
yj 2024-12-27 16:49:44 +08:00
parent c07de8d2a1
commit 3723873d71
1 changed files with 11 additions and 15 deletions

View File

@ -1226,22 +1226,18 @@ const Meeting: React.FC = () => {
// 刷新
const refreshVideoView = async (userItem: any): Promise<void> => {
if (userItem.uid === userInfo.uid) {
setTimeout(async () => {
await agora.setupLocalVideo({
uid: Number(userItem.uid),
view: document.getElementById(`video-${userItem.uid}`),
channelId: state.channelId,
sourceType: VideoSourceType.VideoSourceCameraPrimary,
})
}, 1500);
await agora.setupLocalVideo({
uid: Number(userItem.uid),
view: document.getElementById(`video-${userItem.uid}`),
channelId: state.channelId,
sourceType: VideoSourceType.VideoSourceCameraPrimary,
})
} else {
setTimeout(async () => {
await agora.setupRemoteVideoJoin({
uid: Number(userItem.uid),
view: document.getElementById(`video-${userItem.uid}`),
channelId: state.channelId,
})
}, 1500);
await agora.setupRemoteVideoJoin({
uid: Number(userItem.uid),
view: document.getElementById(`video-${userItem.uid}`),
channelId: state.channelId,
})
}
}
// 替换数据