| OLD | NEW |
| 1 library html; | 1 library html; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'dart:collection-dev'; | 5 import 'dart:collection-dev'; |
| 6 import 'dart:html_common'; | 6 import 'dart:html_common'; |
| 7 import 'dart:indexed_db'; | 7 import 'dart:indexed_db'; |
| 8 import 'dart:isolate'; | 8 import 'dart:isolate'; |
| 9 import 'dart:json' as json; | 9 import 'dart:json' as json; |
| 10 import 'dart:math'; | 10 import 'dart:math'; |
| (...skipping 14079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14090 @DocsEditable @DomName('MediaSource.endOfStream') | 14090 @DocsEditable @DomName('MediaSource.endOfStream') |
| 14091 void endOfStream(String error) native; | 14091 void endOfStream(String error) native; |
| 14092 | 14092 |
| 14093 @JSName('removeEventListener') | 14093 @JSName('removeEventListener') |
| 14094 @DocsEditable @DomName('MediaSource.removeEventListener') | 14094 @DocsEditable @DomName('MediaSource.removeEventListener') |
| 14095 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 14095 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 14096 | 14096 |
| 14097 @DocsEditable @DomName('MediaSource.removeSourceBuffer') | 14097 @DocsEditable @DomName('MediaSource.removeSourceBuffer') |
| 14098 void removeSourceBuffer(SourceBuffer buffer) native; | 14098 void removeSourceBuffer(SourceBuffer buffer) native; |
| 14099 } | 14099 } |
| 14100 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 14100 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 14101 // for details. All rights reserved. Use of this source code is governed by a | 14101 // for details. All rights reserved. Use of this source code is governed by a |
| 14102 // BSD-style license that can be found in the LICENSE file. | 14102 // BSD-style license that can be found in the LICENSE file. |
| 14103 | 14103 |
| 14104 | 14104 |
| 14105 /// @domName MediaStream; @docsEditable true | 14105 |
| 14106 @DocsEditable | 14106 @DocsEditable |
| 14107 @DomName('MediaStream') | 14107 @DomName('MediaStream') |
| 14108 class MediaStream extends EventTarget native "*MediaStream" { | 14108 class MediaStream extends EventTarget native "*MediaStream" { |
| 14109 | 14109 |
| 14110 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); | 14110 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); |
| 14111 | 14111 |
| 14112 @DocsEditable | 14112 @DocsEditable |
| 14113 factory MediaStream() => MediaStream._create(); | 14113 factory MediaStream() => MediaStream._create(); |
| 14114 static MediaStream _create() => JS('MediaStream', 'new MediaStream()'); | 14114 static MediaStream _create() => JS('MediaStream', 'new MediaStream()'); |
| 14115 | 14115 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14148 List<MediaStreamTrack> getVideoTracks() native; | 14148 List<MediaStreamTrack> getVideoTracks() native; |
| 14149 | 14149 |
| 14150 @JSName('removeEventListener') | 14150 @JSName('removeEventListener') |
| 14151 @DocsEditable @DomName('MediaStream.removeEventListener') | 14151 @DocsEditable @DomName('MediaStream.removeEventListener') |
| 14152 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 14152 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 14153 | 14153 |
| 14154 @DocsEditable @DomName('MediaStream.removeTrack') | 14154 @DocsEditable @DomName('MediaStream.removeTrack') |
| 14155 void removeTrack(MediaStreamTrack track) native; | 14155 void removeTrack(MediaStreamTrack track) native; |
| 14156 | 14156 |
| 14157 Stream<Event> get onEnded => endedEvent.forTarget(this); | 14157 Stream<Event> get onEnded => endedEvent.forTarget(this); |
| 14158 | |
| 14159 | |
| 14160 /** | |
| 14161 * Checks if the MediaStream APIs are supported on the current platform. | |
| 14162 * | |
| 14163 * See also: | |
| 14164 * | |
| 14165 * * [Navigator.getUserMedia] | |
| 14166 */ | |
| 14167 static bool get supported => | |
| 14168 JS('bool', '''!!(#.getUserMedia || #.webkitGetUserMedia || | |
| 14169 #.mozGetUserMedia || #.msGetUserMedia)''', | |
| 14170 window.navigator, | |
| 14171 window.navigator, | |
| 14172 window.navigator, | |
| 14173 window.navigator); | |
| 14174 } | 14158 } |
| 14175 | 14159 |
| 14176 @DocsEditable | 14160 @DocsEditable |
| 14177 class MediaStreamEvents extends Events { | 14161 class MediaStreamEvents extends Events { |
| 14178 @DocsEditable | 14162 @DocsEditable |
| 14179 MediaStreamEvents(EventTarget _ptr) : super(_ptr); | 14163 MediaStreamEvents(EventTarget _ptr) : super(_ptr); |
| 14180 | 14164 |
| 14181 @DocsEditable | 14165 @DocsEditable |
| 14182 EventListenerList get addTrack => this['addtrack']; | 14166 EventListenerList get addTrack => this['addtrack']; |
| 14183 | 14167 |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15048 // BSD-style license that can be found in the LICENSE file. | 15032 // BSD-style license that can be found in the LICENSE file. |
| 15049 | 15033 |
| 15050 | 15034 |
| 15051 @DocsEditable | 15035 @DocsEditable |
| 15052 @DomName('Navigator') | 15036 @DomName('Navigator') |
| 15053 class Navigator native "*Navigator" { | 15037 class Navigator native "*Navigator" { |
| 15054 | 15038 |
| 15055 @DomName('Navigator.language') | 15039 @DomName('Navigator.language') |
| 15056 String get language => JS('String', '#.language || #.userLanguage', this, | 15040 String get language => JS('String', '#.language || #.userLanguage', this, |
| 15057 this); | 15041 this); |
| 15058 | 15042 |
| 15059 /** | |
| 15060 * Gets a stream (video and or audio) from the local computer. | |
| 15061 * | |
| 15062 * Use [MediaStream.supported] to check if this is supported by the current | |
| 15063 * platform. | |
| 15064 * | |
| 15065 * Example use: | |
| 15066 * | |
| 15067 * window.navigator.getUserMedia(audio:true, video: true).then((stream) { | |
| 15068 * var video = new VideoElement() | |
| 15069 * ..autoplay = true | |
| 15070 * ..src = Url.createObjectUrl(stream); | |
| 15071 * document.body.append(video); | |
| 15072 * }); | |
| 15073 * | |
| 15074 * See also: | |
| 15075 * * [MediaStream.supported] | |
| 15076 */ | |
| 15077 @DomName('Navigator.webkitGetUserMedia') | |
| 15078 @SupportedBrowser(SupportedBrowser.CHROME) | |
| 15079 @Experimental() | |
| 15080 Future<LocalMediaStream> getUserMedia({bool audio=false, bool video=false}) { | |
| 15081 var completer = new Completer<LocalMediaStream>(); | |
| 15082 var options = { | |
| 15083 'audio': audio, | |
| 15084 'video': video | |
| 15085 }; | |
| 15086 _ensureGetUserMedia(); | |
| 15087 this._getUserMedia(convertDartToNative_Dictionary(options), | |
| 15088 (stream) { | |
| 15089 completer.complete(stream); | |
| 15090 }, | |
| 15091 (error) { | |
| 15092 completer.completeError(error); | |
| 15093 }); | |
| 15094 return completer.future; | |
| 15095 } | |
| 15096 | |
| 15097 _ensureGetUserMedia() { | |
| 15098 if (JS('bool', '!(#.getUserMedia)', this)) { | |
| 15099 JS('void', '#.getUserMedia = ' | |
| 15100 '(#.getUserMedia || #.webkitGetUserMedia || #.mozGetUserMedia ||' | |
| 15101 '#.msGetUserMedia)', this, this, this, this, this); | |
| 15102 } | |
| 15103 } | |
| 15104 | |
| 15105 @JSName('getUserMedia') | |
| 15106 void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success, | |
| 15107 _NavigatorUserMediaErrorCallback error) native; | |
| 15108 | |
| 15109 | |
| 15110 @DocsEditable @DomName('Navigator.appCodeName') | 15043 @DocsEditable @DomName('Navigator.appCodeName') |
| 15111 final String appCodeName; | 15044 final String appCodeName; |
| 15112 | 15045 |
| 15113 @DocsEditable @DomName('Navigator.appName') | 15046 @DocsEditable @DomName('Navigator.appName') |
| 15114 final String appName; | 15047 final String appName; |
| 15115 | 15048 |
| 15116 @DocsEditable @DomName('Navigator.appVersion') | 15049 @DocsEditable @DomName('Navigator.appVersion') |
| 15117 final String appVersion; | 15050 final String appVersion; |
| 15118 | 15051 |
| 15119 @DocsEditable @DomName('Navigator.cookieEnabled') | 15052 @DocsEditable @DomName('Navigator.cookieEnabled') |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15155 @DocsEditable @DomName('Navigator.getStorageUpdates') | 15088 @DocsEditable @DomName('Navigator.getStorageUpdates') |
| 15156 void getStorageUpdates() native; | 15089 void getStorageUpdates() native; |
| 15157 | 15090 |
| 15158 @DocsEditable @DomName('Navigator.javaEnabled') | 15091 @DocsEditable @DomName('Navigator.javaEnabled') |
| 15159 bool javaEnabled() native; | 15092 bool javaEnabled() native; |
| 15160 | 15093 |
| 15161 @DocsEditable @DomName('Navigator.webkitGetGamepads') | 15094 @DocsEditable @DomName('Navigator.webkitGetGamepads') |
| 15162 @Returns('_GamepadList') @Creates('_GamepadList') | 15095 @Returns('_GamepadList') @Creates('_GamepadList') |
| 15163 List<Gamepad> webkitGetGamepads() native; | 15096 List<Gamepad> webkitGetGamepads() native; |
| 15164 | 15097 |
| 15098 void webkitGetUserMedia(Map options, NavigatorUserMediaSuccessCallback success
Callback, [NavigatorUserMediaErrorCallback errorCallback]) { |
| 15099 if (?errorCallback) { |
| 15100 var options_1 = convertDartToNative_Dictionary(options); |
| 15101 _webkitGetUserMedia_1(options_1, successCallback, errorCallback); |
| 15102 return; |
| 15103 } |
| 15104 var options_2 = convertDartToNative_Dictionary(options); |
| 15105 _webkitGetUserMedia_2(options_2, successCallback); |
| 15106 return; |
| 15107 } |
| 15108 @JSName('webkitGetUserMedia') |
| 15109 @DocsEditable @DomName('Navigator.webkitGetUserMedia') |
| 15110 void _webkitGetUserMedia_1(options, NavigatorUserMediaSuccessCallback successC
allback, NavigatorUserMediaErrorCallback errorCallback) native; |
| 15111 @JSName('webkitGetUserMedia') |
| 15112 @DocsEditable @DomName('Navigator.webkitGetUserMedia') |
| 15113 void _webkitGetUserMedia_2(options, NavigatorUserMediaSuccessCallback successC
allback) native; |
| 15114 |
| 15165 } | 15115 } |
| 15166 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 15116 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 15167 // for details. All rights reserved. Use of this source code is governed by a | 15117 // for details. All rights reserved. Use of this source code is governed by a |
| 15168 // BSD-style license that can be found in the LICENSE file. | 15118 // BSD-style license that can be found in the LICENSE file. |
| 15169 | 15119 |
| 15170 | 15120 |
| 15171 | 15121 |
| 15172 @DocsEditable | 15122 @DocsEditable |
| 15173 @DomName('NavigatorUserMediaError') | 15123 @DomName('NavigatorUserMediaError') |
| 15174 class NavigatorUserMediaError native "*NavigatorUserMediaError" { | 15124 class NavigatorUserMediaError native "*NavigatorUserMediaError" { |
| 15175 | 15125 |
| 15176 static const int PERMISSION_DENIED = 1; | 15126 static const int PERMISSION_DENIED = 1; |
| 15177 | 15127 |
| 15178 @DocsEditable @DomName('NavigatorUserMediaError.code') | 15128 @DocsEditable @DomName('NavigatorUserMediaError.code') |
| 15179 final int code; | 15129 final int code; |
| 15180 } | 15130 } |
| 15181 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 15131 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 15182 // for details. All rights reserved. Use of this source code is governed by a | 15132 // for details. All rights reserved. Use of this source code is governed by a |
| 15183 // BSD-style license that can be found in the LICENSE file. | 15133 // BSD-style license that can be found in the LICENSE file. |
| 15184 | 15134 |
| 15185 // WARNING: Do not edit - generated code. | 15135 // WARNING: Do not edit - generated code. |
| 15186 | 15136 |
| 15187 | 15137 |
| 15188 typedef void _NavigatorUserMediaErrorCallback(NavigatorUserMediaError error); | 15138 typedef void NavigatorUserMediaErrorCallback(NavigatorUserMediaError error); |
| 15189 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 15139 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 15190 // for details. All rights reserved. Use of this source code is governed by a | 15140 // for details. All rights reserved. Use of this source code is governed by a |
| 15191 // BSD-style license that can be found in the LICENSE file. | 15141 // BSD-style license that can be found in the LICENSE file. |
| 15192 | 15142 |
| 15193 // WARNING: Do not edit - generated code. | 15143 // WARNING: Do not edit - generated code. |
| 15194 | 15144 |
| 15195 | 15145 |
| 15196 typedef void _NavigatorUserMediaSuccessCallback(LocalMediaStream stream); | 15146 typedef void NavigatorUserMediaSuccessCallback(LocalMediaStream stream); |
| 15197 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 15147 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 15198 // for details. All rights reserved. Use of this source code is governed by a | 15148 // for details. All rights reserved. Use of this source code is governed by a |
| 15199 // BSD-style license that can be found in the LICENSE file. | 15149 // BSD-style license that can be found in the LICENSE file. |
| 15200 | 15150 |
| 15201 | 15151 |
| 15202 /** | 15152 /** |
| 15203 * Lazy implementation of the child nodes of an element that does not request | 15153 * Lazy implementation of the child nodes of an element that does not request |
| 15204 * the actual child nodes of an element until strictly necessary greatly | 15154 * the actual child nodes of an element until strictly necessary greatly |
| 15205 * improving performance for the typical cases where it is not required. | 15155 * improving performance for the typical cases where it is not required. |
| 15206 */ | 15156 */ |
| (...skipping 14192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 29399 _position = nextPosition; | 29349 _position = nextPosition; |
| 29400 return true; | 29350 return true; |
| 29401 } | 29351 } |
| 29402 _current = null; | 29352 _current = null; |
| 29403 _position = _array.length; | 29353 _position = _array.length; |
| 29404 return false; | 29354 return false; |
| 29405 } | 29355 } |
| 29406 | 29356 |
| 29407 T get current => _current; | 29357 T get current => _current; |
| 29408 } | 29358 } |
| OLD | NEW |