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

middleware.web.ts 736B

123456789101112131415161718192021222324252627282930
  1. import MiddlewareRegistry from '../redux/MiddlewareRegistry';
  2. import { CONNECTION_WILL_CONNECT } from './actionTypes';
  3. /**
  4. * The feature announced so we can distinguish jibri participants.
  5. *
  6. * @type {string}
  7. */
  8. export const DISCO_JIBRI_FEATURE = 'http://jitsi.org/protocol/jibri';
  9. MiddlewareRegistry.register(({ getState }) => next => action => {
  10. switch (action.type) {
  11. case CONNECTION_WILL_CONNECT: {
  12. const { connection } = action;
  13. const { iAmRecorder } = getState()['features/base/config'];
  14. if (iAmRecorder) {
  15. connection.addFeature(DISCO_JIBRI_FEATURE);
  16. }
  17. // @ts-ignore
  18. APP.connection = connection;
  19. break;
  20. }
  21. }
  22. return next(action);
  23. });