Przeglądaj źródła

Always uses current video type to search for container that will handle it. Renames video container type to camera, to match the type ot the tracks. Add the same container to be used and for tracks with type of desktop.

j8
damencho 9 lat temu
rodzic
commit
9e0b1beed5

+ 12
- 7
modules/UI/videolayout/LargeVideo.js Wyświetl plik

150
     return { horizontalIndent, verticalIndent };
150
     return { horizontalIndent, verticalIndent };
151
 }
151
 }
152
 
152
 
153
-export const VideoContainerType = "video";
153
+export const VideoContainerType = "camera";
154
 
154
 
155
 /**
155
 /**
156
  * Container for user video.
156
  * Container for user video.
357
         this.state = VideoContainerType;
357
         this.state = VideoContainerType;
358
         this.videoContainer = new VideoContainer(() => this.resizeContainer(VideoContainerType));
358
         this.videoContainer = new VideoContainer(() => this.resizeContainer(VideoContainerType));
359
         this.addContainer(VideoContainerType, this.videoContainer);
359
         this.addContainer(VideoContainerType, this.videoContainer);
360
+        // use the same video container to handle and desktop tracks
361
+        this.addContainer("desktop", this.videoContainer);
360
 
362
 
361
         this.width = 0;
363
         this.width = 0;
362
         this.height = 0;
364
         this.height = 0;
413
     }
415
     }
414
 
416
 
415
     get id () {
417
     get id () {
416
-        return this.videoContainer.id;
418
+        let container = this.getContainer(this.state);
419
+        return container.id;
417
     }
420
     }
418
 
421
 
419
     scheduleLargeVideoUpdate () {
422
     scheduleLargeVideoUpdate () {
430
             this.newStreamData = null;
433
             this.newStreamData = null;
431
 
434
 
432
             console.info("hover in %s", id);
435
             console.info("hover in %s", id);
433
-            this.state = VideoContainerType;
434
-            this.videoContainer.setStream(stream, videoType);
436
+            this.state = videoType;
437
+            let container = this.getContainer(this.state);
438
+            container.setStream(stream, videoType);
435
 
439
 
436
             // change the avatar url on large
440
             // change the avatar url on large
437
             this.updateAvatar(Avatar.getAvatarUrl(id));
441
             this.updateAvatar(Avatar.getAvatarUrl(id));
439
             let isVideoMuted = stream ? stream.isMuted() : true;
443
             let isVideoMuted = stream ? stream.isMuted() : true;
440
 
444
 
441
             // show the avatar on large if needed
445
             // show the avatar on large if needed
442
-            this.videoContainer.showAvatar(isVideoMuted);
446
+            container.showAvatar(isVideoMuted);
443
 
447
 
444
             let promise;
448
             let promise;
445
 
449
 
449
                 this.showWatermark(true);
453
                 this.showWatermark(true);
450
                 promise = Promise.resolve();
454
                 promise = Promise.resolve();
451
             } else {
455
             } else {
452
-                promise = this.videoContainer.show();
456
+                promise = container.show();
453
             }
457
             }
454
 
458
 
455
             // resolve updateLargeVideo promise after everything is done
459
             // resolve updateLargeVideo promise after everything is done
529
      * @param enable <tt>true</tt> to enable, <tt>false</tt> to disable
533
      * @param enable <tt>true</tt> to enable, <tt>false</tt> to disable
530
      */
534
      */
531
     enableVideoProblemFilter (enable) {
535
     enableVideoProblemFilter (enable) {
532
-        this.videoContainer.$video.toggleClass("videoProblemFilter", enable);
536
+        let container = this.getContainer(this.state);
537
+        container.$video.toggleClass("videoProblemFilter", enable);
533
     }
538
     }
534
 
539
 
535
     /**
540
     /**

+ 5
- 4
modules/UI/videolayout/VideoLayout.js Wyświetl plik

801
      * @param forceUpdate indicates that hidden thumbnails will be shown
801
      * @param forceUpdate indicates that hidden thumbnails will be shown
802
      * @param completeFunction a function to be called when the video area is
802
      * @param completeFunction a function to be called when the video area is
803
      * resized.
803
      * resized.
804
-     */resizeVideoArea (isSideBarVisible,
805
-                        forceUpdate = false,
806
-                        animate = false,
807
-                        completeFunction = null) {
804
+     */
805
+    resizeVideoArea (isSideBarVisible,
806
+                    forceUpdate = false,
807
+                    animate = false,
808
+                    completeFunction = null) {
808
 
809
 
809
         if (largeVideo) {
810
         if (largeVideo) {
810
             largeVideo.updateContainerSize(isSideBarVisible);
811
             largeVideo.updateContainerSize(isSideBarVisible);

Ładowanie…
Anuluj
Zapisz