You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.js 972B

123456789101112131415161718192021222324252627282930313233
  1. // @flow
  2. import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
  3. import { setPreferredVideoQuality } from '../base/conference/actions';
  4. import { MiddlewareRegistry } from '../base/redux';
  5. import logger from './logger';
  6. /**
  7. * Implements the middleware of the feature video-quality.
  8. *
  9. * @param {Store} store - The redux store.
  10. * @returns {Function}
  11. */
  12. MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
  13. const result = next(action);
  14. switch (action.type) {
  15. case CONFERENCE_JOINED: {
  16. if (navigator.product === 'ReactNative') {
  17. const { resolution } = getState()['features/base/config'];
  18. if (typeof resolution !== 'undefined') {
  19. dispatch(setPreferredVideoQuality(Number.parseInt(resolution, 10)));
  20. logger.info(`Configured preferred receiver video frame height to: ${resolution}`);
  21. }
  22. }
  23. break;
  24. }
  25. }
  26. return result;
  27. });