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

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. }