Re: Why ignoring unknown mandatory constraints is not stupid

On 11/19/13 1:04 PM, Stefan Håkansson LK wrote:
> Yes, I agree, and we should introduce getSupportedConstraints() IMO.

Great!

>> As Adam pointed out, we should not assume that every constraint will
>> be useless without browser support. "zoomOnFaces" would presumably
>> not require browser support.
> But if we want the app to be able to control (turn "zoomOnFaces" on or
> off), surely it would need browser support?

Yes. getUserMedia() doesn't guarantee you can control the camera though, so this is a little out of scope. What source states you may alter is something you learn later when you call getCapabilities(). getCapabilities() will not return "zoomOnFaces" unless the browser supports it, so your code knows at that point.

For clarification on this, unless I misunderstand,

  { mandatory: { width: { max: 1600, min: 1024}, height: { max: 1200, min, 768 } }

doesn't ensure me a camera which output is alterable from 1024x768 to 1600x1200. I may get a fixed resolution 1280x1024 camera. So I must check if (typeof(streams.getVideoTracks()[0].getCapabilities()[width]) ==|"object")|  to know whether it is truly alterable. Someone correct me if I'm wrong here.

So back to our case, I think streams.getVideoTracks()[0].getCapabilities().hasOwnProperty("zoomOnFaces") == true would signify a modifiable property? Or does a boolean also signify an inherent property? I'm confused. Jim or Dan, can you clarify?

In any case, in the unknown case, it would be false, so your code would be able to detect the problem at this point.

My example assumed a camera that zoomed automatically, e.g. an inherent property that would be the same all the time, like facingMode, or (fixed) width and height. Capabilities with only one inherent value. zoomOnFaces may be a bad example, I'm merely presuming our current list of inherent properties is not exhaustive.

.: Jan-Ivar :.

Received on Wednesday, 20 November 2013 00:54:49 UTC