DevicesNotFoundError: Please Help :)

1,266 views
Skip to first unread message

Avgustina Pasheeva

unread,
Aug 5, 2016, 6:42:38 AM8/5/16
to discuss-webrtc
Hi guys,

We started observing a pretty interesting error "DevicesNotFoundError" and I was wondering if anybody has seen something like this, have an idea why it happens and potentially have a fix for that. My assumptions so far are:

1/ It's related to "get user media" and it happens after a person blocks access to camera and microphone from either Chrome or FireFox
2/ It happens if the person has an old school laptop/computer without video - less likely since he/she can still do an audio call 

I would really appreciate any help/support. 

Thanks in advance. 

Christoffer Jansson

unread,
Aug 5, 2016, 6:53:39 AM8/5/16
to discuss-webrtc
Hi,

Yes, its an error returned by getUserMedia when a device is missing, I'm not sure though if that error is returned when requesting audio+video and one of them is missing or if it's returned when no media device is detected at all.

What you could do in that case, is to make another request (in the rejected promise callback) for audio only and if that works, you know there are no cameras and continue with audio.

Alternatively you can use the enumerateDevices API and check the property "kind" returned for each device, it can be either "videoinput", "audioinput" or "audiooutput" (note that you need getUserMedia permissions to get the labels of the devices). Then you could make a getUserMedia request based on the devices present on the machine.


/Chris



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/1d8a52d7-6343-4f42-abf3-2527a429468e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
/Chris

Philipp Hancke

unread,
Aug 5, 2016, 6:59:26 AM8/5/16
to discuss...@googlegroups.com
2016-08-05 12:36 GMT+02:00 Avgustina Pasheeva <a...@leadsecure.com>:
Hi guys,

We started observing a pretty interesting error "DevicesNotFoundError" and I was wondering if anybody has seen something like this, have an idea why it happens and potentially have a fix for that. My assumptions so far are:

1/ It's related to "get user media" and it happens after a person blocks access to camera and microphone from either Chrome or FireFox

No, that would be PermissionDeniedError (chrome proprietary) or NotAllowedError.

2/ It happens if the person has an old school laptop/computer without video - less likely since he/she can still do an audio call 

That is correct. You can call navigator.mediaDevices.enumerateDevices before getUserMedia to figure out if a user has audio/video devices (look at the device kind attribute) and then call getUserMedia with the correct constraints. See https://webrtc.github.io/samples/src/content/devices/input-output/ for an enumerateDevices sample.

Reply all
Reply to author
Forward
0 new messages