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

MediaStreamOptions should be a dictionary

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Wed, 30 Nov 2011 18:54:19 +0000
To: "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <9768D477C67135458BF978A45BCF9B38381BE9A8@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com>
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#mediastreamoptions
[2] http://dev.w3.org/2006/webapi/WebIDL/#idl-dictionaries
Received on Wednesday, 30 November 2011 18:55:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:08 UTC