wip extend device in use error

This commit is contained in:
lebaudantoine
2026-08-22 22:48:08 +02:00
parent 13f2c25299
commit ef77157bc6
@@ -22,6 +22,9 @@ import { getOS } from '@/utils/os'
*/ */
export type MediaPath = 'join_preview' | 'room' export type MediaPath = 'join_preview' | 'room'
const DEVICE_START_FAILURE =
/^(Starting (video|audio)input failed|Timeout starting (video|audio) source)/i
/** /**
* LiveKit only maps NotReadableError/TrackStartError to DeviceInUse. * LiveKit only maps NotReadableError/TrackStartError to DeviceInUse.
* Firefox reports a device held by another app as * Firefox reports a device held by another app as
@@ -36,7 +39,7 @@ export const getMediaDeviceFailure = (
if ( if (
failure === MediaDeviceFailure.Other && failure === MediaDeviceFailure.Other &&
error.name === 'AbortError' && error.name === 'AbortError' &&
/^Starting (video|audio)input failed/i.test(error.message) DEVICE_START_FAILURE.test(error.message)
) { ) {
return MediaDeviceFailure.DeviceInUse return MediaDeviceFailure.DeviceInUse
} }