- From: Harald Alvestrand <harald@alvestrand.no>
- Date: Tue, 20 Mar 2012 16:57:34 +0100
- To: Paul Neave <paul.neave@gmail.com>
- CC: Dan Burnett <dburnett@voxeo.com>, public-webrtc@w3.org, public-media-capture@w3.org
Just FWIW, I'm strongly against having 2 ways of doing constraints at the API level. If people want a different API for the same semantics, that's what libraries are for. I have no strong position on dashes versus underscores versus CamelCase. On 03/20/2012 04:47 PM, Paul Neave wrote: > This proposal seems good, except there is one issue. JavaScript cannot use hyphens in object names unless wrapped in quotes. So this example: > > navigator.getUserMedia( { mandatory: [video-min-height: 600, video-max-bandwidth: 500], etc…} ); > > should really be: > > navigator.getUserMedia( { mandatory: ['video-min-height': 600, 'video-max-bandwidth': 500], etc…} ); > > or better still using camel case: > > navigator.getUserMedia( { mandatory: [videoMinHeight: 600, videoMaxBandwidth: 500], etc…} ); > > However, in my opinion, I feel as though the max/min requirements are still too verbose. Specifying the max and min should be an available option, but there should also be a more simpler API such as: > > navigator.getUserMedia( { video: true, videoHeight: 600, videoBandwidth: 500, etc…} ); now, are these constraints mandatory or optional? Minimal or maximal? > With defaults being assumed if not specified. In this case, a typical example would be: > > navigator.getUserMedia( { video: true, audio: true, videoWidth: 800, videoHeight: 600, videoMaxBandwidth: 800, videoMinBandwidth: 400, videoFrameRate: 30 } ); > > Specifying a "min-framerate", for example, seems slightly odd. What if the browser is not capable of keeping up to the specified minimum frame rate? In that case, surely specifying the frame rate you want, videoFrameRate: 30 for example, would suffice and the browser attempts to reach this goal? In this case, you seem to desire to express a wish, not a constraint. video-target-framerate? > In my opinion the API should be as simple as possible, with an elegant way for the browser to assume defaults if not specified. Otherwise each getUserMedia request will be drowned in a specifications list for even the simplest of use cases. Defaults will likely be browser and installation specific. Agree that defaults should give something that makes sense for the common case. You can't get much simpler than navigator.getUserMedia(). > Thanks, > Paul. > > > >
Received on Tuesday, 20 March 2012 15:58:18 UTC