From c9915d22523fdd6092133bd3667d6cb93189502e Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 3 Jul 2025 13:52:34 +0200 Subject: [PATCH] use "default" instead of "" Signed-off-by: Timo K --- src/livekit/useLivekit.ts | 4 ++-- src/state/CallViewModel.ts | 2 +- src/state/MediaDevices.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/livekit/useLivekit.ts b/src/livekit/useLivekit.ts index 3efbcf7f..5c086a01 100644 --- a/src/livekit/useLivekit.ts +++ b/src/livekit/useLivekit.ts @@ -117,7 +117,7 @@ export function useLivekit( // deviceId here, because it will be set by the native app. // (also the id does not need to match a browser device id) deviceId: controlledAudioDevices - ? "" + ? "default" : getValue(devices.audioOutput.selected$)?.id, }, e2ee, @@ -331,7 +331,7 @@ export function useLivekit( selected$.subscribe((device) => { let d = device; if (controlledAudioDevices && kind === "audiooutput") { - d = { id: "" }; + d = { id: "default" }; } logger.warn( "[LivekitRoom] syncDevice room.getActiveDevice(kind) !== d.id :", diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index fc1222c4..5b35c1bb 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -1276,7 +1276,7 @@ export class CallViewModel extends ViewModel { (available, selected) => { const selectionType = selected && available.get(selected.id)?.type; - // If we are in any output mode other than spaeker switch to speaker. + // If we are in any output mode other than speaker switch to speaker. const newSelectionType = selectionType === "speaker" ? "earpiece" : "speaker"; const newSelection = [...available].find( diff --git a/src/state/MediaDevices.ts b/src/state/MediaDevices.ts index 0712a3fa..fd5a40d6 100644 --- a/src/state/MediaDevices.ts +++ b/src/state/MediaDevices.ts @@ -306,7 +306,7 @@ class ControlledAudioOutput (available, preferredId) => { const id = preferredId ?? available.keys().next().value; return id === undefined - ? undefined + ? { id: "default", virtualEarpiece: false } : { id, virtualEarpiece: id === EARPIECE_CONFIG_ID }; }, ).pipe(this.scope.state());