Browse Source

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 years ago
parent
commit
2d9ce2486e

+ 16
- 0
config.js View File

92
     // Sets the preferred resolution (height) for local video. Defaults to 720.
92
     // Sets the preferred resolution (height) for local video. Defaults to 720.
93
     // resolution: 720,
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
     // Enable / disable simulcast support.
111
     // Enable / disable simulcast support.
96
     // disableSimulcast: false,
112
     // disableSimulcast: false,
97
 
113
 

+ 1
- 1
react/features/base/conference/constants.js View File

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

+ 2
- 0
react/features/base/tracks/functions.js View File

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

Loading…
Cancel
Save