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

20 lines
673 B
JavaScript
Raw Normal View History

// @flow
import ScreenshotCaptureEffect from './ScreenshotCaptureEffect';
import { toState } from '../../base/redux';
/**
* 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)));
}