1- /*! adapterjs - v0.13.2 - 2016-03-18 */
1+ /*! adapterjs - v0.13.3 - 2016-04-13 */
22
33// Adapter's interface.
44var AdapterJS = AdapterJS || { } ;
@@ -17,7 +17,7 @@ AdapterJS.options = AdapterJS.options || {};
1717// AdapterJS.options.hidePluginInstallPrompt = true;
1818
1919// AdapterJS version
20- AdapterJS . VERSION = '0.13.2 ' ;
20+ AdapterJS . VERSION = '0.13.3 ' ;
2121
2222// This function will be called when the WebRTC API is ready to be used
2323// Whether it is the native implementation (Chrome, Firefox, Opera) or
@@ -2709,24 +2709,30 @@ if ( navigator.mozGetUserMedia ||
27092709
27102710 // Call relevant PeerConnection constructor according to plugin version
27112711 AdapterJS . WebRTCPlugin . WaitForPluginReady ( ) ;
2712+
2713+ // RTCPeerConnection prototype from the old spec
2714+ var iceServers = null ;
2715+ if ( servers && Array . isArray ( servers . iceServers ) ) {
2716+ iceServers = servers . iceServers ;
2717+ for ( var i = 0 ; i < iceServers . length ; i ++ ) {
2718+ // Legacy plugin versions compatibility
2719+ if ( iceServers [ i ] . urls && ! iceServers [ i ] . url ) {
2720+ iceServers [ i ] . url = iceServers [ i ] . urls ;
2721+ }
2722+ iceServers [ i ] . hasCredentials = AdapterJS .
2723+ isDefined ( iceServers [ i ] . username ) &&
2724+ AdapterJS . isDefined ( iceServers [ i ] . credential ) ;
2725+ }
2726+ }
2727+
27122728 if ( AdapterJS . WebRTCPlugin . plugin . PEER_CONNECTION_VERSION &&
27132729 AdapterJS . WebRTCPlugin . plugin . PEER_CONNECTION_VERSION > 1 ) {
27142730 // RTCPeerConnection prototype from the new spec
2731+ if ( iceServers ) {
2732+ servers . iceServers = iceServers ;
2733+ }
27152734 return AdapterJS . WebRTCPlugin . plugin . PeerConnection ( servers ) ;
27162735 } else {
2717- // RTCPeerConnection prototype from the old spec
2718- var iceServers = null ;
2719- if ( servers && Array . isArray ( servers . iceServers ) ) {
2720- iceServers = servers . iceServers ;
2721- for ( var i = 0 ; i < iceServers . length ; i ++ ) {
2722- if ( iceServers [ i ] . urls && ! iceServers [ i ] . url ) {
2723- iceServers [ i ] . url = iceServers [ i ] . urls ;
2724- }
2725- iceServers [ i ] . hasCredentials = AdapterJS .
2726- isDefined ( iceServers [ i ] . username ) &&
2727- AdapterJS . isDefined ( iceServers [ i ] . credential ) ;
2728- }
2729- }
27302736 var mandatory = ( constraints && constraints . mandatory ) ?
27312737 constraints . mandatory : null ;
27322738 var optional = ( constraints && constraints . optional ) ?
0 commit comments