添加延时

This commit is contained in:
yj 2024-09-05 14:07:20 +08:00
parent cb2940249c
commit 6babcdbfd0
1 changed files with 15 additions and 11 deletions

View File

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