W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2014

Re: Return value of getSupportedConstraints (Re: [Bug 26654] WebIDL types needed in Constrainable application)

From: Harald Alvestrand <harald@alvestrand.no>
Date: Fri, 10 Oct 2014 20:39:25 +0200
Message-ID: <543827DD.2070100@alvestrand.no>
To: public-media-capture@w3.org
On 10/10/2014 07:38 PM, Jan-Ivar Bruaroey wrote:
> On 10/10/14, 1:05 PM, Harald Alvestrand wrote:
>> Returning a truthy value requires changing the returned value according
>> to what the type of the constraint is. That's the odd part.
>
> All types are ConstrainXxx something so returning this should do:
>
>   { width: {}, height: {}, aspectRatio: {}, frameRate: {}, facingMode:
> {} };
>
> This is a constant anyway.
>
> .: Jan-Ivar :.
>
>
It does seem that {} (empty list) is truthy in Javascript. Saying that
{} and only {} MUST be used would be not-too-distasteful to me.

In Python {} is falsy.


-- 
Surveillance is pervasive. Go Dark.
Received on Friday, 10 October 2014 18:40:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:24:50 UTC