|
@@ -50,13 +50,9 @@ export default class JitsiStreamBackgroundEffect {
|
50
|
50
|
this._virtualImage.src = this._options.virtualBackground.virtualSource;
|
51
|
51
|
}
|
52
|
52
|
if (this._options.virtualBackground.backgroundType === VIRTUAL_BACKGROUND_TYPE.DESKTOP_SHARE) {
|
53
|
|
- const desktopShareTrack = this._options?.virtualBackground?.virtualSource?.track;
|
54
|
|
-
|
55
|
53
|
this._virtualVideo = document.createElement('video');
|
56
|
54
|
this._virtualVideo.autoplay = true;
|
57
|
55
|
this._virtualVideo.srcObject = this._options?.virtualBackground?.virtualSource?.stream;
|
58
|
|
- this._desktopShareDimensions = desktopShareTrack.getSettings ? desktopShareTrack.getSettings()
|
59
|
|
- : desktopShareTrack.getConstraints();
|
60
|
56
|
}
|
61
|
57
|
this._model = model;
|
62
|
58
|
this._segmentationPixelCount = this._options.width * this._options.height;
|
|
@@ -176,6 +172,12 @@ export default class JitsiStreamBackgroundEffect {
|
176
|
172
|
* @returns {void}
|
177
|
173
|
*/
|
178
|
174
|
_renderMask() {
|
|
175
|
+ const desktopShareTrack = this._options?.virtualBackground?.virtualSource?.track;
|
|
176
|
+
|
|
177
|
+ if (desktopShareTrack) {
|
|
178
|
+ this._desktopShareDimensions = desktopShareTrack.getSettings ? desktopShareTrack.getSettings()
|
|
179
|
+ : desktopShareTrack.getConstraints();
|
|
180
|
+ }
|
179
|
181
|
this.resizeSource();
|
180
|
182
|
this.runInference();
|
181
|
183
|
this.runPostProcessing();
|