How to use the webrtc-adapter/dist/utils.detectBrowser function in webrtc-adapter

To help you get started, we’ve selected a few webrtc-adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Temasys / AdapterJS / src / utils.js View on Github external
export function detectBrowser(window) {
  var result = webrtcUtils.detectBrowser(window);

  if (/*@cc_on!@*/false || !!document.documentMode) {
    var hasMatch = /\brv[ :]+(\d+)/g.exec(navigator.userAgent) || [];

    result.browser = 'IE';
    result.version = parseInt(hasMatch[1], 10);

    // window.webrtcDetectedBrowser   = 'IE';
    // window.webrtcDetectedVersion   = parseInt(hasMatch[1], 10);
    // window.webrtcMinimumVersion    = 9;
    // window.webrtcDetectedType      = 'plugin';
    // window.webrtcDetectedDCSupport = 'SCTP';

    if (!result.version) {
      hasMatch = /\bMSIE[ :]+(\d+)/g.exec(navigator.userAgent) || [];
      result.version = parseInt(hasMatch[1] || '0', 10);

webrtc-adapter

A shim to insulate apps from WebRTC spec changes and browser prefix differences

BSD-3-Clause
Latest version published 8 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages