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

This commit is contained in:
Jaya Allamsetty 2022-07-29 16:23:46 -04:00
parent 7e7d3c0cc7
commit 5505f01cd9
3 changed files with 12 additions and 4 deletions

View File

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

View File

@ -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.');
}

View File

@ -1 +1,2 @@
export * from './actions';
export * from './functions';