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 :.