This commit is contained in:
parent
4d074cf28b
commit
523efcae2e
|
|
@ -15,9 +15,14 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
|
|||
let userInfo = JSON.parse(storage.getItem('user') as string)
|
||||
setUser(userInfo)
|
||||
setJoinRoomSettingModal(true)
|
||||
setJoinRoomSettingForm({
|
||||
...joinRoomSettingForm,
|
||||
roomNum,
|
||||
setJoinRoomSettingForm((res: any) => {
|
||||
res.list.forEach((item: any) => {
|
||||
item.active = false
|
||||
});
|
||||
return {
|
||||
...res,
|
||||
roomNum: roomNum
|
||||
}
|
||||
})
|
||||
if (location.hash.indexOf('/meeting') === -1) {
|
||||
agora.init()
|
||||
|
|
@ -107,7 +112,8 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
|
|||
<>
|
||||
<Modal title="
|
||||
" open={joinRoomSettingModal}
|
||||
footer={null} centered
|
||||
footer={null}
|
||||
centered
|
||||
width={'500px'}
|
||||
onCancel={() => {
|
||||
clearInterval(time)
|
||||
|
|
@ -143,16 +149,22 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
|
|||
{
|
||||
joinRoomSettingForm.list.map((item, index) => {
|
||||
return <div key={index} onClick={async () => {
|
||||
if (index === 0) {
|
||||
if (!deviceList.audioList.length) {
|
||||
message.error('未检测到麦克风!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!deviceList.videoList.length) {
|
||||
message.error('未检测到摄像头!')
|
||||
return
|
||||
let msg = '';
|
||||
setDeviceList((res: any) => {
|
||||
if (index === 0) {
|
||||
if (!res.audioList.length) {
|
||||
msg = '未检测到麦克风!'
|
||||
}
|
||||
} else {
|
||||
if (!res.videoList.length) {
|
||||
msg = '未检测到麦克风!'
|
||||
}
|
||||
}
|
||||
return res
|
||||
})
|
||||
if (msg) {
|
||||
message.error('未检测到麦克风!')
|
||||
return
|
||||
}
|
||||
const list = [...joinRoomSettingForm.list]
|
||||
list[index].active = !list[index].active
|
||||
|
|
|
|||
Loading…
Reference in New Issue