W3C home > Mailing lists > Public > public-webrtc@w3.org > November 2013

Re: constraints vs attributes

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 13 Nov 2013 18:10:57 -0500
Message-ID: <52840701.4090208@mozilla.com>
To: Jim Barnett <Jim.Barnett@genesyslab.com>, Justin Uberti <juberti@google.com>
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>
On 11/13/13 4:45 PM, Jim Barnett wrote:
> Looking through the constraints defined in section 16.1 of the webRTC 
> spec, I do see a mention of a mandatory vs optional distinction, which 
> would indicate that at least some of the uses do seem to have the 
> semantics of Constraints (as defined in the Constrainable interface).

Yes, but it fits only if you squint. :-)

The original definition of mandatory in gUM (the closest one I could 
find) was effectively about creating recipes for picking cameras based 
on *known* constraints (the question of how to deal with future/unknown 
constraints came later).

This definition of mandatory makes no sense with PeerConnection args 
like { OfferToReceiveVideo: true} , because this is just a setting on 
the PeerConnection, not a device-picking recipe.

Someone must have thought that mandatory/optional could be re/mis/used 
here to detect whether a browser supported this setting or not (a 
practice I've now come to regard as a footgun - see 
http://lists.w3.org/Archives/Public/public-media-capture/2013Nov/0059.html 
), but even if you use this one feature of constraints, it doesn't mean 
the pattern will fit as a whole (another clue is that optional does not 
need to be an array in this case). - This is a an example of where a 
dictionary might have sufficed.

.: Jan-Ivar :.
Received on Wednesday, 13 November 2013 23:11:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:36 UTC