🐛(frontend) treat "Timeout starting source" AbortError as device-in-use

Also consider `AbortError` with a message like "Timeout starting
video/audio source" as an "already in use" device error.

This can happen for other reasons in theory, but in practice most
occurrences are caused by another application still holding the
camera or microphone.

Route it through the existing device-in-use handling so users get
the same clear explanation as with the standard error, instead of a
generic failure.
This commit is contained in:
lebaudantoine
2026-08-22 22:48:08 +02:00
committed by aleb_the_flash
parent 2ec3f54532
commit a9fa3eb4ba
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -34,6 +34,7 @@ and this project adheres to
- 🐛(frontend) fix joined notification tile no longer rendering properly
- 🐛(frontend) handle device-in-use errors on Chrome / Windows 10
- 🐛(frontend) handle Firefox/Windows AbortError on device start
- 🐛(frontend) treat "Timeout starting source" AbortError as device-in-use
## [1.27.0] - 2026-08-14
@@ -22,6 +22,9 @@ import { getOS } from '@/utils/os'
*/
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.
* Firefox reports a device held by another app as
@@ -36,7 +39,7 @@ export const getMediaDeviceFailure = (
if (
failure === MediaDeviceFailure.Other &&
error.name === 'AbortError' &&
/^Starting (video|audio)input failed/i.test(error.message)
DEVICE_START_FAILURE.test(error.message)
) {
return MediaDeviceFailure.DeviceInUse
}