|
@@ -164,12 +164,20 @@ export class VideoContainer extends LargeContainer {
|
164
|
164
|
return getStreamOwnerId(this.stream);
|
165
|
165
|
}
|
166
|
166
|
|
167
|
|
- constructor (onPlay, emitter) {
|
|
167
|
+ /**
|
|
168
|
+ * Creates new VideoContainer instance.
|
|
169
|
+ * @param resizeContainer {Function} function that takes care of the size
|
|
170
|
+ * of the video container.
|
|
171
|
+ * @param emitter {EventEmitter} the event emitter that will be used by
|
|
172
|
+ * this instance.
|
|
173
|
+ */
|
|
174
|
+ constructor (resizeContainer, emitter) {
|
168
|
175
|
super();
|
169
|
176
|
this.stream = null;
|
170
|
177
|
this.videoType = null;
|
171
|
178
|
this.localFlipX = true;
|
172
|
179
|
this.emitter = emitter;
|
|
180
|
+ this.resizeContainer = resizeContainer;
|
173
|
181
|
|
174
|
182
|
this.isVisible = false;
|
175
|
183
|
|
|
@@ -199,8 +207,8 @@ export class VideoContainer extends LargeContainer {
|
199
|
207
|
this.avatarHeight = $("#dominantSpeakerAvatar").height();
|
200
|
208
|
|
201
|
209
|
var onPlayCallback = function (event) {
|
202
|
|
- if (typeof onPlay === 'function') {
|
203
|
|
- onPlay(event);
|
|
210
|
+ if (typeof resizeContainer === 'function') {
|
|
211
|
+ resizeContainer(event);
|
204
|
212
|
}
|
205
|
213
|
this.wasVideoRendered = true;
|
206
|
214
|
}.bind(this);
|
|
@@ -336,8 +344,14 @@ export class VideoContainer extends LargeContainer {
|
336
|
344
|
* @param {string} videoType video type
|
337
|
345
|
*/
|
338
|
346
|
setStream (stream, videoType) {
|
339
|
|
-
|
340
|
347
|
if (this.stream === stream) {
|
|
348
|
+ // Handles the use case for the remote participants when the
|
|
349
|
+ // videoType is received with delay after turning on/off the
|
|
350
|
+ // desktop sharing.
|
|
351
|
+ if(this.videoType !== videoType) {
|
|
352
|
+ this.videoType = videoType;
|
|
353
|
+ this.resizeContainer();
|
|
354
|
+ }
|
341
|
355
|
return;
|
342
|
356
|
} else {
|
343
|
357
|
// The stream has changed, so the image will be lost on detach
|