Re: Syntax options for constraints structure

On 5/11/12 10:20 AM, Bruce Lawson wrote:
> Is there anywhere that documents the purpose of this plethora of extra
> arguments? I very much enjoyed the simplicity of the gUM API and am
> unsure about what all this extra complexity is for.

We've discussed capabilities and constraints on this list, looking in 
the archives might leads to the threads were we've been debating over 
the need for an API like this.

At the top-most level, both the Media Capture TF and the WebRTC WG have 
decided to adopt the IETF use case document. In particular, in the 
browser and API requirements section of that document:

https://tools.ietf.org/html/draft-ietf-rtcweb-use-cases-and-requirements-07

has been the primary driver for a constraints-like API.

The simple API is still available (and the primary way for web pages to 
use gUM), the video and audio top-level arguments can be booleans or 
dictionaries:

navigator.getUserMedia({video:true,audio:true}, ...);

is still perfectly valid according to the spec (and personally, I think 
this is the form that will be more widely used).

This advanced constraints API is only available to "privileged" 
applications, the definition of which is currently left open to 
interpretation by the UA. In Firefox, we will not expose the constraints 
and capabilities API to just any web page, but only to "web apps" that 
the user has indicated a great level of trust in, or has been previously 
vetted by an app marketplace.

Just as one example, such as API is required to build sophisticated 
video conferencing apps that are at feature-parity with native apps like 
Skype.

Regards,
-Anant

Received on Friday, 11 May 2012 17:38:01 UTC