|
@@ -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
|