Re: Bug 23935 - Proposal: New syntax for constraints

On 13/12/2013 7:46 PM, Martin Thomson wrote:
> On 13 December 2013 15:25, cowwoc <cowwoc@bbs.darktech.org> wrote:
>> var properties = { width: resolution.width, height: resolution.height,
>> frameRate: 20 }; // specific values that the device must support (ranges are
>> not accepted)
>> getUserMedia(properties, onSuccess, onFailure);
> That doesn't play well with others.  How do you propose to handle the
> case where multiple sites (or even scripts in the same page) want to
> access the device at the same time?
Hi Martin,

In the first line of code (var modes = camera.getModes()) the device 
would return the only mode that is available (meaning, the one that the 
camera is already opened with). If you then add device.isOpen() to check 
for this condition, applications can display a more user-friendly error 
message when this occurs:

"This application requires resolution X but you've already opened the 
camera with resolution Y in another application"

Gili

Received on Saturday, 14 December 2013 15:45:08 UTC