|
@@ -16,7 +16,7 @@ import {
|
16
|
16
|
export default class JitsiStreamBackgroundEffect {
|
17
|
17
|
_model: Object;
|
18
|
18
|
_options: Object;
|
19
|
|
- _stream: Object;
|
|
19
|
+ _screenSharing: Object;
|
20
|
20
|
_segmentationPixelCount: number;
|
21
|
21
|
_inputVideoElement: HTMLVideoElement;
|
22
|
22
|
_onMaskFrameTimer: Function;
|
|
@@ -43,17 +43,17 @@ export default class JitsiStreamBackgroundEffect {
|
43
|
43
|
*/
|
44
|
44
|
constructor(model: Object, options: Object, screenSharing: Object) {
|
45
|
45
|
this._options = options;
|
46
|
|
- this._stream = screenSharing;
|
|
46
|
+ this._screenSharing = screenSharing;
|
47
|
47
|
|
48
|
48
|
if (this._options.virtualBackground.backgroundType === 'image') {
|
49
|
49
|
this._virtualImage = document.createElement('img');
|
50
|
50
|
this._virtualImage.crossOrigin = 'anonymous';
|
51
|
51
|
this._virtualImage.src = this._options.virtualBackground.virtualSource;
|
52
|
52
|
}
|
53
|
|
- if (this._options.virtualBackground.backgroundType === 'desktop-share' && this._stream) {
|
|
53
|
+ if (this._options.virtualBackground.backgroundType === 'desktop-share' && this._screenSharing) {
|
54
|
54
|
this._virtualVideo = document.createElement('video');
|
55
|
55
|
this._virtualVideo.autoplay = true;
|
56
|
|
- this._virtualVideo.srcObject = this._stream.stream;
|
|
56
|
+ this._virtualVideo.srcObject = this._screenSharing.stream;
|
57
|
57
|
}
|
58
|
58
|
this._model = model;
|
59
|
59
|
this._options = options;
|
|
@@ -252,7 +252,7 @@ export default class JitsiStreamBackgroundEffect {
|
252
|
252
|
this._inputVideoElement.height = parseInt(height, 10);
|
253
|
253
|
this._inputVideoElement.autoplay = true;
|
254
|
254
|
this._inputVideoElement.srcObject = stream;
|
255
|
|
- this._stream && this._stream.on(
|
|
255
|
+ this._screenSharing && this._screenSharing.on(
|
256
|
256
|
JitsiTrackEvents.LOCAL_TRACK_STOPPED,
|
257
|
257
|
() => {
|
258
|
258
|
this._options.virtualBackground.enabled = false;
|