This commit is contained in:
parent
2f1f8b920b
commit
fb9e8b14ce
|
|
@ -770,6 +770,20 @@ const Meeting: React.FC = () => {
|
|||
// 开关麦克风
|
||||
const postOpenMicr = async (enableMicr: boolean, uid: string, isAll?: boolean): Promise<void> => {
|
||||
if (getUserRoomInfo()) {
|
||||
if (!isAll) {
|
||||
let msg = '';
|
||||
if (uid === user.uid) {
|
||||
await agora.getAudioMediaList().then(res => {
|
||||
if (!res.ecordingList.length) {
|
||||
msg = '未检测到麦克风!'
|
||||
}
|
||||
})
|
||||
}
|
||||
if (msg) {
|
||||
message.error(msg)
|
||||
return
|
||||
}
|
||||
}
|
||||
postOpenMicrApi(enableMicr, uid, isAll)
|
||||
} else {
|
||||
message.error(msgTips)
|
||||
|
|
@ -783,18 +797,6 @@ const Meeting: React.FC = () => {
|
|||
enableMicr
|
||||
})
|
||||
} else {
|
||||
let msg = '';
|
||||
if (uid === user.uid) {
|
||||
await agora.getAudioMediaList().then(res => {
|
||||
if (!res.ecordingList.length) {
|
||||
msg = '未检测到麦克风!'
|
||||
}
|
||||
})
|
||||
}
|
||||
if (msg) {
|
||||
message.error(msg)
|
||||
return
|
||||
}
|
||||
await PostOpenMicr({
|
||||
roomNum: state.channelId,
|
||||
uid,
|
||||
|
|
|
|||
Loading…
Reference in New Issue