mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-29 03:37:17 +00:00
🔥(frontend) remove buggy device-id resolution code
Remove the current device-id resolution code that was buggy and failed to resolve the device id correctly. A replacement will be introduced in upcoming commits.
This commit is contained in:
committed by
aleb_the_flash
parent
8615bf879c
commit
5d50671b3c
@@ -34,7 +34,6 @@ import { Spinner } from '@/primitives/Spinner'
|
|||||||
import { ApiAccessLevel } from '../api/ApiRoom'
|
import { ApiAccessLevel } from '../api/ApiRoom'
|
||||||
import { useLoginHint } from '@/hooks/useLoginHint'
|
import { useLoginHint } from '@/hooks/useLoginHint'
|
||||||
import { openPermissionsDialog } from '@/stores/permissions'
|
import { openPermissionsDialog } from '@/stores/permissions'
|
||||||
import { useResolveInitiallyDefaultDeviceId } from '../livekit/hooks/useResolveInitiallyDefaultDeviceId'
|
|
||||||
import { isSafari } from '@/utils/livekit'
|
import { isSafari } from '@/utils/livekit'
|
||||||
import { reportError } from '@/features/analytics/telemetry'
|
import { reportError } from '@/features/analytics/telemetry'
|
||||||
|
|
||||||
@@ -264,18 +263,6 @@ export const Join = ({
|
|||||||
const videoTrack = dynamicVideoTrack || previewVideoTrack
|
const videoTrack = dynamicVideoTrack || previewVideoTrack
|
||||||
const audioTrack = dynamicAudioTrack || previewAudioTrack
|
const 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 videoEl = useRef(null)
|
||||||
const isVideoInitiated = useRef(false)
|
const isVideoInitiated = useRef(false)
|
||||||
|
|||||||
@@ -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])
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user