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

middleware.js 909B

12345678910111213141516171819202122232425262728293031323334
  1. /* global APP */
  2. import UIEvents from '../../../../service/UI/UIEvents';
  3. import { MiddlewareRegistry } from '../redux';
  4. import {
  5. SET_AUDIO_INPUT_DEVICE,
  6. SET_AUDIO_OUTPUT_DEVICE,
  7. SET_VIDEO_INPUT_DEVICE
  8. } from './actionTypes';
  9. /**
  10. * Implements the middleware of the feature base/devices.
  11. *
  12. * @param {Store} store - Redux store.
  13. * @returns {Function}
  14. */
  15. // eslint-disable-next-line no-unused-vars
  16. MiddlewareRegistry.register(store => next => action => {
  17. switch (action.type) {
  18. case SET_AUDIO_INPUT_DEVICE:
  19. APP.UI.emitEvent(UIEvents.AUDIO_DEVICE_CHANGED, action.deviceId);
  20. break;
  21. case SET_AUDIO_OUTPUT_DEVICE:
  22. APP.UI.emitEvent(UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED, action.deviceId);
  23. break;
  24. case SET_VIDEO_INPUT_DEVICE:
  25. APP.UI.emitEvent(UIEvents.VIDEO_DEVICE_CHANGED, action.deviceId);
  26. break;
  27. }
  28. return next(action);
  29. });