您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

middleware.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // @flow
  2. import {
  3. CONFERENCE_JOINED,
  4. VIDEO_QUALITY_LEVELS,
  5. setReceiveVideoQuality
  6. } from '../base/conference';
  7. import { SET_REDUCED_UI } from '../base/responsive-ui';
  8. import { MiddlewareRegistry } from '../base/redux';
  9. import { setFilmstripEnabled } from '../filmstrip';
  10. import { setToolboxEnabled } from '../toolbox';
  11. MiddlewareRegistry.register(store => next => action => {
  12. const result = next(action);
  13. switch (action.type) {
  14. case CONFERENCE_JOINED:
  15. case SET_REDUCED_UI: {
  16. const { dispatch, getState } = store;
  17. const state = getState();
  18. const { audioOnly } = state['features/base/conference'];
  19. const { reducedUI } = state['features/base/responsive-ui'];
  20. dispatch(setToolboxEnabled(!reducedUI));
  21. dispatch(setFilmstripEnabled(!reducedUI));
  22. // XXX: Currently setting the received video quality will disable
  23. // audio-only mode if engaged, that's why we check for it here.
  24. audioOnly
  25. || dispatch(
  26. setReceiveVideoQuality(
  27. reducedUI
  28. ? VIDEO_QUALITY_LEVELS.LOW
  29. : VIDEO_QUALITY_LEVELS.HIGH));
  30. break;
  31. }
  32. }
  33. return result;
  34. });