- From: Paul Neave <paul.neave@gmail.com>
- Date: Fri, 11 May 2012 14:47:48 +0100
- To: Anant Narayanan <anant@mozilla.com>, Dan Burnett <dburnett@voxeo.com>, Harald Alvestrand <harald@alvestrand.no>
- Cc: public-media-capture@w3.org
Thank you Anant. I was not aware of the requirement to specify optional parameters in order. > We could certainly make the optimization of grouping each "set" of > constraints in one object instead of making a new object for each > constraint, and I think Dan did have something like this in his original > proposal in the form of a "Constraint Set", IIRC. > > So, my preferred syntax is, as an example: > > navigator.getUserMedia({ > video: { > mandatory: { > videoMinHeight:600, > videoMaxBandwidth:500 > }, > optional: [ > { > videoMaxAspectratio: 1.333333333333, > videoMinTimebetweenrefframes: 20, > videoMinFramerate: 30, > videoEnumAutowhitebalance: "on" > }, > { > videoMinTimebetweenrefframes: 40, > videoMinFramerate: 10 > }, > ] > } > }); > This approach seems much more sensible and is less verbose. Also in my opinion it makes more sense because the array is being used as an array should, not just as a placeholder to enforce order. Dan and Harald, would this be an acceptable structure? Paul.
Received on Friday, 11 May 2012 13:48:28 UTC