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