jiti-meet/react/features/stream-effects/screenshot-capture/index.js

21 lines
674 B
JavaScript
Raw Normal View History

// @flow
import { toState } from '../../base/redux';
2020-05-20 10:57:03 +00:00
import ScreenshotCaptureEffect from './ScreenshotCaptureEffect';
/**
* Creates a new instance of ScreenshotCaptureEffect.
*
* @param {Object | Function} stateful - The redux store, state, or
* {@code getState} function.
* @returns {Promise<ScreenshotCaptureEffect>}
*/
export function createScreenshotCaptureEffect(stateful: Object | Function) {
if (!MediaStreamTrack.prototype.getSettings && !MediaStreamTrack.prototype.getConstraints) {
return Promise.reject(new Error('ScreenshotCaptureEffect not supported!'));
}
return Promise.resolve(new ScreenshotCaptureEffect(toState(stateful)));
}