From ff4903faf0e72eeda35d9ebb80a885d171de3a68 Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 3 Jul 2025 15:28:31 +0200 Subject: [PATCH] add back restart Signed-off-by: Timo K --- src/livekit/useLivekit.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/livekit/useLivekit.ts b/src/livekit/useLivekit.ts index d12507a7..7487a341 100644 --- a/src/livekit/useLivekit.ts +++ b/src/livekit/useLivekit.ts @@ -323,7 +323,13 @@ export function useLivekit( logger.error("Failed to sync video mute state with LiveKit", e); }); } - }, [room, muteStates, connectionState]); + }, [ + room, + muteStates, + connectionState, + devices.audioInput.selected$, + devices.videoInput.selected$, + ]); useEffect(() => { // Sync the requested devices with LiveKit's devices @@ -369,9 +375,9 @@ export function useLivekit( devices.audioInput.selected$ .pipe(switchMap((device) => device?.hardwareDeviceChange$ ?? NEVER)) .subscribe(() => { - if (platform === "ios") { - return; - } + // if (platform === "ios") { + // return; + // } const activeMicTrack = Array.from( room.localParticipant.audioTrackPublications.values(), ).find((d) => d.source === Track.Source.Microphone)?.track;