Re: How Firefox implements optional constraints

On Fri, Nov 15, 2013 at 5:31 AM, Jan-Ivar Bruaroey <jib@mozilla.com> wrote:
>> From
>
> http://mxr.mozilla.org/mozilla-central/source/dom/media/MediaManager.cpp#750
>
>   // Then apply optional constraints.
>   //
>   // These are only effective when there are multiple sources to pick from.
>   // Spec as-of-this-writing says to run algorithm on "all possible tracks
>   // of media type T that the browser COULD RETURN" (emphasis added).
>   //
>   // We think users ultimately control which devices we could return, so
> after
>   // determining the webpage's preferred list, we add the remaining choices
>   // to the tail, reasoning that they would all have passed individually,
>   // i.e. if the user had any one of them as their sole device (enabled).
>   //
>   // This avoids users having to unplug/disable devices should a webpage
> pick
>   // the wrong one (UX-fail). Webpage-preferred devices will be listed
> first.
>
>
> Clarification: The first device in the returned list becomes the default
> choice, so the webapp gets what it wants, as before, unless the user
> *explicitly* overrides the default with another device that the app has
> disclosed it also works with (a want not a need).
>
> Another way to express this is as a fairness problem in the reductive
> optional algorithm: the fewer devices users disclose, the more choices they
> get. We should remove impediments to users disclosing all their devices to
> the browser.

You seem to be repeating this ability of the user to hide devices from
the browser.
I have not seen that possible in reality, other than doing it on the OS level.

Rather: I have seen devices (including stereo cameras) exposed to the
browser (and accessible to the JS dev via getSources()).
The browser will just expose what it is able to see from the OS -
which in the case of a stereo camera is that it simply is exposed as a
normal camera.

I also disagree with the comment in the Firefox source code from my
experience with Chrome.
The way constraints work there is that you ask for a constraint which
can also refer to just a single camera.
For example, I have a webcam attached and I request a HD stream from
that camera.
That comment tells me that Firefox is going to ignore that request by
me, which is unfortunate.

I think there seems to be a misunderstanding between Firefox devs and
the spec devs/Chrome devs. This needs to be sorted out.

Regards,
Silvia.


> I'd like to propose that this behavior be made explicit in the spec, rather
> than left to be inferred by implementations.
>
> .: Jan-Ivar :.
>
>

Received on Friday, 15 November 2013 01:24:38 UTC