1- /*! adapterjs - v0.15.3 - 2018-09-05 */
1+ /*! adapterjs - v0.15.4 - 2019-01-07 */
22
33'use strict'
44
@@ -20,7 +20,7 @@ AdapterJS.options.hidePluginInstallPrompt = !!AdapterJS.options.hidePluginInstal
2020AdapterJS . options . forceSafariPlugin = ! ! AdapterJS . options . forceSafariPlugin ;
2121
2222// AdapterJS version
23- AdapterJS . VERSION = '0.15.3 ' ;
23+ AdapterJS . VERSION = '0.15.4 ' ;
2424
2525// This function will be called when the WebRTC API is ready to be used
2626// Whether it is the native implementation (Chrome, Firefox, Opera) or
@@ -259,6 +259,56 @@ AdapterJS._iceConnectionFiredStates = [];
259259// Check if WebRTC Interface is defined.
260260AdapterJS . isDefined = null ;
261261
262+ // -----------------------------------------------------------
263+ // Detected webrtc implementation. Types are:
264+ // - 'moz': Mozilla implementation of webRTC.
265+ // - 'webkit': WebKit implementation of webRTC.
266+ // - 'plugin': Using the plugin implementation.
267+ window . webrtcDetectedType = null ;
268+
269+ //Creates MediaStream object.
270+ window . MediaStream = ( typeof MediaStream === 'function' ) ? MediaStream : null ;
271+
272+ //The RTCPeerConnection object.
273+ window . RTCPeerConnection = ( typeof RTCPeerConnection === 'function' ) ?
274+ RTCPeerConnection : null ;
275+
276+ // Creates RTCSessionDescription object for Plugin Browsers
277+ window . RTCSessionDescription = ( typeof RTCSessionDescription === 'function' ) ?
278+ RTCSessionDescription : null ;
279+
280+ // Creates RTCIceCandidate object for Plugin Browsers
281+ window . RTCIceCandidate = ( typeof RTCIceCandidate === 'function' ) ?
282+ RTCIceCandidate : null ;
283+
284+ // Get UserMedia (only difference is the prefix).
285+ // Code from Adam Barth.
286+ window . getUserMedia = ( typeof getUserMedia === 'function' ) ?
287+ getUserMedia : null ;
288+
289+ // Attach a media stream to an element.
290+ window . attachMediaStream = null ;
291+
292+ // Re-attach a media stream to an element.
293+ window . reattachMediaStream = null ;
294+
295+ // Detected browser agent name. Types are:
296+ // - 'firefox': Firefox browser.
297+ // - 'chrome': Chrome browser.
298+ // - 'opera': Opera browser.
299+ // - 'safari': Safari browser.
300+ // - 'IE' - Internet Explorer browser.
301+ window . webrtcDetectedBrowser = null ;
302+
303+ // Detected browser version.
304+ window . webrtcDetectedVersion = null ;
305+
306+ // The minimum browser version still supported by AJS.
307+ window . webrtcMinimumVersion = null ;
308+
309+ // The type of DC supported by the browser
310+ window . webrtcDetectedDCSupport = null ;
311+
262312// This function helps to retrieve the webrtc detected browser information.
263313// This sets:
264314// - webrtcDetectedBrowser: The browser agent name.
@@ -275,71 +325,71 @@ AdapterJS.parseWebrtcDetectedBrowser = function () {
275325 if ( ( ! ! window . opr && ! ! opr . addons ) || ! ! window . opera || navigator . userAgent . indexOf ( ' OPR/' ) >= 0 ) {
276326 hasMatch = navigator . userAgent . match ( / O P R \/ ( \d + ) / i) || [ ] ;
277327
278- webrtcDetectedBrowser = 'opera' ;
279- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
280- webrtcMinimumVersion = 26 ;
281- webrtcDetectedType = 'webkit' ;
282- webrtcDetectedDCSupport = 'SCTP' ; // Opera 20+ uses Chrome 33
328+ window . webrtcDetectedBrowser = 'opera' ;
329+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
330+ window . webrtcMinimumVersion = 26 ;
331+ window . webrtcDetectedType = 'webkit' ;
332+ window . webrtcDetectedDCSupport = 'SCTP' ; // Opera 20+ uses Chrome 33
283333
284334 // Detect Bowser on iOS
285335 } else if ( navigator . userAgent . match ( / B o w s e r \/ [ 0 - 9 . ] * / g) ) {
286336 hasMatch = navigator . userAgent . match ( / B o w s e r \/ [ 0 - 9 . ] * / g) || [ ] ;
287337
288338 var chromiumVersion = parseInt ( ( navigator . userAgent . match ( / C h r o m ( e | i u m ) \/ ( [ 0 - 9 ] + ) \. / i) || [ ] ) [ 2 ] || '0' , 10 ) ;
289339
290- webrtcDetectedBrowser = 'bowser' ;
291- webrtcDetectedVersion = parseFloat ( ( hasMatch [ 0 ] || '0/0' ) . split ( '/' ) [ 1 ] , 10 ) ;
292- webrtcMinimumVersion = 0 ;
293- webrtcDetectedType = 'webkit' ;
294- webrtcDetectedDCSupport = chromiumVersion > 30 ? 'SCTP' : 'RTP' ;
340+ window . webrtcDetectedBrowser = 'bowser' ;
341+ window . webrtcDetectedVersion = parseFloat ( ( hasMatch [ 0 ] || '0/0' ) . split ( '/' ) [ 1 ] , 10 ) ;
342+ window . webrtcMinimumVersion = 0 ;
343+ window . webrtcDetectedType = 'webkit' ;
344+ window . webrtcDetectedDCSupport = chromiumVersion > 30 ? 'SCTP' : 'RTP' ;
295345
296346
297347 // Detect Opera on iOS (does not support WebRTC yet)
298348 } else if ( navigator . userAgent . indexOf ( 'OPiOS' ) > 0 ) {
299349 hasMatch = navigator . userAgent . match ( / O P i O S \/ ( [ 0 - 9 ] + ) \. / ) ;
300350
301351 // Browser which do not support webrtc yet
302- webrtcDetectedBrowser = 'opera' ;
303- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
304- webrtcMinimumVersion = 0 ;
305- webrtcDetectedType = null ;
306- webrtcDetectedDCSupport = null ;
352+ window . webrtcDetectedBrowser = 'opera' ;
353+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
354+ window . webrtcMinimumVersion = 0 ;
355+ window . webrtcDetectedType = null ;
356+ window . webrtcDetectedDCSupport = null ;
307357
308358 // Detect Chrome on iOS (does not support WebRTC yet)
309359 } else if ( navigator . userAgent . indexOf ( 'CriOS' ) > 0 ) {
310360 hasMatch = navigator . userAgent . match ( / C r i O S \/ ( [ 0 - 9 ] + ) \. / ) || [ ] ;
311361
312- webrtcDetectedBrowser = 'chrome' ;
313- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
314- webrtcMinimumVersion = 0 ;
315- webrtcDetectedType = null ;
316- webrtcDetectedDCSupport = null ;
362+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
363+ window . webrtcMinimumVersion = 0 ;
364+ window . webrtcDetectedType = null ;
365+ window . webrtcDetectedBrowser = 'chrome' ;
366+ window . webrtcDetectedDCSupport = null ;
317367
318368 // Detect Firefox on iOS (does not support WebRTC yet)
319369 } else if ( navigator . userAgent . indexOf ( 'FxiOS' ) > 0 ) {
320370 hasMatch = navigator . userAgent . match ( / F x i O S \/ ( [ 0 - 9 ] + ) \. / ) || [ ] ;
321371
322372 // Browser which do not support webrtc yet
323- webrtcDetectedBrowser = 'firefox' ;
324- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
325- webrtcMinimumVersion = 0 ;
326- webrtcDetectedType = null ;
327- webrtcDetectedDCSupport = null ;
373+ window . webrtcDetectedBrowser = 'firefox' ;
374+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
375+ window . webrtcMinimumVersion = 0 ;
376+ window . webrtcDetectedType = null ;
377+ window . webrtcDetectedDCSupport = null ;
328378
329379 // Detect IE (6-11)
330380 } else if ( /*@cc_on !@*/ false || ! ! document . documentMode ) {
331381 hasMatch = / \b r v [ : ] + ( \d + ) / g. exec ( navigator . userAgent ) || [ ] ;
332382
333- webrtcDetectedBrowser = 'IE' ;
334- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] , 10 ) ;
335- webrtcMinimumVersion = 9 ;
336- webrtcDetectedType = 'plugin' ;
337- webrtcDetectedDCSupport = 'SCTP' ;
383+ window . webrtcDetectedBrowser = 'IE' ;
384+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] , 10 ) ;
385+ window . webrtcMinimumVersion = 9 ;
386+ window . webrtcDetectedType = 'plugin' ;
387+ window . webrtcDetectedDCSupport = 'SCTP' ;
338388
339389 if ( ! webrtcDetectedVersion ) {
340390 hasMatch = / \b M S I E [ : ] + ( \d + ) / g. exec ( navigator . userAgent ) || [ ] ;
341391
342- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
392+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
343393 }
344394
345395 // Detect Edge (20+)
@@ -349,33 +399,33 @@ AdapterJS.parseWebrtcDetectedBrowser = function () {
349399 // Previous webrtc/adapter uses minimum version as 10547 but checking in the Edge release history,
350400 // It's close to 13.10547 and ObjectRTC API is fully supported in that version
351401
352- webrtcDetectedBrowser = 'edge' ;
353- webrtcDetectedVersion = parseFloat ( ( hasMatch [ 0 ] || '0/0' ) . split ( '/' ) [ 1 ] , 10 ) ;
354- webrtcMinimumVersion = 13.10547 ;
355- webrtcDetectedType = 'ms' ;
356- webrtcDetectedDCSupport = null ;
402+ window . webrtcDetectedBrowser = 'edge' ;
403+ window . webrtcDetectedVersion = parseFloat ( ( hasMatch [ 0 ] || '0/0' ) . split ( '/' ) [ 1 ] , 10 ) ;
404+ window . webrtcMinimumVersion = 13.10547 ;
405+ window . webrtcDetectedType = 'ms' ;
406+ window . webrtcDetectedDCSupport = null ;
357407
358408 // Detect Firefox (1.0+)
359409 // Placed before Safari check to ensure Firefox on Android is detected
360410 } else if ( typeof InstallTrigger !== 'undefined' || navigator . userAgent . indexOf ( 'irefox' ) > 0 ) {
361411 hasMatch = navigator . userAgent . match ( / F i r e f o x \/ ( [ 0 - 9 ] + ) \. / ) || [ ] ;
362412
363- webrtcDetectedBrowser = 'firefox' ;
364- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
365- webrtcMinimumVersion = 33 ;
366- webrtcDetectedType = 'moz' ;
367- webrtcDetectedDCSupport = 'SCTP' ;
413+ window . webrtcDetectedBrowser = 'firefox' ;
414+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
415+ window . webrtcMinimumVersion = 33 ;
416+ window . webrtcDetectedType = 'moz' ;
417+ window . webrtcDetectedDCSupport = 'SCTP' ;
368418
369419 // Detect Chrome (1+ and mobile)
370420 // Placed before Safari check to ensure Chrome on Android is detected
371421 } else if ( ( ! ! window . chrome && ! ! window . chrome . webstore ) || navigator . userAgent . indexOf ( 'Chrom' ) > 0 ) {
372422 hasMatch = navigator . userAgent . match ( / C h r o m ( e | i u m ) \/ ( [ 0 - 9 ] + ) \. / i) || [ ] ;
373423
374- webrtcDetectedBrowser = 'chrome' ;
375- webrtcDetectedVersion = parseInt ( hasMatch [ 2 ] || '0' , 10 ) ;
376- webrtcMinimumVersion = 38 ;
377- webrtcDetectedType = 'webkit' ;
378- webrtcDetectedDCSupport = webrtcDetectedVersion > 30 ? 'SCTP' : 'RTP' ; // Chrome 31+ supports SCTP without flags
424+ window . webrtcDetectedBrowser = 'chrome' ;
425+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 2 ] || '0' , 10 ) ;
426+ window . webrtcMinimumVersion = 38 ;
427+ window . webrtcDetectedType = 'webkit' ;
428+ window . webrtcDetectedDCSupport = window . webrtcDetectedVersion > 30 ? 'SCTP' : 'RTP' ; // Chrome 31+ supports SCTP without flags
379429
380430 // Detect Safari
381431 } else if ( / c o n s t r u c t o r / i. test ( window . HTMLElement ) || ( function ( p ) { return p . toString ( ) === "[object SafariRemoteNotification]" ; } ) ( ! window [ 'safari' ] || safari . pushNotification ) || navigator . userAgent . match ( / A p p l e W e b K i t \/ ( \d + ) \. / ) || navigator . userAgent . match ( / V e r s i o n \/ ( \d + ) .( \d + ) / ) ) {
@@ -384,26 +434,26 @@ AdapterJS.parseWebrtcDetectedBrowser = function () {
384434
385435 var isMobile = navigator . userAgent . match ( / ( i P h o n e | i P a d ) / gi) ;
386436 var hasNativeImpl = AppleWebKitBuild . length >= 1 && AppleWebKitBuild [ 1 ] >= 604 ;
387- webrtcDetectedBrowser = 'safari' ;
388- webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
389- webrtcMinimumVersion = 7 ;
437+ window . webrtcDetectedBrowser = 'safari' ;
438+ window . webrtcDetectedVersion = parseInt ( hasMatch [ 1 ] || '0' , 10 ) ;
439+ window . webrtcMinimumVersion = 7 ;
390440 if ( isMobile ) {
391- webrtcDetectedType = hasNativeImpl ? 'AppleWebKit' : null ;
441+ window . webrtcDetectedType = hasNativeImpl ? 'AppleWebKit' : null ;
392442 } else { // desktop
393- var majorVersion = webrtcDetectedVersion ;
443+ var majorVersion = window . webrtcDetectedVersion ;
394444 var minorVersion = parseInt ( hasMatch [ 2 ] || '0' , 10 ) ;
395445 var nativeImplIsOverridable = majorVersion == 11 && minorVersion < 2 ;
396- webrtcDetectedType = hasNativeImpl && ! ( AdapterJS . options . forceSafariPlugin && nativeImplIsOverridable ) ? 'AppleWebKit' : 'plugin' ;
446+ window . webrtcDetectedType = hasNativeImpl && ! ( AdapterJS . options . forceSafariPlugin && nativeImplIsOverridable ) ? 'AppleWebKit' : 'plugin' ;
397447 }
398- webrtcDetectedDCSupport = 'SCTP' ;
448+ window . webrtcDetectedDCSupport = 'SCTP' ;
399449 }
400450
401451 // Scope it to AdapterJS and window for better consistency
402- AdapterJS . webrtcDetectedBrowser = window . webrtcDetectedBrowser = webrtcDetectedBrowser ;
403- AdapterJS . webrtcDetectedVersion = window . webrtcDetectedVersion = webrtcDetectedVersion ;
404- AdapterJS . webrtcMinimumVersion = window . webrtcMinimumVersion = webrtcMinimumVersion ;
405- AdapterJS . webrtcDetectedType = window . webrtcDetectedType = webrtcDetectedType ;
406- AdapterJS . webrtcDetectedDCSupport = window . webrtcDetectedDCSupport = webrtcDetectedDCSupport ;
452+ AdapterJS . webrtcDetectedBrowser = window . webrtcDetectedBrowser ;
453+ AdapterJS . webrtcDetectedVersion = window . webrtcDetectedVersion ;
454+ AdapterJS . webrtcMinimumVersion = window . webrtcMinimumVersion ;
455+ AdapterJS . webrtcDetectedType = window . webrtcDetectedType ;
456+ AdapterJS . webrtcDetectedDCSupport = window . webrtcDetectedDCSupport ;
407457} ;
408458
409459AdapterJS . addEvent = function ( elem , evnt , func ) {
@@ -478,55 +528,6 @@ AdapterJS.renderNotificationBar = function (message, buttonText, buttonCallback)
478528 } , 300 ) ;
479529} ;
480530
481- // -----------------------------------------------------------
482- // Detected webrtc implementation. Types are:
483- // - 'moz': Mozilla implementation of webRTC.
484- // - 'webkit': WebKit implementation of webRTC.
485- // - 'plugin': Using the plugin implementation.
486- window . webrtcDetectedType = null ;
487-
488- //Creates MediaStream object.
489- window . MediaStream = ( typeof MediaStream === 'function' ) ? MediaStream : null ;
490-
491- //The RTCPeerConnection object.
492- window . RTCPeerConnection = ( typeof RTCPeerConnection === 'function' ) ?
493- RTCPeerConnection : null ;
494-
495- // Creates RTCSessionDescription object for Plugin Browsers
496- window . RTCSessionDescription = ( typeof RTCSessionDescription === 'function' ) ?
497- RTCSessionDescription : null ;
498-
499- // Creates RTCIceCandidate object for Plugin Browsers
500- window . RTCIceCandidate = ( typeof RTCIceCandidate === 'function' ) ?
501- RTCIceCandidate : null ;
502-
503- // Get UserMedia (only difference is the prefix).
504- // Code from Adam Barth.
505- window . getUserMedia = ( typeof getUserMedia === 'function' ) ?
506- getUserMedia : null ;
507-
508- // Attach a media stream to an element.
509- window . attachMediaStream = null ;
510-
511- // Re-attach a media stream to an element.
512- window . reattachMediaStream = null ;
513-
514- // Detected browser agent name. Types are:
515- // - 'firefox': Firefox browser.
516- // - 'chrome': Chrome browser.
517- // - 'opera': Opera browser.
518- // - 'safari': Safari browser.
519- // - 'IE' - Internet Explorer browser.
520- window . webrtcDetectedBrowser = null ;
521-
522- // Detected browser version.
523- window . webrtcDetectedVersion = null ;
524-
525- // The minimum browser version still supported by AJS.
526- window . webrtcMinimumVersion = null ;
527-
528- // The type of DC supported by the browser
529- window . webrtcDetectedDCSupport = null ;
530531
531532// The requestUserMedia used by plugin gUM
532533window . requestUserMedia = ( typeof requestUserMedia === 'function' ) ?
@@ -6263,13 +6264,17 @@ module.exports = {
62636264 function ( comName , plugName , plugType , installedCb , notInstalledCb ) {
62646265 if ( AdapterJS . webrtcDetectedBrowser !== 'IE' ) {
62656266 var pluginArray = navigator . mimeTypes ;
6266- for ( var i = 0 ; i < pluginArray . length ; i ++ ) {
6267- if ( pluginArray [ i ] . type . indexOf ( plugType ) >= 0 ) {
6268- installedCb ( ) ;
6269- return ;
6267+ if ( typeof pluginArray !== 'undefined' ) {
6268+ for ( var i = 0 ; i < pluginArray . length ; i ++ ) {
6269+ if ( pluginArray [ i ] . type . indexOf ( plugType ) >= 0 ) {
6270+ installedCb ( ) ;
6271+ return ;
6272+ }
62706273 }
6274+ notInstalledCb ( ) ;
6275+ } else {
6276+ AdapterJS . renderNotificationBar ( AdapterJS . TEXT . PLUGIN . NOT_SUPPORTED ) ;
62716277 }
6272- notInstalledCb ( ) ;
62736278 } else {
62746279 try {
62756280 var axo = new ActiveXObject ( comName + '.' + plugName ) ;
0 commit comments