From 630b0d71c8cfa50ff13405806f2889559cf0d0e7 Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 3 Jul 2025 10:31:19 +0200 Subject: [PATCH] dont restart audio track on ios Signed-off-by: Timo K --- src/livekit/useLivekit.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/livekit/useLivekit.ts b/src/livekit/useLivekit.ts index 58f088f6..98034a79 100644 --- a/src/livekit/useLivekit.ts +++ b/src/livekit/useLivekit.ts @@ -47,6 +47,7 @@ import { useUrlParams } from "../UrlParams"; import { useInitial } from "../useInitial"; import { getValue } from "../utils/observable"; import { type SelectedDevice } from "../state/MediaDevices"; +import { platform } from "../Platform"; interface UseLivekitResult { livekitRoom?: Room; @@ -331,6 +332,7 @@ export function useLivekit( ): Subscription => selected$.subscribe((device) => { if ( + // !(kind === "audioinput" && platform === "ios") && device !== undefined && room.getActiveDevice(kind) !== device.id ) { @@ -357,6 +359,9 @@ export function useLivekit( devices.audioInput.selected$ .pipe(switchMap((device) => device?.hardwareDeviceChange$ ?? NEVER)) .subscribe(() => { + if (platform === "ios") { + return; + } const activeMicTrack = Array.from( room.localParticipant.audioTrackPublications.values(), ).find((d) => d.source === Track.Source.Microphone)?.track;