Chromium Code Reviews| Index: tools/dom/templates/html/impl/impl_Navigator.darttemplate |
| diff --git a/tools/dom/templates/html/impl/impl_Navigator.darttemplate b/tools/dom/templates/html/impl/impl_Navigator.darttemplate |
| index 9d8d8c4ceaee68476366db2ea8325ef039e9aad2..5f934a80120523a654ab08332f049123b23ff2fc 100644 |
| --- a/tools/dom/templates/html/impl/impl_Navigator.darttemplate |
| +++ b/tools/dom/templates/html/impl/impl_Navigator.darttemplate |
| @@ -16,11 +16,22 @@ $endif |
| * Gets a stream (video and or audio) from the local computer. |
| * |
| * Use [MediaStream.supported] to check if this is supported by the current |
| - * platform. |
| + * platform. The arguments `audio` and `video` default to `false` (no |
| + * constraints), but will accept Maps in each parameter to specify mandatory |
| + * and optional constraints for the media stream. Not passing in a map, but |
| + * passing in `true` will provide a LocalMediaStream with audio or video |
| + * capabilities, but without any additional constraints. |
| * |
| * Example use: |
| * |
| - * window.navigator.getUserMedia(audio:true, video: true).then((stream) { |
| + * window.navigator.getUserMedia( |
| + * audio: true, |
| + * video: {'mandatory': |
|
blois
2013/03/19 20:35:23
It would be nice to move the details into a separa
|
| + * { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 }, |
| + * 'optional': |
| + * [{ 'minFrameRate': 60 }, |
| + * { 'maxWidth': 640 }] |
| + * }).then((stream) { |
| * var video = new VideoElement() |
| * ..autoplay = true |
| * ..src = Url.createObjectUrl(stream); |
| @@ -33,8 +44,8 @@ $endif |
| @DomName('Navigator.webkitGetUserMedia') |
| @SupportedBrowser(SupportedBrowser.CHROME) |
| @Experimental |
| - Future<LocalMediaStream> getUserMedia({bool audio: false, |
| - bool video: false}) { |
| + Future<LocalMediaStream> getUserMedia({audio: false, |
| + video: false}) { |
| var completer = new Completer<LocalMediaStream>(); |
| var options = { |
| 'audio': audio, |
| @@ -42,7 +53,7 @@ $endif |
| }; |
| $if DART2JS |
| _ensureGetUserMedia(); |
| - this._getUserMedia(convertDartToNative_Dictionary(options), |
| + this._getUserMedia(convertDartToNative_SerializedScriptValue(options), |
| (stream) { |
| completer.complete(stream); |
| }, |