Ver código fonte

ref(RTC): remove legacy pc constraints.

Stop using the legacy pc constraints that are no longer wired up to WebRTC.
dev1
Jaya Allamsetty 4 anos atrás
pai
commit
df9f3c068d
2 arquivos alterados com 7 adições e 42 exclusões
  1. 1
    15
      modules/RTC/RTC.js
  2. 6
    27
      modules/RTC/RTCUtils.js

+ 1
- 15
modules/RTC/RTC.js Ver arquivo

@@ -455,7 +455,7 @@ export default class RTC extends Listenable {
455 455
      * @return {TraceablePeerConnection}
456 456
      */
457 457
     createPeerConnection(signaling, iceConfig, isP2P, options) {
458
-        const pcConstraints = RTC.getPCConstraints(isP2P);
458
+        const pcConstraints = JSON.parse(JSON.stringify(RTCUtils.pcConstraints));
459 459
 
460 460
         if (typeof options.abtestSuspendVideo !== 'undefined') {
461 461
             RTCUtils.setSuspendVideo(pcConstraints, options.abtestSuspendVideo);
@@ -648,20 +648,6 @@ export default class RTC extends Listenable {
648 648
         this.localTracks.splice(pos, 1);
649 649
     }
650 650
 
651
-    /**
652
-     *
653
-     */
654
-    static getPCConstraints(isP2P) {
655
-        const pcConstraints
656
-            = isP2P ? RTCUtils.p2pPcConstraints : RTCUtils.pcConstraints;
657
-
658
-        if (!pcConstraints) {
659
-            return {};
660
-        }
661
-
662
-        return JSON.parse(JSON.stringify(pcConstraints));
663
-    }
664
-
665 651
     /**
666 652
      *
667 653
      * @param elSelector

+ 6
- 27
modules/RTC/RTCUtils.js Ver arquivo

@@ -815,7 +815,12 @@ class RTCUtils extends Listenable {
815 815
             throw new Error(message);
816 816
         }
817 817
 
818
-        this._initPCConstraints();
818
+        this.pcConstraints = browser.isChromiumBased() || browser.isReactNative()
819
+            ? { optional: [
820
+                { googScreencastMinBitrate: 100 },
821
+                { googCpuOveruseDetection: true }
822
+            ] }
823
+            : {};
819 824
 
820 825
         screenObtainer.init(
821 826
             options,
@@ -847,32 +852,6 @@ class RTCUtils extends Listenable {
847 852
         }
848 853
     }
849 854
 
850
-    /**
851
-     * Creates instance objects for peer connection constraints both for p2p
852
-     * and outside of p2p.
853
-     */
854
-    _initPCConstraints() {
855
-        if (browser.isFirefox()) {
856
-            this.pcConstraints = {};
857
-        } else if (browser.isChromiumBased() || browser.isReactNative()) {
858
-            this.pcConstraints = { optional: [
859
-                { googHighStartBitrate: 0 },
860
-                { googPayloadPadding: true },
861
-                { googScreencastMinBitrate: 100 },
862
-                { googCpuOveruseDetection: true },
863
-                { googCpuOveruseEncodeUsage: true },
864
-                { googCpuUnderuseThreshold: 55 },
865
-                { googCpuOveruseThreshold: 85 }
866
-            ] };
867
-
868
-            this.p2pPcConstraints
869
-                = JSON.parse(JSON.stringify(this.pcConstraints));
870
-        }
871
-
872
-        this.p2pPcConstraints = this.p2pPcConstraints || this.pcConstraints;
873
-    }
874
-
875
-
876 855
     /**
877 856
      *
878 857
      * @param {Function} callback

Carregando…
Cancelar
Salvar