소스 검색

feat(RTC) drop no longer supported PC media constraints

They have been deprecated and their valued can no longer be changed from
the default after M103.

Ref: https://groups.google.com/u/0/g/discuss-webrtc/c/2l7jWgreYpw?pli=1
dev1
Saúl Ibarra Corretgé 3 년 전
부모
커밋
59665767bf
3개의 변경된 파일2개의 추가작업 그리고 58개의 파일을 삭제
  1. 0
    8
      modules/RTC/RTC.js
  2. 1
    30
      modules/RTC/RTCUtils.js
  3. 1
    20
      types/auto/modules/RTC/RTCUtils.d.ts

+ 0
- 8
modules/RTC/RTC.js 파일 보기

@@ -6,7 +6,6 @@ import { MediaType } from '../../service/RTC/MediaType';
6 6
 import RTCEvents from '../../service/RTC/RTCEvents';
7 7
 import browser from '../browser';
8 8
 import FeatureFlags from '../flags/FeatureFlags';
9
-import Statistics from '../statistics/statistics';
10 9
 import GlobalOnErrorHandler from '../util/GlobalOnErrorHandler';
11 10
 import Listenable from '../util/Listenable';
12 11
 import { safeCounterIncrement } from '../util/MathUtil';
@@ -505,13 +504,6 @@ export default class RTC extends Listenable {
505 504
     createPeerConnection(signaling, pcConfig, isP2P, options) {
506 505
         const pcConstraints = JSON.parse(JSON.stringify(RTCUtils.pcConstraints));
507 506
 
508
-        if (typeof options.abtestSuspendVideo !== 'undefined') {
509
-            RTCUtils.setSuspendVideo(pcConstraints, options.abtestSuspendVideo);
510
-
511
-            Statistics.analytics.addPermanentProperties(
512
-                { abtestSuspendVideo: options.abtestSuspendVideo });
513
-        }
514
-
515 507
         if (options.enableInsertableStreams) {
516 508
             logger.debug('E2EE - setting insertable streams constraints');
517 509
             pcConfig.encodedInsertableStreams = true;

+ 1
- 30
modules/RTC/RTCUtils.js 파일 보기

@@ -365,12 +365,7 @@ class RTCUtils extends Listenable {
365 365
             this.getTrackID = ({ id }) => id;
366 366
         }
367 367
 
368
-        this.pcConstraints = browser.isChromiumBased() || browser.isReactNative()
369
-            ? { optional: [
370
-                { googScreencastMinBitrate: 100 },
371
-                { googCpuOveruseDetection: true }
372
-            ] }
373
-            : {};
368
+        this.pcConstraints = {};
374 369
 
375 370
         screenObtainer.init(options);
376 371
 
@@ -879,30 +874,6 @@ class RTCUtils extends Listenable {
879 874
 
880 875
         return { deviceList };
881 876
     }
882
-
883
-    /**
884
-     * Configures the given PeerConnection constraints to either enable or
885
-     * disable (according to the value of the 'enable' parameter) the
886
-     * 'googSuspendBelowMinBitrate' option.
887
-     * @param constraints the constraints on which to operate.
888
-     * @param enable {boolean} whether to enable or disable the suspend video
889
-     * option.
890
-     */
891
-    setSuspendVideo(constraints, enable) {
892
-        if (!constraints.optional) {
893
-            constraints.optional = [];
894
-        }
895
-
896
-        // Get rid of all "googSuspendBelowMinBitrate" constraints (we assume
897
-        // that the elements of constraints.optional contain a single property).
898
-        constraints.optional
899
-            = constraints.optional.filter(
900
-                c => !c.hasOwnProperty('googSuspendBelowMinBitrate'));
901
-
902
-        if (enable) {
903
-            constraints.optional.push({ googSuspendBelowMinBitrate: 'true' });
904
-        }
905
-    }
906 877
 }
907 878
 
908 879
 const rtcUtils = new RTCUtils();

+ 1
- 20
types/auto/modules/RTC/RTCUtils.d.ts 파일 보기

@@ -30,17 +30,7 @@ declare class RTCUtils extends Listenable {
30 30
     getTrackID: ({ id }: {
31 31
         id: any;
32 32
     }) => any;
33
-    pcConstraints: {
34
-        optional: ({
35
-            googScreencastMinBitrate: number;
36
-            googCpuOveruseDetection?: undefined;
37
-        } | {
38
-            googCpuOveruseDetection: boolean;
39
-            googScreencastMinBitrate?: undefined;
40
-        })[];
41
-    } | {
42
-        optional?: undefined;
43
-    };
33
+    pcConstraints: {};
44 34
     /**
45 35
      *
46 36
      * @param {Function} callback
@@ -168,14 +158,5 @@ declare class RTCUtils extends Listenable {
168 158
      * @returns {MediaDeviceInfo} device.
169 159
      */
170 160
     getEventDataForActiveDevice(device: any): MediaDeviceInfo;
171
-    /**
172
-     * Configures the given PeerConnection constraints to either enable or
173
-     * disable (according to the value of the 'enable' parameter) the
174
-     * 'googSuspendBelowMinBitrate' option.
175
-     * @param constraints the constraints on which to operate.
176
-     * @param enable {boolean} whether to enable or disable the suspend video
177
-     * option.
178
-     */
179
-    setSuspendVideo(constraints: any, enable: boolean): void;
180 161
 }
181 162
 import Listenable from "../util/Listenable";

Loading…
취소
저장