This commit is contained in:
yj 2024-08-14 16:28:21 +08:00
parent 523efcae2e
commit 37c309a279
1 changed files with 18 additions and 16 deletions

View File

@ -148,20 +148,20 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
<div> <div>
{ {
joinRoomSettingForm.list.map((item, index) => { joinRoomSettingForm.list.map((item, index) => {
return <div key={index} onClick={async () => { return <div key={index} onClick={() => {
let msg = ''; let msg = '';
setDeviceList((res: any) => { setDeviceList((res: any) => {
if (index === 0) { if (index === 0) {
if (!res.audioList.length) { if (!res.audioList.length) {
msg = '未检测到麦克风!' msg = '未检测到麦克风!'
console.log(msg);
} }
} else { } else {
if (!res.videoList.length) { if (!res.videoList.length) {
msg = '未检测到麦克风!' msg = '未检测到麦克风!'
} }
} }
return res
})
if (msg) { if (msg) {
message.error('未检测到麦克风!') message.error('未检测到麦克风!')
return return
@ -174,9 +174,11 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
}) })
if (index === 1) { if (index === 1) {
if (list[index].active) { if (list[index].active) {
await agora.startPreview('videoPreview', Number(user.account)) agora.startPreview('videoPreview', Number(user.account))
} }
} }
return res
})
}}> }}>
<img src={item.active ? item.icon : item.iconActive} alt="" /> <img src={item.active ? item.icon : item.iconActive} alt="" />
</div> </div>