From b814efc21f354121035bc8a9528657b96a745b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 10 Jul 2023 16:51:33 +0200 Subject: [PATCH] Add a comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/room/VideoPreview.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/room/VideoPreview.tsx b/src/room/VideoPreview.tsx index 3cc773b3..beeea010 100644 --- a/src/room/VideoPreview.tsx +++ b/src/room/VideoPreview.tsx @@ -152,6 +152,11 @@ export function VideoPreview({ matrixInfo, onUserChoicesChanged }: Props) { setInitializingAudio(false); } audioTrack?.getDeviceId().then((audioId) => { + // getDeviceId() can return undefined for audio devices. This happens if + // the devices list uses "default" as the device id for the current + // device and the device set on the track also uses the deviceId + // "default". Check `normalizeDeviceId` in `getDeviceId` for more + // details. audioIn.setSelected(audioId ?? "default"); }); }