浏览代码

Merge pull request #1818 from jitsi/tavram/safari

fix(browser-capabilities) expose supported mobile browsers
dev1
Avram Tudor 3 年前
父节点
当前提交
161da84ac0
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 30 次插入0 次删除
  1. 30
    0
      modules/browser/BrowserCapabilities.js

+ 30
- 0
modules/browser/BrowserCapabilities.js 查看文件

6
 /* Minimum required Chrome / Chromium version. This applies also to derivatives. */
6
 /* Minimum required Chrome / Chromium version. This applies also to derivatives. */
7
 const MIN_REQUIRED_CHROME_VERSION = 72;
7
 const MIN_REQUIRED_CHROME_VERSION = 72;
8
 const MIN_REQUIRED_SAFARI_VERSION = 14;
8
 const MIN_REQUIRED_SAFARI_VERSION = 14;
9
+const MIN_REQUIRED_IOS_VERSION = 14;
9
 
10
 
10
 // TODO: Move this code to js-utils.
11
 // TODO: Move this code to js-utils.
11
 
12
 
112
             || this.isWebKitBased();
113
             || this.isWebKitBased();
113
     }
114
     }
114
 
115
 
116
+    /**
117
+     * Returns whether the browser is supported for Android
118
+     * @returns {boolean} true if the browser is supported for Android devices
119
+     */
120
+    isSupportedAndroidBrowser() {
121
+        return this.isChromiumBased() || this.isFirefox();
122
+    }
123
+
124
+    /**
125
+     * Returns whether the browser is supported for iOS
126
+     * @returns {boolean} true if the browser is supported for iOS devices
127
+     */
128
+    isSupportedIOSBrowser() {
129
+        return this._getIOSVersion() >= MIN_REQUIRED_IOS_VERSION;
130
+    }
131
+
115
     /**
132
     /**
116
      * Returns whether or not the current environment needs a user interaction
133
      * Returns whether or not the current environment needs a user interaction
117
      * with the page before any unmute can occur.
134
      * with the page before any unmute can occur.
381
 
398
 
382
         return -1;
399
         return -1;
383
     }
400
     }
401
+
402
+    /**
403
+     * Returns the version of an ios browser.
404
+     *
405
+     * @returns {Number}
406
+     */
407
+    _getIOSVersion() {
408
+        if (this.isWebKitBased()) {
409
+            return Number.parseInt(this.getVersion(), 10);
410
+        }
411
+
412
+        return -1;
413
+    }
384
 }
414
 }

正在加载...
取消
保存