From 7ff9e1a097bf801a635906d5bed7a447d84c46e9 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Tue, 18 Aug 2026 10:09:22 +0200 Subject: [PATCH] fix(call): list real audio and video devices in the call preview --- src/app/features/call/CallDevicePreview.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/features/call/CallDevicePreview.tsx b/src/app/features/call/CallDevicePreview.tsx index c5573c0a1..2d2178b2c 100644 --- a/src/app/features/call/CallDevicePreview.tsx +++ b/src/app/features/call/CallDevicePreview.tsx @@ -10,11 +10,12 @@ type DeviceSelectProps = { kind: MediaDeviceKind; deviceId?: string; onChange: (deviceId: string) => void; - permissionsGranted: boolean; + hasTrack: boolean; }; -function DeviceSelect({ label, kind, deviceId, onChange, permissionsGranted }: DeviceSelectProps) { - const { devices } = useMediaDeviceSelect({ kind, requestPermissions: permissionsGranted }); +function DeviceSelect({ label, kind, deviceId, onChange, hasTrack }: DeviceSelectProps) { + const { devices } = useMediaDeviceSelect({ kind, requestPermissions: hasTrack }); + const namedDevices = devices.filter((device) => device.deviceId !== ''); return ( @@ -26,7 +27,7 @@ function DeviceSelect({ label, kind, deviceId, onChange, permissionsGranted }: D onChange={(event) => onChange(event.target.value)} > - {devices.map((device, index) => ( + {namedDevices.map((device, index) => ( @@ -126,14 +127,14 @@ export function CallDevicePreview({ kind="audioinput" deviceId={audioDeviceId} onChange={onAudioDeviceChange} - permissionsGranted={microphone} + hasTrack={!!audioTrack} />