W3C home > Mailing lists > Public > public-media-capture-logs@w3.org > September 2016

Re: [mediacapture-main] Should we use [EnforceRange] on min/max in constraints?

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Thu, 15 Sep 2016 19:59:50 +0000
To: public-media-capture-logs@w3.org
Message-ID: <issue_comment.created-247436496-1473969588-sysbot+gh@w3.org>
Given that `min` and `max` define boundaries, and `ideal` has gravity,
 it might be worth considering `[Clamp]` for `long` values, since 
`-Infinity` and `Infinity` would then produce −2147483648 and 
2147483647 respectively, which in the constraints algorithm seem 
indistinguishably large enough for most imaginable measures of 

This would let users use `Infinity` and `-Infinity` in JS as 
shorthands for "unconstrained":

    let max = Infinity, min = -Infinity;
    for (c of otherConcerns) {
      if (max > c.max) max = c.max;
      if (min < c.min) min = c.min;
    getUserMedia({video: {min, max}).then(useStream)

Also, `{ width: Infinity, height: Infinity}` would give users the 
highest available resolution for quite a while.

`unrestricted double` would do the same for `frameRate`.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at 
 using your GitHub account
Received on Thursday, 15 September 2016 19:59:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:27:30 UTC