use current device for mute unmute

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-07-03 15:13:42 +02:00
parent f1b9594a1e
commit 909f3955f8

View File

@@ -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;