You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.js 750B

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