New issue
Advanced search Search tips

Issue 867888 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

trying to set a facingMode with property exact leads to overConstrainedError

Reported by arjen.de...@jungleminds.nl, Jul 26

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36

Steps to reproduce the problem:
1. Run the code on a https enabled page

What is the expected behavior?
The browser should prompt for permission to use the camera

What went wrong?
it catches with an OverConstrainedError

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 68.0.3440.75  Channel: stable
OS Version: OS X 10.13.5
Flash Version:
 
example.js
762 bytes View Download
Labels: Needs-Triage-M68
Labels: Triaged-ET Target-70 M-70 FoundIn-70 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Mac 10.13.3, Win-10 and Ubuntu 17.10 using chrome reported version #68.0.3440.75 and latest canary #70.0.3503.0.
This is a non-regression issue as it is observed from M60 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
867888@M60.png
524 KB View Download
Labels: -Pri-2 Pri-3
Owner: guidou@chromium.org
Status: Assigned (was: Untriaged)
This is working as intended, since there is no concept of front or back cameras in OS X, Windows or Linux.
I'll keep the bug open to since built-in cameras on laptops could be considered front cameras, so perhaps we could implement that.
Tnx for taking the time to look into this. I was already wondering how it was reliably determined that a camera was either user/environment facing. I agree that it makes sense to error, although I preferred the 'ConstraintNotSatisfiedError' to 'OverconstraintError'.

'OverconstraintError' gives me the idea I wrongly constraint something in my code. 'ConstraintNotSatisfiedError' tells me that I used the constraint correctly but nothing showed up.

For what it's worth, behaviour on other browsers I was able to check:

- Firefox (61.0.1) asks to access my camera when I use facingMode: {exact: 'user'}
- Firefox (61.0.1) also throws with 'OverconstrainedError' when I use facingMode: {exact: 'environment'}.
- Safari (11.1.1) seems to ignore the exact parameter since it always asks me for permission to use my camera, no matter the facingMode value.
Cc: hta@chromium.org
ConstraintNotSatisfiedError was nonstandard and thus got replaced by OverconstrainedError, which is how the spec states that this kind of error should be reported.

The current approach in Chrome is that if the underlying OS does not provide any information about where the camera is facing, we reject all exact facingModes. However, since Firefox and Edge are supporting 'user' at least in some cases, perhaps we could support it too for built-in cameras, which in practice are usually facing the user.
Keeping this bug open to allow for some discussion.
A constraint of "exact" is supposed to mean "If the system can't guarantee this property, I don't want a camera at all". If you want "user if you know what that is, otherwise, just give me a camera", specifying it as an ideal constraint will work just fine (I think).

So I'd claim that Firefox 61 is buggy on this point, but if it has knowledge about its hardware, it may just be more advanced in its detection capabilities. Does it give the same result if you try to select an external USB camera?

Safari may not have the constraint in its list of supported constraints. If it has it, that's a bug.

So yes, "overconstrainedError" is accurate, and per spec. Sorry about the rename.

If we get hardware platforms sorted out, and can tell which way the built-in camera is facing, we may get to support this on some laptops and some OSes eventually.

Labels: -Target-70 -M-70 Target-71 M-71

Sign in to add a comment