fix(screenshot-capture): Impl screenshot capture in multi-stream mode.
This commit is contained in:
parent
7e7d3c0cc7
commit
5505f01cd9
|
@ -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.
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export * from './actions';
|
||||
export * from './functions';
|
||||
|
|
Loading…
Reference in New Issue