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

middleware.js 990B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* @flow */
  2. import { CONFERENCE_WILL_JOIN } from '../base/conference';
  3. import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
  4. import { MiddlewareRegistry } from '../base/redux';
  5. import { updateRecordingSessionData } from './actions';
  6. /**
  7. * The redux middleware to handle the recorder updates in a React way.
  8. *
  9. * @param {Store} store - The redux store.
  10. * @returns {Function}
  11. */
  12. MiddlewareRegistry.register(({ dispatch }) => next => action => {
  13. const result = next(action);
  14. switch (action.type) {
  15. case CONFERENCE_WILL_JOIN: {
  16. const { conference } = action;
  17. conference.on(
  18. JitsiConferenceEvents.RECORDER_STATE_CHANGED,
  19. recorderSession => {
  20. if (recorderSession && recorderSession.getID()) {
  21. dispatch(
  22. updateRecordingSessionData(recorderSession));
  23. return;
  24. }
  25. });
  26. break;
  27. }
  28. }
  29. return result;
  30. });