rn,flags: add ability to override resolution using a flag
Also, use the configured resolution to set it as the max received frame size.
This commit is contained in:
parent
8d1bde3cb1
commit
7d513738d2
|
@ -41,6 +41,7 @@ import '../subtitles/middleware';
|
||||||
import '../toolbox/middleware';
|
import '../toolbox/middleware';
|
||||||
import '../transcribing/middleware';
|
import '../transcribing/middleware';
|
||||||
import '../video-layout/middleware';
|
import '../video-layout/middleware';
|
||||||
|
import '../video-quality/middleware';
|
||||||
import '../videosipgw/middleware';
|
import '../videosipgw/middleware';
|
||||||
|
|
||||||
import './middleware';
|
import './middleware';
|
||||||
|
|
|
@ -460,7 +460,10 @@ function _sendTones({ getState }, next, action) {
|
||||||
*/
|
*/
|
||||||
function _setReceiverVideoConstraint(conference, preferred, max) {
|
function _setReceiverVideoConstraint(conference, preferred, max) {
|
||||||
if (conference) {
|
if (conference) {
|
||||||
conference.setReceiverVideoConstraint(Math.min(preferred, max));
|
const value = Math.min(preferred, max);
|
||||||
|
|
||||||
|
conference.setReceiverVideoConstraint(value);
|
||||||
|
logger.info(`setReceiverVideoConstraint: ${value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import { jitsiLocalStorage } from 'js-utils';
|
import { jitsiLocalStorage } from 'js-utils';
|
||||||
|
|
||||||
import { APP_WILL_MOUNT } from '../app';
|
import { APP_WILL_MOUNT } from '../app';
|
||||||
|
import { getFeatureFlag } from '../flags/functions';
|
||||||
import { addKnownDomains } from '../known-domains';
|
import { addKnownDomains } from '../known-domains';
|
||||||
import { MiddlewareRegistry } from '../redux';
|
import { MiddlewareRegistry } from '../redux';
|
||||||
import { parseURIString } from '../util';
|
import { parseURIString } from '../util';
|
||||||
|
@ -107,6 +108,12 @@ function _setConfig({ dispatch, getState }, next, action) {
|
||||||
config.p2p = { enabled: !settings.disableP2P };
|
config.p2p = { enabled: !settings.disableP2P };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resolutionFlag = getFeatureFlag(state, 'resolution');
|
||||||
|
|
||||||
|
if (typeof resolutionFlag !== 'undefined') {
|
||||||
|
config.resolution = resolutionFlag;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: _UPDATE_CONFIG,
|
type: _UPDATE_CONFIG,
|
||||||
config
|
config
|
||||||
|
|
|
@ -81,6 +81,13 @@ export const RAISE_HAND_ENABLED = 'raise-hand.enabled';
|
||||||
*/
|
*/
|
||||||
export const RECORDING_ENABLED = 'recording.enabled';
|
export const RECORDING_ENABLED = 'recording.enabled';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag indicating the local and (maximum) remote video resolution. Overrides
|
||||||
|
* the server configuration.
|
||||||
|
* Default: (unset).
|
||||||
|
*/
|
||||||
|
export const RESOLUTION = 'resolution';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag indicating if server URL change is enabled.
|
* Flag indicating if server URL change is enabled.
|
||||||
* Default: enabled (true)
|
* Default: enabled (true)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
VIDEO_QUALITY_LEVELS,
|
VIDEO_QUALITY_LEVELS,
|
||||||
conferenceLeft,
|
conferenceLeft,
|
||||||
getCurrentConference,
|
getCurrentConference,
|
||||||
setPreferredVideoQuality
|
setMaxReceiverVideoQuality
|
||||||
} from '../base/conference';
|
} from '../base/conference';
|
||||||
import { hideDialog, isDialogOpen } from '../base/dialog';
|
import { hideDialog, isDialogOpen } from '../base/dialog';
|
||||||
import { setActiveModalId } from '../base/modal';
|
import { setActiveModalId } from '../base/modal';
|
||||||
|
@ -33,7 +33,7 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
dispatch(setFilmstripEnabled(!reducedUI));
|
dispatch(setFilmstripEnabled(!reducedUI));
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
setPreferredVideoQuality(
|
setMaxReceiverVideoQuality(
|
||||||
reducedUI
|
reducedUI
|
||||||
? VIDEO_QUALITY_LEVELS.LOW
|
? VIDEO_QUALITY_LEVELS.LOW
|
||||||
: VIDEO_QUALITY_LEVELS.HIGH));
|
: VIDEO_QUALITY_LEVELS.HIGH));
|
||||||
|
|
|
@ -32,8 +32,7 @@ StateListenerRegistry.register(
|
||||||
dispatch(selectParticipant());
|
dispatch(selectParticipant());
|
||||||
|
|
||||||
if (!displayTileView) {
|
if (!displayTileView) {
|
||||||
dispatch(
|
dispatch(setMaxReceiverVideoQuality(VIDEO_QUALITY_LEVELS.HIGH));
|
||||||
setMaxReceiverVideoQuality(VIDEO_QUALITY_LEVELS.HIGH));
|
|
||||||
|
|
||||||
if (_getAutoPinSetting()) {
|
if (_getAutoPinSetting()) {
|
||||||
_updateAutoPinnedParticipant(store);
|
_updateAutoPinnedParticipant(store);
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
|
||||||
|
import { setPreferredVideoQuality } from '../base/conference/actions';
|
||||||
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
|
|
||||||
|
import logger from './logger';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements the middleware of the feature video-quality.
|
||||||
|
*
|
||||||
|
* @param {Store} store - The redux store.
|
||||||
|
* @returns {Function}
|
||||||
|
*/
|
||||||
|
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
|
const result = next(action);
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
case CONFERENCE_JOINED: {
|
||||||
|
if (navigator.product === 'ReactNative') {
|
||||||
|
const { resolution } = getState()['features/base/config'];
|
||||||
|
|
||||||
|
if (typeof resolution !== 'undefined') {
|
||||||
|
dispatch(setPreferredVideoQuality(Number.parseInt(resolution, 10)));
|
||||||
|
logger.info(`Configured preferred receiver video frame height to: ${resolution}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
});
|
Loading…
Reference in New Issue