|
@@ -261,27 +261,7 @@ export default class BrowserCapabilities extends BrowserDetection {
|
261
|
261
|
}
|
262
|
262
|
|
263
|
263
|
if (this.isChromiumBased()) {
|
264
|
|
- // NW.JS doesn't expose the Chrome version in the UA string.
|
265
|
|
- if (this.isNWJS()) {
|
266
|
|
- // eslint-disable-next-line no-undef
|
267
|
|
- const version = Number.parseInt(process.versions.chromium, 10);
|
268
|
|
-
|
269
|
|
- return version >= REQUIRED_CHROME_VERSION;
|
270
|
|
- }
|
271
|
|
-
|
272
|
|
- // Here we process all browsers which use the Chrome engine but
|
273
|
|
- // don't necessarily identify as Chrome. We cannot use the version
|
274
|
|
- // comparing functions because the Electron, Opera and NW.JS
|
275
|
|
- // versions are inconsequential here, as we need to know the actual
|
276
|
|
- // Chrome engine version.
|
277
|
|
- const ua = navigator.userAgent;
|
278
|
|
-
|
279
|
|
- if (ua.match(/Chrome/)) {
|
280
|
|
- const version
|
281
|
|
- = Number.parseInt(ua.match(/Chrome\/([\d.]+)/)[1], 10);
|
282
|
|
-
|
283
|
|
- return version >= REQUIRED_CHROME_VERSION;
|
284
|
|
- }
|
|
264
|
+ return this._getChromiumBasedVersion() >= REQUIRED_CHROME_VERSION;
|
285
|
265
|
}
|
286
|
266
|
|
287
|
267
|
return false;
|
|
@@ -304,4 +284,45 @@ export default class BrowserCapabilities extends BrowserDetection {
|
304
|
284
|
supportsGetDisplayMedia() {
|
305
|
285
|
return navigator.getDisplayMedia !== undefined;
|
306
|
286
|
}
|
|
287
|
+
|
|
288
|
+ /**
|
|
289
|
+ * Checks if the browser supports the "sdpSemantics" configuration option.
|
|
290
|
+ * https://webrtc.org/web-apis/chrome/unified-plan/
|
|
291
|
+ *
|
|
292
|
+ * @returns {boolean}
|
|
293
|
+ */
|
|
294
|
+ supportsSdpSemantics() {
|
|
295
|
+ return this.isChromiumBased() && this._getChromiumBasedVersion() >= 65;
|
|
296
|
+ }
|
|
297
|
+
|
|
298
|
+ /**
|
|
299
|
+ * Returns the version of a Chromium based browser.
|
|
300
|
+ *
|
|
301
|
+ * @returns {Number}
|
|
302
|
+ */
|
|
303
|
+ _getChromiumBasedVersion() {
|
|
304
|
+ if (this.isChromiumBased()) {
|
|
305
|
+ // NW.JS doesn't expose the Chrome version in the UA string.
|
|
306
|
+ if (this.isNWJS()) {
|
|
307
|
+ // eslint-disable-next-line no-undef
|
|
308
|
+ return Number.parseInt(process.versions.chromium, 10);
|
|
309
|
+ }
|
|
310
|
+
|
|
311
|
+ // Here we process all browsers which use the Chrome engine but
|
|
312
|
+ // don't necessarily identify as Chrome. We cannot use the version
|
|
313
|
+ // comparing functions because the Electron, Opera and NW.JS
|
|
314
|
+ // versions are inconsequential here, as we need to know the actual
|
|
315
|
+ // Chrome engine version.
|
|
316
|
+ const ua = navigator.userAgent;
|
|
317
|
+
|
|
318
|
+ if (ua.match(/Chrome/)) {
|
|
319
|
+ const version
|
|
320
|
+ = Number.parseInt(ua.match(/Chrome\/([\d.]+)/)[1], 10);
|
|
321
|
+
|
|
322
|
+ return version;
|
|
323
|
+ }
|
|
324
|
+ }
|
|
325
|
+
|
|
326
|
+ return -1;
|
|
327
|
+ }
|
307
|
328
|
}
|