Open source video conferencing app powered by LiveKit. Built with Django and React.
🔥(frontend) remove buggy device-id resolution code
lebaudantoine5d50671b3c9b
diff --git a/src/frontend/src/features/rooms/components/Join.tsx b/src/frontend/src/features/rooms/components/Join.tsxindex a4e933cd..1d93fa60 100644--- a/src/frontend/src/features/rooms/components/Join.tsx+++ b/src/frontend/src/features/rooms/components/Join.tsx@@ -34,7 +34,6 @@ import { Spinner } from '@/primitives/Spinner'import { ApiAccessLevel } from '../api/ApiRoom'import { useLoginHint } from '@/hooks/useLoginHint'import { openPermissionsDialog } from '@/stores/permissions'-import { useResolveInitiallyDefaultDeviceId } from '../livekit/hooks/useResolveInitiallyDefaultDeviceId'import { isSafari } from '@/utils/livekit'import { reportError } from '@/features/analytics/telemetry'@@ -264,18 +263,6 @@ export const Join = ({const videoTrack = dynamicVideoTrack || previewVideoTrackconst audioTrack = dynamicAudioTrack || previewAudioTrack- // LiveKit by default populates device choices with "default" value.- // Instead, use the current device id used by the preview track as a default- useResolveInitiallyDefaultDeviceId(- audioDeviceId,- audioTrack,- saveAudioInputDeviceId- )- useResolveInitiallyDefaultDeviceId(- videoDeviceId,- videoTrack,- saveVideoInputDeviceId- )const videoEl = useRef(null)const isVideoInitiated = useRef(false)diff --git a/src/frontend/src/features/rooms/livekit/hooks/useResolveInitiallyDefaultDeviceId.ts b/src/frontend/src/features/rooms/livekit/hooks/useResolveInitiallyDefaultDeviceId.tsdeleted file mode 100644index 3af0fc2e..00000000--- a/src/frontend/src/features/rooms/livekit/hooks/useResolveInitiallyDefaultDeviceId.ts+++ /dev/null@@ -1,22 +0,0 @@-import { useEffect, useRef } from 'react'--export const useResolveInitiallyDefaultDeviceId = <- T extends { getDeviceId(): Promise<string | undefined> },->(- currentId: string,- track: T | undefined,- save: (id: string) => void-) => {- const isInitiated = useRef(false)- useEffect(() => {- if (currentId !== 'default' || !track || isInitiated.current) return- const resolveDefaultDeviceId = async () => {- const actualDeviceId = await track.getDeviceId()- if (actualDeviceId && actualDeviceId !== 'default') {- isInitiated.current = true- save(actualDeviceId)- }- }- resolveDefaultDeviceId()- }, [currentId, track, save])-}