feat(virtual-background): Desktop share as virtual background

This commit is contained in:
tudordan7
2021-05-19 12:57:11 +03:00
committed by Jaya Allamsetty
parent 4872ce83ba
commit f5dd848daf
4 changed files with 48 additions and 15 deletions

View File

@@ -9,8 +9,9 @@ import { connect, equals } from '../../base/redux';
import { getCurrentCameraDeviceId } from '../../base/settings';
import { createLocalTracksF } from '../../base/tracks/functions';
import { toggleBackgroundEffect } from '../actions';
import { localTrackStopped } from '../functions';
const videoClassName = 'virtual-background-preview-video flipVideoX';
const videoClassName = 'video-preview-video';
/**
* The type of the React {@code PureComponent} props of {@link VirtualBackgroundPreview}.
@@ -206,8 +207,14 @@ class VirtualBackgroundPreview extends PureComponent<Props, State> {
this._setTracks();
}
if (!equals(this.props.options, prevProps.options)) {
if (prevProps.options.backgroundType === 'desktop-share') {
prevProps.options.url.dispose();
}
this._applyBackgroundEffect();
}
if (this.props.options.url?.videoType === 'desktop') {
localTrackStopped(this.props.dispatch, this.props.options.url, this.state.jitsiTrack);
}
}
/**