W3C home > Mailing lists > Public > public-media-capture@w3.org > May 2012

Re: Syntax options for constraints structure

From: Anant Narayanan <anant@mozilla.com>
Date: Fri, 11 May 2012 10:11:04 -0700
Message-ID: <4FAD4828.40704@mozilla.com>
To: public-media-capture@w3.org
On 5/10/12 12:17 PM, Anant Narayanan wrote:
> 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
>        },
>      ]
>    }
> });

Correction, the intent of this syntax was also to drop the "video" 
prefix on each constraint since the top-level element is video:

navigator.getUserMedia({
    video: {
      mandatory: {
        minHeight:600,
        maxBandwidth:500
      },
      optional: [
        {
          maxAspectratio: 1.333333333333,
          minTimebetweenrefframes: 20,
          minFramerate: 30,
          enumAutowhitebalance: "on"
        },
        {
          minTimebetweenrefframes: 40,
          minFramerate: 10
        },
     ]
   }
});

-Anant
Received on Friday, 11 May 2012 17:11:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:14:59 GMT