diff --git a/src/components/JoinSetting/index.tsx b/src/components/JoinSetting/index.tsx index 1d9b518..61f054e 100644 --- a/src/components/JoinSetting/index.tsx +++ b/src/components/JoinSetting/index.tsx @@ -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, } }) } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index d0a01ca..987ca1c 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -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 => { + const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise => { await GetJoin({ roomNum: state.channelId, - enableMicr: true, - enableCamera: true + enableMicr, + enableCamera }) await getRoomUser() }