adapt v2 livekit-client

This commit is contained in:
fkwp
2024-04-19 16:59:53 +02:00
parent acdea0cb3c
commit 8ff05bb95f
4 changed files with 78 additions and 36 deletions

View File

@@ -293,7 +293,7 @@ export function useLiveKit(
room.options.audioCaptureDefaults?.deviceId === "default"
) {
const activeMicTrack = Array.from(
room.localParticipant.audioTracks.values(),
room.localParticipant.audioTrackPublications.values(),
).find((d) => d.source === Track.Source.Microphone)?.track;
const defaultDevice = device.available.find(
@@ -315,7 +315,7 @@ export function useLiveKit(
// Note that room.switchActiveDevice() won't work: Livekit will ignore it because
// the deviceId hasn't changed (was & still is default).
room.localParticipant
.getTrack(Track.Source.Microphone)
.getTrackPublication(Track.Source.Microphone)
?.audioTrack?.restartTrack();
}
} else {