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

middleware.native.js 910B

123456789101112131415161718192021222324252627282930313233
  1. // @flow
  2. import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../base/participants';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. import { CLIENT_RESIZED, SET_ASPECT_RATIO } from '../base/responsive-ui';
  5. import { setTileViewDimensions } from './actions';
  6. import { updateRemoteParticipants, updateRemoteParticipantsOnLeave } from './functions';
  7. import './subscriber';
  8. /**
  9. * The middleware of the feature Filmstrip.
  10. */
  11. MiddlewareRegistry.register(store => next => action => {
  12. if (action.type === PARTICIPANT_LEFT) {
  13. updateRemoteParticipantsOnLeave(store, action.participant?.id);
  14. }
  15. const result = next(action);
  16. switch (action.type) {
  17. case CLIENT_RESIZED:
  18. case SET_ASPECT_RATIO:
  19. store.dispatch(setTileViewDimensions());
  20. break;
  21. case PARTICIPANT_JOINED: {
  22. updateRemoteParticipants(store);
  23. break;
  24. }
  25. }
  26. return result;
  27. });