Преглед на файлове

fix(ss): resize for remote videos

j8
hristoterezov преди 8 години
родител
ревизия
0e92e48376
променени са 2 файла, в които са добавени 20 реда и са изтрити 4 реда
  1. 2
    0
      modules/UI/videolayout/LargeVideoManager.js
  2. 18
    4
      modules/UI/videolayout/VideoContainer.js

+ 2
- 0
modules/UI/videolayout/LargeVideoManager.js Целия файл

23
         this.eventEmitter = emitter;
23
         this.eventEmitter = emitter;
24
 
24
 
25
         this.state = VIDEO_CONTAINER_TYPE;
25
         this.state = VIDEO_CONTAINER_TYPE;
26
+        // FIXME: We are passing resizeContainer as parameter which is calling
27
+        // Container.resize. Probably there's better way to implement this.
26
         this.videoContainer = new VideoContainer(
28
         this.videoContainer = new VideoContainer(
27
             () => this.resizeContainer(VIDEO_CONTAINER_TYPE), emitter);
29
             () => this.resizeContainer(VIDEO_CONTAINER_TYPE), emitter);
28
         this.addContainer(VIDEO_CONTAINER_TYPE, this.videoContainer);
30
         this.addContainer(VIDEO_CONTAINER_TYPE, this.videoContainer);

+ 18
- 4
modules/UI/videolayout/VideoContainer.js Целия файл

164
         return getStreamOwnerId(this.stream);
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
         super();
175
         super();
169
         this.stream = null;
176
         this.stream = null;
170
         this.videoType = null;
177
         this.videoType = null;
171
         this.localFlipX = true;
178
         this.localFlipX = true;
172
         this.emitter = emitter;
179
         this.emitter = emitter;
180
+        this.resizeContainer = resizeContainer;
173
 
181
 
174
         this.isVisible = false;
182
         this.isVisible = false;
175
 
183
 
199
         this.avatarHeight = $("#dominantSpeakerAvatar").height();
207
         this.avatarHeight = $("#dominantSpeakerAvatar").height();
200
 
208
 
201
         var onPlayCallback = function (event) {
209
         var onPlayCallback = function (event) {
202
-            if (typeof onPlay === 'function') {
203
-                onPlay(event);
210
+            if (typeof resizeContainer === 'function') {
211
+                resizeContainer(event);
204
             }
212
             }
205
             this.wasVideoRendered = true;
213
             this.wasVideoRendered = true;
206
         }.bind(this);
214
         }.bind(this);
336
      * @param {string} videoType video type
344
      * @param {string} videoType video type
337
      */
345
      */
338
     setStream (stream, videoType) {
346
     setStream (stream, videoType) {
339
-
340
         if (this.stream === stream) {
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
             return;
355
             return;
342
         } else {
356
         } else {
343
             // The stream has changed, so the image will be lost on detach
357
             // The stream has changed, so the image will be lost on detach

Loading…
Отказ
Запис