Преглед изворни кода

feat(1080p): pass new-style constraints to createLocalTracks (#2087)

The lib will accept new style constraints and use those
to capture audio/video. By defining the constraints in
config, there is greater flexibility for defining
and changing constraints.
master
virtuacoplenny пре 7 година
родитељ
комит
2d9ce2486e
3 измењених фајлова са 19 додато и 1 уклоњено
  1. 16
    0
      config.js
  2. 1
    1
      react/features/base/conference/constants.js
  3. 2
    0
      react/features/base/tracks/functions.js

+ 16
- 0
config.js Прегледај датотеку

@@ -92,6 +92,22 @@ var config = {
92 92
     // Sets the preferred resolution (height) for local video. Defaults to 720.
93 93
     // resolution: 720,
94 94
 
95
+    // w3c spec-compliant video constraints to use for video capture. Currently
96
+    // used by browsers that return true from lib-jitsi-meet's
97
+    // RTCBrowserType#usesNewGumFlow. The constraints are independency from
98
+    // this config's resolution value. Defaults to requesting an ideal aspect
99
+    // ratio of 16:9 with an ideal resolution of 1080p.
100
+    // constraints: {
101
+    //     video: {
102
+    //         aspectRatio: 16 / 9,
103
+    //         height: {
104
+    //             ideal: 1080,
105
+    //             max: 1080,
106
+    //             min: 240
107
+    //         }
108
+    //     }
109
+    // },
110
+
95 111
     // Enable / disable simulcast support.
96 112
     // disableSimulcast: false,
97 113
 

+ 1
- 1
react/features/base/conference/constants.js Прегледај датотеку

@@ -42,7 +42,7 @@ export const JITSI_CONFERENCE_URL_KEY = Symbol('url');
42 42
  * @type {object}
43 43
  */
44 44
 export const VIDEO_QUALITY_LEVELS = {
45
-    HIGH: 720,
45
+    HIGH: 1080,
46 46
     STANDARD: 360,
47 47
     LOW: 180
48 48
 };

+ 2
- 0
react/features/base/tracks/functions.js Прегледај датотеку

@@ -45,6 +45,7 @@ export function createLocalTracksF(
45 45
     }
46 46
 
47 47
     const {
48
+        constraints,
48 49
         firefox_fake_device, // eslint-disable-line camelcase
49 50
         resolution
50 51
     } = store.getState()['features/base/config'];
@@ -53,6 +54,7 @@ export function createLocalTracksF(
53 54
         JitsiMeetJS.createLocalTracks(
54 55
             {
55 56
                 cameraDeviceId,
57
+                constraints,
56 58
                 desktopSharingExtensionExternalInstallation:
57 59
                     options.desktopSharingExtensionExternalInstallation,
58 60
                 desktopSharingSources: options.desktopSharingSources,

Loading…
Откажи
Сачувај