On 5/18/2014 2:45 PM, Justin Uberti wrote:
> I don't mind the require stuff. It's the advanced stuff that I want to
> avoid ever having to touch.
Agree. The advanced (AND)REDUCE-OR-SKIP array logic got quite
complicated in the end.
> On Sun, May 18, 2014 at 11:31 AM, Cullen Jennings (fluffy)
> <fluffy@cisco.com <mailto:fluffy@cisco.com>> wrote:
>
>
> On May 18, 2014, at 1:21 PM, Justin Uberti <juberti@google.com
> <mailto:juberti@google.com>> wrote:
>
> > I think 'ideal' will make this less inscrutable, e.g.
> >
> > videoCfg = {
> > require: ["width"],
> > width: { min: 640, ideal: 1920 },
> > };
> >
> > which to me reads even more cleanly that the mandatory/optional
> syntax.
>
Agree, because "advanced" is no longer needed (and appropriately names).
Yay, no array!
> yah, that is even clearer - but the require things is still
> confusing. What about
>
> videoCfg = [
> { constrain: ”width”, min: 640, ideal: 1920 },
> ];
>
If this means >=640 is mandatory and 1920 optional then you may be on to
something, which is that optional ranges seem only marginally useful.
But I agree with Harald it's a bit late, plus it's not clear what the
algorithm is. It'll be odd to use as well, as the top is an array
(nay!), not a dictionary, so you have to search for values rather than
add/access values as JS obj-props naturally: e.g. var minwidth =
track.getConstraints().width.min; //wont work
-1
.: Jan-Ivar :.