Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tools/dom/templates/html/impl/impl_Navigator.darttemplate

Issue 14636013: Revert "Changes for webkit roll 148757-149482" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/templates/html/dartium/cpp_header.template ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 8
9 $if DART2JS 9 $if DART2JS
10 @DomName('Navigator.language') 10 @DomName('Navigator.language')
(...skipping 12 matching lines...) Expand all
23 * 23 *
24 * window.navigator.getUserMedia(audio: true, video: true).then((stream) { 24 * window.navigator.getUserMedia(audio: true, video: true).then((stream) {
25 * var video = new VideoElement() 25 * var video = new VideoElement()
26 * ..autoplay = true 26 * ..autoplay = true
27 * ..src = Url.createObjectUrl(stream); 27 * ..src = Url.createObjectUrl(stream);
28 * document.body.append(video); 28 * document.body.append(video);
29 * }); 29 * });
30 * 30 *
31 * The user can also pass in Maps to the audio or video parameters to specify 31 * The user can also pass in Maps to the audio or video parameters to specify
32 * mandatory and optional constraints for the media stream. Not passing in a 32 * mandatory and optional constraints for the media stream. Not passing in a
33 * map, but passing in `true` will provide a MediaStream with audio or 33 * map, but passing in `true` will provide a LocalMediaStream with audio or
34 * video capabilities, but without any additional constraints. The particular 34 * video capabilities, but without any additional constraints. The particular
35 * constraint names for audio and video are still in flux, but as of this 35 * constraint names for audio and video are still in flux, but as of this
36 * writing, here is an example providing more constraints. 36 * writing, here is an example providing more constraints.
37 * 37 *
38 * window.navigator.getUserMedia( 38 * window.navigator.getUserMedia(
39 * audio: true, 39 * audio: true,
40 * video: {'mandatory': 40 * video: {'mandatory':
41 * { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 }, 41 * { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 },
42 * 'optional': 42 * 'optional':
43 * [{ 'minFrameRate': 60 }, 43 * [{ 'minFrameRate': 60 },
44 * { 'maxWidth': 640 }] 44 * { 'maxWidth': 640 }]
45 * }); 45 * });
46 * 46 *
47 * See also: 47 * See also:
48 * * [MediaStream.supported] 48 * * [MediaStream.supported]
49 */ 49 */
50 @DomName('Navigator.webkitGetUserMedia') 50 @DomName('Navigator.webkitGetUserMedia')
51 @SupportedBrowser(SupportedBrowser.CHROME) 51 @SupportedBrowser(SupportedBrowser.CHROME)
52 @Experimental 52 @Experimental
53 Future<MediaStream> getUserMedia({audio: false, video: false}) { 53 Future<LocalMediaStream> getUserMedia({audio: false, video: false}) {
54 var completer = new Completer<MediaStream>(); 54 var completer = new Completer<LocalMediaStream>();
55 var options = { 55 var options = {
56 'audio': audio, 56 'audio': audio,
57 'video': video 57 'video': video
58 }; 58 };
59 $if DART2JS 59 $if DART2JS
60 _ensureGetUserMedia(); 60 _ensureGetUserMedia();
61 this._getUserMedia(convertDartToNative_SerializedScriptValue(options), 61 this._getUserMedia(convertDartToNative_SerializedScriptValue(options),
62 (stream) { 62 (stream) {
63 completer.complete(stream); 63 completer.complete(stream);
64 }, 64 },
(...skipping 21 matching lines...) Expand all
86 } 86 }
87 } 87 }
88 88
89 @JSName('getUserMedia') 89 @JSName('getUserMedia')
90 void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success, 90 void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success,
91 _NavigatorUserMediaErrorCallback error) native; 91 _NavigatorUserMediaErrorCallback error) native;
92 $endif 92 $endif
93 93
94 $!MEMBERS 94 $!MEMBERS
95 } 95 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/dartium/cpp_header.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698