Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(screenshot-capture): Impl screenshot capture in multi-stream mode.

Jaya Allamsetty5505f01cd99c
diff --git a/react/features/base/conference/middleware.web.js b/react/features/base/conference/middleware.web.js
index 2b6da9fce3..5db1cc9d06 100644
--- a/react/features/base/conference/middleware.web.js
+++ b/react/features/base/conference/middleware.web.js
@@ -8,6 +8,7 @@ import {
setSkipPrejoinOnReload
} from '../../prejoin';
import { setScreenAudioShareState, setScreenshareAudioTrack } from '../../screen-share';
+import { isScreenshotCaptureEnabled, toggleScreenshotCaptureSummary } from '../../screenshot-capture';
import { AudioMixerEffect } from '../../stream-effects/audio-mixer/AudioMixerEffect';
import { setAudioOnly } from '../audio-only';
import { getMultipleVideoSendingSupportFeatureFlag } from '../config/functions.any';
@@ -165,6 +166,9 @@ async function _toggleScreenSharing({ enabled, audioOnly = false }, store) {
} else {
await dispatch(addLocalTrack(desktopVideoTrack));
}
+ if (isScreenshotCaptureEnabled(state, false, true)) {
+ dispatch(toggleScreenshotCaptureSummary(true));
+ }
}
// Apply the AudioMixer effect if there is a local audio track, add the desktop track to the conference
@@ -188,6 +192,8 @@ async function _toggleScreenSharing({ enabled, audioOnly = false }, store) {
} else {
const { desktopAudioTrack } = state['features/screen-share'];
+ dispatch(toggleScreenshotCaptureSummary(false));
+
// Mute the desktop track instead of removing it from the conference since we don't want the client to signal
// a source-remove to the remote peer for the screenshare track. Later when screenshare is enabled again, the
// same sender will be re-used without the need for signaling a new ssrc through source-add.
diff --git a/react/features/screenshot-capture/actions.js b/react/features/screenshot-capture/actions.js
index d38e124001..f0b7713200 100644
--- a/react/features/screenshot-capture/actions.js
+++ b/react/features/screenshot-capture/actions.js
@@ -1,7 +1,7 @@
// @flow
-import { getLocalVideoTrack } from '../../features/base/tracks';
-
+import { getLocalJitsiDesktopTrack, getLocalJitsiVideoTrack } from '../../features/base/tracks';
+import { getMultipleVideoSendingSupportFeatureFlag } from '../base/config';
import { SET_SCREENSHOT_CAPTURE } from './actionTypes';
import { createScreenshotCaptureSummary } from './functions';
@@ -46,12 +46,13 @@ export function toggleScreenshotCaptureSummary(enabled: boolean) {
if (enabled) {
try {
- const { jitsiTrack } = getLocalVideoTrack(state['features/base/tracks']);
+ const jitsiTrack = getMultipleVideoSendingSupportFeatureFlag(state)
+ ? getLocalJitsiDesktopTrack(state)
+ : getLocalJitsiVideoTrack(state);
await screenshotSummary.start(jitsiTrack);
dispatch(setScreenshotCapture(enabled));
} catch {
-
// Handle promise rejection from {@code start} due to stream type not being desktop.
logger.error('Unsupported stream type.');
}
diff --git a/react/features/screenshot-capture/index.js b/react/features/screenshot-capture/index.js
index 485f1b10af..abee882188 100644
--- a/react/features/screenshot-capture/index.js
+++ b/react/features/screenshot-capture/index.js
@@ -1 +1,2 @@
export * from './actions';
+export * from './functions';