Index: sdk/lib/html/dart2js/html_dart2js.dart |
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart |
index 3bb3ec27a797671c48c9f6109aa6f4a086238033..88c8363c053a1efd31def6c4b67a7394267333fa 100644 |
--- a/sdk/lib/html/dart2js/html_dart2js.dart |
+++ b/sdk/lib/html/dart2js/html_dart2js.dart |
@@ -17286,7 +17286,13 @@ class RtcDtmfToneChangeEvent extends Event native "RTCDTMFToneChangeEvent" { |
@Experimental |
class RtcIceCandidate native "RTCIceCandidate" { |
factory RtcIceCandidate(Map dictionary) { |
- return JS('RtcIceCandidate', 'new RTCIceCandidate(#)', |
+ // TODO(efortuna): Remove this check if when you can actually construct with |
+ // the unprefixed RTCIceCandidate in Firefox (currently both are defined, |
+ // but one can't be used as a constructor). |
+ var constructorName = JS('RtcIceCandidate', 'window[#]', |
sra1
2013/05/24 22:53:43
The JavaScript constructor function is not an inst
Emily Fortuna
2013/05/24 23:47:25
Done.
|
+ Device.isFirefox ? '${Device.propertyPrefix}RTCIceCandidate' : |
+ 'RTCIceCandidate'); |
+ return JS('RtcIceCandidate', 'new #(#)', constructorName, |
convertDartToNative_SerializedScriptValue(dictionary)); |
} |
@@ -17346,9 +17352,12 @@ class RtcPeerConnection extends EventTarget native "RTCPeerConnection" { |
// Currently in Firefox some of the RTC elements are defined but throw an |
// error unless the user has specifically enabled them in their |
// about:config. So we have to construct an element to actually test if RTC |
- // is supported at at the given time. |
+ // is supported at at the given time. Additionally, Firefox only supports IP |
sra1
2013/05/24 22:53:43
s/at at/at/
Emily Fortuna
2013/05/24 23:47:25
Done.
|
+ // numbers (currently), so we test with a random IP address. |
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=837919 for details. |
try { |
- var c = new RtcPeerConnection({"iceServers": [ {"url":"stun:foo.com"}]}); |
+ var c = new RtcPeerConnection( |
+ {"iceServers": [ {"url":"stun:216.93.246.18"}]}); |
sra1
2013/05/24 22:53:43
So can this fail when the feature is supported?
Wh
Emily Fortuna
2013/05/24 23:47:25
That error message seems extra sketchy. It appears
|
return c is RtcPeerConnection; |
sra1
2013/05/24 22:53:43
How would this be false?
The JS call says is is Rt
Emily Fortuna
2013/05/24 23:47:25
Good point. Just now checking if constructing the
|
} catch (_) {} |
return false; |
@@ -17633,8 +17642,6 @@ class RtcPeerConnection extends EventTarget native "RTCPeerConnection" { |
Stream<Event> get onSignalingStateChange => signalingStateChangeEvent.forTarget(this); |
} |
- |
- |
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
@@ -17645,7 +17652,14 @@ class RtcPeerConnection extends EventTarget native "RTCPeerConnection" { |
@Experimental |
class RtcSessionDescription native "RTCSessionDescription" { |
factory RtcSessionDescription(Map dictionary) { |
- return JS('RtcSessionDescription', 'new RTCSessionDescription(#)', |
+ // TODO(efortuna): Remove this check if when you can actually construct with |
+ // the unprefixed RTCIceCandidate in Firefox (currently both are defined, |
+ // but one can't be used as a constructor). |
sra1
2013/05/24 22:53:43
I'm not sure what 'this check' refers to.
Looks li
Emily Fortuna
2013/05/24 23:47:25
Done.
|
+ var constructorName = JS('RtcSessionDescription', 'window[#]', |
sra1
2013/05/24 22:53:43
JS('', ....)
Emily Fortuna
2013/05/24 23:47:25
Done.
|
+ '${Device.propertyPrefix}RTCSessionDescription' : |
+ 'RTCSessionDescription'); |
+ return JS('RtcSessionDescription', |
+ 'new (RTCSessionDescription || mozRTCSessionDescription)(#)', |
convertDartToNative_SerializedScriptValue(dictionary)); |
} |