W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2013

Re: gUM constraints webidl implementer feedback

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Sun, 20 Oct 2013 02:22:46 -0400
Message-ID: <526376B6.6080801@mozilla.com>
To: Harald Alvestrand <harald@alvestrand.no>, Travis Leithead <travis.leithead@microsoft.com>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 10/19/13 12:32 AM, Harald Alvestrand wrote:
> The behaviour I want is:
>
> getUserMedia(.... mandatory(knownKey='foo', unknownKey='bar') ...)
>
> should call the error callback ("constraints can't be satisfied"), 
> with "unknownKey='bar'" as the constraint that couldn't be satisfied.
>
> getUserMedia(.... optional((knownKey='foo'), (unknownKey='bar')) ...)
>
> should silently succeed.

Me too, though I'd prefer throwing "constraints aren't supported" and 
leave the error callback for when sources don't satisfy.

> If that means dictionaries aren't the right object, we'll have to use 
> something else.

I can't think of a better fit. Perhaps we could ask the webidl group for 
an " ExtendedAttributeMandatory" on dictionaries that throws on unknown 
keys instead of ignoring them?

A webidl type that lets everything through already exists: 'object' - 
FWIW I think the workaround we have now of using object in the external 
API works. We just copy it to the dictionary internally once we've 
checked for unknowns, so we still benefit from the definitions. Also 
this is just for mandatory constraints, optional ones work fine.

We could ask for an "ExtendedAttributeTreatAsObject" which at least is 
more readable than non-descript object. e.g.:

     dictionary MediaTrackConstraints {
         [TreatAsObject] // so we can see unknown + unsupported constraints
         MediaTrackConstraintSet mandatory;
         sequence<MediaTrackConstraint> _optional;
     };

.: Jan-Ivar :.
Received on Sunday, 20 October 2013 06:23:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:20 UTC