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.web.ts 598B

1234567891011121314151617181920212223
  1. import { getAudioOutputDeviceId } from '../devices/functions.web';
  2. import MiddlewareRegistry from '../redux/MiddlewareRegistry';
  3. import { _ADD_AUDIO_ELEMENT } from './actionTypes';
  4. import './middleware.any';
  5. /**
  6. * Implements the entry point of the middleware of the feature base/sounds.
  7. *
  8. * @param {Store} store - The redux store.
  9. * @returns {Function}
  10. */
  11. MiddlewareRegistry.register(_store => next => action => {
  12. switch (action.type) {
  13. case _ADD_AUDIO_ELEMENT:
  14. action.audioElement?.setSinkId?.(getAudioOutputDeviceId());
  15. break;
  16. }
  17. return next(action);
  18. });