Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
9e0b1beed5

+ 12
- 7
modules/UI/videolayout/LargeVideo.js Parādīt failu

@@ -150,7 +150,7 @@ function getDesktopVideoPosition(videoWidth,
150 150
     return { horizontalIndent, verticalIndent };
151 151
 }
152 152
 
153
-export const VideoContainerType = "video";
153
+export const VideoContainerType = "camera";
154 154
 
155 155
 /**
156 156
  * Container for user video.
@@ -357,6 +357,8 @@ export default class LargeVideoManager {
357 357
         this.state = VideoContainerType;
358 358
         this.videoContainer = new VideoContainer(() => this.resizeContainer(VideoContainerType));
359 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 363
         this.width = 0;
362 364
         this.height = 0;
@@ -413,7 +415,8 @@ export default class LargeVideoManager {
413 415
     }
414 416
 
415 417
     get id () {
416
-        return this.videoContainer.id;
418
+        let container = this.getContainer(this.state);
419
+        return container.id;
417 420
     }
418 421
 
419 422
     scheduleLargeVideoUpdate () {
@@ -430,8 +433,9 @@ export default class LargeVideoManager {
430 433
             this.newStreamData = null;
431 434
 
432 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 440
             // change the avatar url on large
437 441
             this.updateAvatar(Avatar.getAvatarUrl(id));
@@ -439,7 +443,7 @@ export default class LargeVideoManager {
439 443
             let isVideoMuted = stream ? stream.isMuted() : true;
440 444
 
441 445
             // show the avatar on large if needed
442
-            this.videoContainer.showAvatar(isVideoMuted);
446
+            container.showAvatar(isVideoMuted);
443 447
 
444 448
             let promise;
445 449
 
@@ -449,7 +453,7 @@ export default class LargeVideoManager {
449 453
                 this.showWatermark(true);
450 454
                 promise = Promise.resolve();
451 455
             } else {
452
-                promise = this.videoContainer.show();
456
+                promise = container.show();
453 457
             }
454 458
 
455 459
             // resolve updateLargeVideo promise after everything is done
@@ -529,7 +533,8 @@ export default class LargeVideoManager {
529 533
      * @param enable <tt>true</tt> to enable, <tt>false</tt> to disable
530 534
      */
531 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 Parādīt failu

@@ -801,10 +801,11 @@ var VideoLayout = {
801 801
      * @param forceUpdate indicates that hidden thumbnails will be shown
802 802
      * @param completeFunction a function to be called when the video area is
803 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 810
         if (largeVideo) {
810 811
             largeVideo.updateContainerSize(isSideBarVisible);

Notiek ielāde…
Atcelt
Saglabāt