|
@@ -34,17 +34,13 @@ export function toggleScreenshotCaptureEffect(enabled: boolean) {
|
34
|
34
|
if (state['features/screenshot-capture'].capturesEnabled !== enabled) {
|
35
|
35
|
const { jitsiTrack } = getLocalVideoTrack(state['features/base/tracks']);
|
36
|
36
|
|
|
37
|
+ // Screenshot capture effect doesn't return a modified stream. Therefore, we don't have to
|
|
38
|
+ // switch the stream at the conference level, starting/stopping the effect will suffice here.
|
37
|
39
|
return createScreenshotCaptureEffect(state)
|
38
|
|
- .then(effect =>
|
39
|
|
- jitsiTrack.setEffect(enabled ? effect : undefined)
|
40
|
|
- .then(() => {
|
41
|
|
- dispatch(setScreenshotCapture(enabled));
|
42
|
|
- })
|
43
|
|
- .catch(() => {
|
44
|
|
- dispatch(setScreenshotCapture(!enabled));
|
45
|
|
- })
|
46
|
|
- )
|
47
|
|
- .catch(() => dispatch(setScreenshotCapture(false)));
|
|
40
|
+ .then(effect => {
|
|
41
|
+ enabled ? effect.startEffect(jitsiTrack.getOriginalStream()) : effect.stopEffect();
|
|
42
|
+ dispatch(setScreenshotCapture(enabled));
|
|
43
|
+ });
|
48
|
44
|
}
|
49
|
45
|
|
50
|
46
|
return Promise.resolve();
|