This commit is contained in:
yj 2024-12-19 16:13:53 +08:00
parent c9ca37d323
commit 2284b01d89
1 changed files with 26 additions and 7 deletions

View File

@ -171,6 +171,7 @@ const Meeting: React.FC = () => {
})
const [networkOther, setNetworkOther] = useState<RtcStats>({})
const [isComputerAudio, setIsComputerAudio] = useState(false)
const [_isLeave, setIsLeave] = useState(false)
const [isScreenCapture, setIsScreenCapture] = useState(false)
const [isFluencyPriority, setIsFluencyPriority] = useState(false)
const [open, setOpen] = useState(false)
@ -884,7 +885,7 @@ const Meeting: React.FC = () => {
}, 1, 3)
message.error('录制失败,请重新录制!')
}
recorder.onstop = async (event: any) => {
recorder.onstop = async () => {
}
recorder.ondataavailable = async (event: any) => {
@ -915,6 +916,16 @@ const Meeting: React.FC = () => {
onCancel() {
}
})
setIsLeave(bool => {
if (bool) {
if (userInfo.isAnonymous) {
storage.setItem('userLogin', false)
} else {
navigate('/home/index')
}
}
return false
})
};
reader.readAsArrayBuffer(blob);
}
@ -1680,6 +1691,7 @@ const Meeting: React.FC = () => {
}
// 退出房间
const leaveChannel = async (bool: boolean = true): Promise<void> => {
setIsLeave(true)
await stopScreenCapture()
await stopRecorderMedia()
if (bool) {
@ -1687,12 +1699,19 @@ const Meeting: React.FC = () => {
}
await agora.leaveChannel()
setTimeout(() => {
setRecorder((res: any) => {
if (res) {
} else {
if (userInfo.isAnonymous) {
storage.setItem('userLogin', false)
} else {
navigate('/home/index')
}
}, 2000)
}
return res
})
}, 1000)
}
// 分享屏幕
const clickSharedScreen = async (): Promise<void> => {