fix(ifarme-api): set-video-quality to use redux.

This commit is contained in:
Hristo Terezov 2020-09-01 15:48:14 -05:00
parent b02d96231c
commit 43f36c8cfd
1 changed files with 3 additions and 8 deletions

View File

@ -51,18 +51,13 @@ export function setMaxReceiverVideoQuality(maxReceiverVideoQuality: number) {
* @returns {void} * @returns {void}
*/ */
export function setVideoQuality(frameHeight: number) { export function setVideoQuality(frameHeight: number) {
return (dispatch: Dispatch<any>, getState: Function) => { return (dispatch: Dispatch<any>) => {
const { conference, maxReceiverVideoQuality } = getState()['features/base/conference'];
if (frameHeight < VIDEO_QUALITY_LEVELS.LOW) { if (frameHeight < VIDEO_QUALITY_LEVELS.LOW) {
logger.error(`Invalid frame height for video quality - ${frameHeight}`); logger.error(`Invalid frame height for video quality - ${frameHeight}`);
return; return;
} }
conference.setReceiverVideoConstraint(Math.min(frameHeight, maxReceiverVideoQuality));
conference.setSenderVideoConstraint(Math.min(frameHeight, VIDEO_QUALITY_LEVELS.HIGH)) dispatch(setPreferredVideoQuality(Math.min(frameHeight, VIDEO_QUALITY_LEVELS.HIGH)));
.catch(err => {
logger.error(`Set video quality command failed - ${err}`);
});
}; };
} }