From 909f3955f8b4fc4460040ab3739313283b6e5ab3 Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 3 Jul 2025 15:13:42 +0200 Subject: [PATCH] use current device for mute unmute Signed-off-by: Timo K --- src/livekit/useLivekit.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/livekit/useLivekit.ts b/src/livekit/useLivekit.ts index 48327b17..d12507a7 100644 --- a/src/livekit/useLivekit.ts +++ b/src/livekit/useLivekit.ts @@ -245,7 +245,10 @@ export function useLivekit( audioMuteUpdating.current = true; trackPublication = await participant.setMicrophoneEnabled( buttonEnabled.current.audio, - room.options.audioCaptureDefaults, + { + ...room.options.audioCaptureDefaults, + deviceId: getValue(devices.audioInput.selected$)?.id, + }, ); audioMuteUpdating.current = false; break; @@ -253,7 +256,10 @@ export function useLivekit( videoMuteUpdating.current = true; trackPublication = await participant.setCameraEnabled( buttonEnabled.current.video, - room.options.videoCaptureDefaults, + { + ...room.options.videoCaptureDefaults, + deviceId: getValue(devices.videoInput.selected$)?.id, + }, ); videoMuteUpdating.current = false; break;