W3C home > Mailing lists > Public > public-media-capture@w3.org > December 2011

Re: MediaStreamOptions should be a dictionary

From: Harald Alvestrand <harald@alvestrand.no>
Date: Thu, 01 Dec 2011 11:58:59 +0100
Message-ID: <4ED75DF3.7040201@alvestrand.no>
To: Travis Leithead <travis.leithead@microsoft.com>
CC: Brian LeRoux <b@brian.io>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 11/30/2011 08:02 PM, Travis Leithead wrote:
> See my other reply on the other thread [3]. I believe multi-device scenarios should be configured _after_ the user has granted general permission for audio or video or both.
>
> However, if this is necessary, the dictionary can be extended to include additional data for different device hints as well. I believe an earlier draft of WebRTC had hints for "user" and "environment" video cameras, which could easily be added into the dictionary if needed.
I believe the WEBRTC meeting in Santa Clara tended to believe that this 
parameter needed to be a set of attributes, and extensible.

Will a dictionary accomplish this cleanly?
(not being familiar with the properties of the WebIDL "dictionary" type, 
or which JS construct it translates to)

> [3] http://lists.w3.org/Archives/Public/public-media-capture/2011Nov/0010.html
>
>
>> -----Original Message-----
>> From: brian.leroux@gmail.com [mailto:brian.leroux@gmail.com] On Behalf Of
>> Brian LeRoux
>> Sent: Wednesday, November 30, 2011 10:58 AM
>> To: Travis Leithead
>> Cc: public-media-capture@w3.org
>> Subject: Re: MediaStreamOptions should be a dictionary
>>
>> what if there is more than one camera on the device?
>>
>>
>> On Wed, Nov 30, 2011 at 10:54 AM, Travis Leithead
>> <travis.leithead@microsoft.com>  wrote:
>>> In the spec [1], and given the example 2.2:
>>>
>>>> 2.2 Examples
>>>>
>>>> <script>
>>>> navigator.getUserMedia({"audio": true, "video": false}, gotAudio);
>>>> function gotAudio(stream) {
>>>>    // ... use 'stream' ...
>>>> }
>>>> </script>
>>> The first parameter to getUserMedia should be defined as a WebIDL
>> dictionary [2]. I'd recommend changing the definition as follows:
>>> From--
>>> [NoInterfaceObject]
>>> interface MediaStreamOptions {
>>>     attribute boolean audio;
>>>     attribute boolean video;
>>> };
>>>
>>> To--
>>> dictionary MediaStreamOptions {
>>>     boolean audio;
>>>     boolean video;
>>> }
>>>
>>>
>>> I believe this change merely aligns the syntax with the expected usage
>> behavior as shown in the example.
>>> -Travis
>>>
>>> [1]
>>> http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamopti
>>> ons [2] http://dev.w3.org/2006/webapi/WebIDL/#idl-dictionaries
>>>
>>>
>
>
>
Received on Thursday, 1 December 2011 10:59:39 GMT

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