优化退出时机

This commit is contained in:
yj 2024-07-22 11:13:56 +08:00
parent 90de7d2959
commit f0adb74232
1 changed files with 4 additions and 4 deletions

View File

@ -152,9 +152,6 @@ const Meeting: React.FC = () => {
},
onUserOffline: async (info: any, remoteUid: any, reason: any) => {
console.log(remoteUid, "离开");
await onInvoke('levelChannel', {
roomNum: info.channelId
})
agora.setupRemoteVideo({
account: Number(remoteUid),
view: document.getElementById(`video-${remoteUid}`) as HTMLElement,
@ -333,7 +330,10 @@ const Meeting: React.FC = () => {
}
}
// 退出房间
const leaveChannel = (): void => {
const leaveChannel = async (): Promise<void> => {
await onInvoke('levelChannel', {
roomNum: state.channelId
})
agora.leaveChannel()
agora.stopScreenCapture()
navigate(-1)