This commit is contained in:
yj 2024-08-14 15:05:54 +08:00
parent 28119cb828
commit 2e26bdf63f
2 changed files with 9 additions and 6 deletions

View File

@ -144,6 +144,8 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
token,
roomId: res.data.id,
roomName: res.data.roomName,
enableMicr: joinRoomSettingForm.list[0].active,
enableCamera: joinRoomSettingForm.list[1].active,
}
})
}

View File

@ -137,7 +137,7 @@ const Meeting: React.FC = () => {
agora.registerEventHandler({
onJoinChannelSuccess: async (info: any, _elapsed: any) => {
if (String(info.localUid).length !== 9) {
await getJoin()
await getJoin(state.enableMicr, state.enableCamera)
setTimeout(async () => {
await agora.setupLocalVideo({
uid: Number(info.localUid),
@ -418,7 +418,7 @@ const Meeting: React.FC = () => {
message.success('网络已恢复。')
setTimeout(async () => {
await onStart(async () => {
await getJoin()
await getJoin(!footerList[0][0].active, !footerList[0][1].active)
})
}, 1000)
} else {
@ -680,6 +680,7 @@ const Meeting: React.FC = () => {
})
setRoomUserList(res.data)
callback && callback(res.data)
changeAgoraDevice()
}
})
}
@ -691,7 +692,7 @@ const Meeting: React.FC = () => {
case 'reconnect':
if (e.value == true) {
storage.setItem('reconnect', false)
await getJoin()
await getJoin(!footerList[0][0].active, !footerList[0][1].active)
}
break;
}
@ -792,11 +793,11 @@ const Meeting: React.FC = () => {
return ''
}
// 加入房间
const getJoin = async (): Promise<void> => {
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
await GetJoin({
roomNum: state.channelId,
enableMicr: true,
enableCamera: true
enableMicr,
enableCamera
})
await getRoomUser()
}