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.

loadEffects.web.js 874B

123456789101112131415161718192021222324252627
  1. // @flow
  2. import { createVirtualBackgroundEffect } from '../../stream-effects/virtual-background';
  3. import logger from './logger';
  4. /**
  5. * Loads the enabled stream effects.
  6. *
  7. * @param {Object} store - The Redux store.
  8. * @returns {Promsie} - A Promise which resolves when all effects are created.
  9. */
  10. export default function loadEffects(store: Object): Promise<any> {
  11. const state = store.getState();
  12. const virtualBackground = state['features/virtual-background'];
  13. const backgroundPromise = virtualBackground.backgroundEffectEnabled
  14. ? createVirtualBackgroundEffect(virtualBackground)
  15. .catch(error => {
  16. logger.error('Failed to obtain the background effect instance with error: ', error);
  17. return Promise.resolve();
  18. })
  19. : Promise.resolve();
  20. return Promise.all([ backgroundPromise ]);
  21. }