From 2d9ce2486e7a263e9d0b8bc76cd6847fa7f6763b Mon Sep 17 00:00:00 2001 From: virtuacoplenny Date: Tue, 31 Oct 2017 17:08:07 -0700 Subject: [PATCH] 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. --- config.js | 16 ++++++++++++++++ react/features/base/conference/constants.js | 2 +- react/features/base/tracks/functions.js | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 29c0dab90..228a483fb 100644 --- a/config.js +++ b/config.js @@ -92,6 +92,22 @@ var config = { // Sets the preferred resolution (height) for local video. Defaults to 720. // resolution: 720, + // w3c spec-compliant video constraints to use for video capture. Currently + // used by browsers that return true from lib-jitsi-meet's + // RTCBrowserType#usesNewGumFlow. The constraints are independency from + // this config's resolution value. Defaults to requesting an ideal aspect + // ratio of 16:9 with an ideal resolution of 1080p. + // constraints: { + // video: { + // aspectRatio: 16 / 9, + // height: { + // ideal: 1080, + // max: 1080, + // min: 240 + // } + // } + // }, + // Enable / disable simulcast support. // disableSimulcast: false, diff --git a/react/features/base/conference/constants.js b/react/features/base/conference/constants.js index 7b515efc6..7e7d34c0c 100644 --- a/react/features/base/conference/constants.js +++ b/react/features/base/conference/constants.js @@ -42,7 +42,7 @@ export const JITSI_CONFERENCE_URL_KEY = Symbol('url'); * @type {object} */ export const VIDEO_QUALITY_LEVELS = { - HIGH: 720, + HIGH: 1080, STANDARD: 360, LOW: 180 }; diff --git a/react/features/base/tracks/functions.js b/react/features/base/tracks/functions.js index 6e13bdcc2..add0f5b52 100644 --- a/react/features/base/tracks/functions.js +++ b/react/features/base/tracks/functions.js @@ -45,6 +45,7 @@ export function createLocalTracksF( } const { + constraints, firefox_fake_device, // eslint-disable-line camelcase resolution } = store.getState()['features/base/config']; @@ -53,6 +54,7 @@ export function createLocalTracksF( JitsiMeetJS.createLocalTracks( { cameraDeviceId, + constraints, desktopSharingExtensionExternalInstallation: options.desktopSharingExtensionExternalInstallation, desktopSharingSources: options.desktopSharingSources,