New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 702124 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

enumerateDevices return before user grants permissions, so there are no labels

Project Member Reported by martina....@intel.com, Mar 16 2017

Issue description

I might be misinterpreting how enumerateDevices is supposed to work, but in that case I don't know how to work around this.

I'm using `navigator.mediaDevices.enumerateDevices()` to detect the camera name. However, the first time the user opens the page, it asks him for permission to use the camera and enumerateDevices returns *before* he clicks "allow". The camera IDs are there, but the labels are empty.

Is there any event I could subscribe to that would run enumerateDevices once the permission has been granted and labels are available?

I think this function is fairly useless if it doesn't block until the permissions are granted. There could be at least some option for it.

I tried this on both Chromium 56.0.2924.76 and the latest build from git. I'm using Debian testing. A colleague said he's not having these issues on Windows, but I haven't verified it yet.
 

Comment 1 by guidou@chromium.org, Mar 16 2017

Status: WontFix (was: Untriaged)
This is not a bug.
enumerateDevices does not ask for permission, and that is what the spec mandates.
If you want labels in enumerateDevices, you need to request permission first.

Currently the only way to get permission is to call getUserMedia().
In the future it will be possible to request permissions for media devices by using the Permissions API.

Sign in to add a comment