mirror of https://github.com/jitsi/jitsi-meet
parent
b3f16926d4
commit
a48aa2b999
@ -0,0 +1,31 @@ |
||||
// @flow
|
||||
|
||||
import { VIDEO_QUALITY_LEVELS } from '../base/conference'; |
||||
import logger from './logger'; |
||||
|
||||
import type { Dispatch } from 'redux'; |
||||
|
||||
/** |
||||
* Sets the maximum video size the local participant should send and receive from |
||||
* remote participants. |
||||
* |
||||
* @param {number} frameHeight - The user preferred max frame height for send and |
||||
* receive video. |
||||
* @returns {void} |
||||
*/ |
||||
export function setVideoQuality(frameHeight: number) { |
||||
return (dispatch: Dispatch<any>, getState: Function) => { |
||||
const { conference, maxReceiverVideoQuality } = getState()['features/base/conference']; |
||||
|
||||
if (frameHeight < VIDEO_QUALITY_LEVELS.LOW) { |
||||
logger.error(`Invalid frame height for video quality - ${frameHeight}`); |
||||
|
||||
return; |
||||
} |
||||
conference.setReceiverVideoConstraint(Math.min(frameHeight, maxReceiverVideoQuality)); |
||||
conference.setSenderVideoConstraint(Math.min(frameHeight, VIDEO_QUALITY_LEVELS.HIGH)) |
||||
.catch(err => { |
||||
logger.error(`Set video quality command failed - ${err}`); |
||||
}); |
||||
}; |
||||
} |
@ -1 +1,2 @@ |
||||
export * from './components'; |
||||
export * from './actions'; |
||||
|
Loading…
Reference in new issue