| 123456789101112131415161718192021222324252627282930313233 |
- // @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;
- });
|