Procházet zdrojové kódy

fix(vad): enable VAD on supported browsers (#1613)

tags/v0.0.2
Andrei Gavrilescu před 4 roky
rodič
revize
6a3dada96f
Žádný účet není propojen s e-mailovou adresou tvůrce revize
2 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 2
    3
      JitsiConference.js
  2. 9
    0
      modules/browser/BrowserCapabilities.js

+ 2
- 3
JitsiConference.js Zobrazit soubor

@@ -439,8 +439,7 @@ JitsiConference.prototype._init = function(options = {}) {
439 439
 
440 440
     // Disable VAD processing on Safari since it causes audio input to
441 441
     // fail on some of the mobile devices.
442
-    if (config.enableTalkWhileMuted && !browser.isWebKitBased()) {
443
-
442
+    if (config.enableTalkWhileMuted && browser.supportsVADDetection()) {
444 443
         // If VAD processor factory method is provided uses VAD based detection, otherwise fallback to audio level
445 444
         // based detection.
446 445
         if (config.createVADProcessor) {
@@ -463,7 +462,7 @@ JitsiConference.prototype._init = function(options = {}) {
463 462
 
464 463
     // Disable noisy mic detection on safari since it causes the audio input to
465 464
     // fail on Safari on iPadOS.
466
-    if (config.enableNoisyMicDetection && !browser.isWebKitBased()) {
465
+    if (config.enableNoisyMicDetection && browser.supportsVADDetection()) {
467 466
         if (config.createVADProcessor) {
468 467
             if (!this._audioAnalyser) {
469 468
                 this._audioAnalyser = new VADAudioAnalyser(this, config.createVADProcessor);

+ 9
- 0
modules/browser/BrowserCapabilities.js Zobrazit soubor

@@ -303,6 +303,15 @@ export default class BrowserCapabilities extends BrowserDetection {
303 303
         return this.isChromiumBased();
304 304
     }
305 305
 
306
+    /**
307
+     * Checks if the browser supports voice activity detection via the @type {VADAudioAnalyser} service.
308
+     *
309
+     * @returns {boolean}
310
+     */
311
+    supportsVADDetection() {
312
+        return this.isChromiumBased();
313
+    }
314
+
306 315
     /**
307 316
      * Returns the version of a Chromium based browser.
308 317
      *

Načítá se…
Zrušit
Uložit