@@ -1676,6 +1676,8 @@ var utils = _interopRequireWildcard(_utils);
1676
1676
1677
1677
function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
1678
1678
1679
+ function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
1680
+
1679
1681
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
1680
1682
1681
1683
function shimOnTrack ( window ) {
@@ -1845,11 +1847,16 @@ function shimAddTransceiver(window) {
1845
1847
if ( origAddTransceiver ) {
1846
1848
window . RTCPeerConnection . prototype . addTransceiver = function addTransceiver ( ) {
1847
1849
this . setParametersPromises = [ ] ;
1848
- var initParameters = arguments [ 1 ] ;
1849
- var shouldPerformCheck = initParameters && 'sendEncodings' in initParameters ;
1850
+ // WebIDL input coercion and validation
1851
+ var sendEncodings = arguments [ 1 ] && arguments [ 1 ] . sendEncodings ;
1852
+ if ( sendEncodings === undefined ) {
1853
+ sendEncodings = [ ] ;
1854
+ }
1855
+ sendEncodings = [ ] . concat ( _toConsumableArray ( sendEncodings ) ) ;
1856
+ var shouldPerformCheck = sendEncodings . length > 0 ;
1850
1857
if ( shouldPerformCheck ) {
1851
1858
// If sendEncodings params are provided, validate grammar
1852
- initParameters . sendEncodings . forEach ( function ( encodingParam ) {
1859
+ sendEncodings . forEach ( function ( encodingParam ) {
1853
1860
if ( 'rid' in encodingParam ) {
1854
1861
var ridRegex = / ^ [ a - z 0 - 9 ] { 0 , 16 } $ / i;
1855
1862
if ( ! ridRegex . test ( encodingParam . rid ) ) {
@@ -1883,8 +1890,8 @@ function shimAddTransceiver(window) {
1883
1890
if ( ! ( 'encodings' in params ) ||
1884
1891
// Avoid being fooled by patched getParameters() below.
1885
1892
params . encodings . length === 1 && Object . keys ( params . encodings [ 0 ] ) . length === 0 ) {
1886
- params . encodings = initParameters . sendEncodings ;
1887
- sender . sendEncodings = initParameters . sendEncodings ;
1893
+ params . encodings = sendEncodings ;
1894
+ sender . sendEncodings = sendEncodings ;
1888
1895
this . setParametersPromises . push ( sender . setParameters ( params ) . then ( function ( ) {
1889
1896
delete sender . sendEncodings ;
1890
1897
} ) . catch ( function ( ) {
@@ -2623,7 +2630,7 @@ function detectBrowser(window) {
2623
2630
// Firefox.
2624
2631
result . browser = 'firefox' ;
2625
2632
result . version = extractVersion ( navigator . userAgent , / F i r e f o x \/ ( \d + ) \. / , 1 ) ;
2626
- } else if ( navigator . webkitGetUserMedia || window . isSecureContext === false && window . webkitRTCPeerConnection && ! window . RTCIceGatherer ) {
2633
+ } else if ( navigator . webkitGetUserMedia || window . isSecureContext === false && window . webkitRTCPeerConnection ) {
2627
2634
// Chrome, Chromium, Webview, Opera.
2628
2635
// Version matches Chrome/WebRTC version.
2629
2636
// Chrome 74 removed webkitGetUserMedia on http as well so we need the
0 commit comments