|
@@ -14,18 +14,23 @@ const muteVideoLeader = ref(false);
|
|
|
|
|
|
|
|
|
|
export const updateDevice = async () => {
|
|
export const updateDevice = async () => {
|
|
- console.log("updateDevice");
|
|
|
|
- const rtcStore = useRtcStore()
|
|
|
|
- const microphoneItems = await TRTC.getMicrophones();
|
|
|
|
- microphoneItems.forEach((item) => {
|
|
|
|
- item['value'] = item.deviceId;
|
|
|
|
- });
|
|
|
|
- if (microphoneItems?.length) {
|
|
|
|
- rtcStore.setAudioDeviceId(microphoneItems[0].deviceId)
|
|
|
|
- } else {
|
|
|
|
- rtcStore.setAudioDeviceId('')
|
|
|
|
|
|
+ try {
|
|
|
|
+ console.log("updateDevice");
|
|
|
|
+ const rtcStore = useRtcStore()
|
|
|
|
+ const microphoneItems = await TRTC.getMicrophones();
|
|
|
|
+ microphoneItems.forEach((item) => {
|
|
|
|
+ item['value'] = item.deviceId;
|
|
|
|
+ });
|
|
|
|
+ if (microphoneItems?.length) {
|
|
|
|
+ rtcStore.setAudioDeviceId(microphoneItems[0].deviceId)
|
|
|
|
+ } else {
|
|
|
|
+ rtcStore.setAudioDeviceId('')
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -62,7 +67,6 @@ async function createRTCSocket(): Promise<void> {
|
|
try {
|
|
try {
|
|
const rtcStore = useRtcStore()
|
|
const rtcStore = useRtcStore()
|
|
await checkoutIsExistAudioInput();
|
|
await checkoutIsExistAudioInput();
|
|
-
|
|
|
|
await updateDevice()
|
|
await updateDevice()
|
|
// const microphoneItems = await TRTC.getMicrophones();
|
|
// const microphoneItems = await TRTC.getMicrophones();
|
|
|
|
|
|
@@ -355,7 +359,7 @@ async function handleStreamSubscribed(event) {
|
|
})
|
|
})
|
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
-
|
|
|
|
|
|
+
|
|
Dialog.confirm({
|
|
Dialog.confirm({
|
|
showCloseIcon: false,
|
|
showCloseIcon: false,
|
|
okText: "确定",
|
|
okText: "确定",
|