优化退出时机
This commit is contained in:
parent
90de7d2959
commit
f0adb74232
|
|
@ -152,9 +152,6 @@ const Meeting: React.FC = () => {
|
||||||
},
|
},
|
||||||
onUserOffline: async (info: any, remoteUid: any, reason: any) => {
|
onUserOffline: async (info: any, remoteUid: any, reason: any) => {
|
||||||
console.log(remoteUid, "离开");
|
console.log(remoteUid, "离开");
|
||||||
await onInvoke('levelChannel', {
|
|
||||||
roomNum: info.channelId
|
|
||||||
})
|
|
||||||
agora.setupRemoteVideo({
|
agora.setupRemoteVideo({
|
||||||
account: Number(remoteUid),
|
account: Number(remoteUid),
|
||||||
view: document.getElementById(`video-${remoteUid}`) as HTMLElement,
|
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.leaveChannel()
|
||||||
agora.stopScreenCapture()
|
agora.stopScreenCapture()
|
||||||
navigate(-1)
|
navigate(-1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue