添加延时

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> => { const refreshVideoView = async (userItem: any): Promise<void> => {
if (userItem.uid === userInfo.uid) { if (userItem.uid === userInfo.uid) {
await agora.setupLocalVideo({ setTimeout(async () => {
uid: Number(userItem.uid), await agora.setupLocalVideo({
view: document.getElementById(`video-${userItem.uid}`), uid: Number(userItem.uid),
channelId: state.channelId, view: document.getElementById(`video-${userItem.uid}`),
sourceType: VideoSourceType.VideoSourceCameraPrimary, channelId: state.channelId,
}) sourceType: VideoSourceType.VideoSourceCameraPrimary,
})
}, 1000);
} else { } else {
await agora.setupRemoteVideoJoin({ setTimeout(async () => {
uid: Number(userItem.uid), await agora.setupRemoteVideoJoin({
view: document.getElementById(`video-${userItem.uid}`), uid: Number(userItem.uid),
channelId: state.channelId, view: document.getElementById(`video-${userItem.uid}`),
}) channelId: state.channelId,
})
}, 1000);
} }
} }
// 替换数据 // 替换数据