Sfoglia il codice sorgente

fix(LargeVideoManager): large video resizing

Distinguish between preferred and calculated width/height
values.
master
paweldomas 4 anni fa
parent
commit
7f17c2eceb
1 ha cambiato i file con 32 aggiunte e 2 eliminazioni
  1. 32
    2
      modules/UI/videolayout/LargeVideoManager.js

+ 32
- 2
modules/UI/videolayout/LargeVideoManager.js Vedi File

67
         // use the same video container to handle desktop tracks
67
         // use the same video container to handle desktop tracks
68
         this.addContainer(DESKTOP_CONTAINER_TYPE, this.videoContainer);
68
         this.addContainer(DESKTOP_CONTAINER_TYPE, this.videoContainer);
69
 
69
 
70
+        /**
71
+         * The preferred width passed as an argument to {@link updateContainerSize}.
72
+         *
73
+         * @type {number|undefined}
74
+         */
75
+        this.preferredWidth = undefined;
76
+
77
+        /**
78
+         * The preferred height passed as an argument to {@link updateContainerSize}.
79
+         *
80
+         * @type {number|undefined}
81
+         */
82
+        this.preferredHeight = undefined;
83
+
84
+        /**
85
+         * The calculated width that will be used for the large video.
86
+         * @type {number}
87
+         */
70
         this.width = 0;
88
         this.width = 0;
89
+
90
+        /**
91
+         * The calculated height that will be used for the large video.
92
+         * @type {number}
93
+         */
71
         this.height = 0;
94
         this.height = 0;
72
 
95
 
73
         /**
96
         /**
323
      * Update container size.
346
      * Update container size.
324
      */
347
      */
325
     updateContainerSize(width, height) {
348
     updateContainerSize(width, height) {
326
-        let widthToUse = width ?? (this.width > 0 ? this.width : window.innerWidth);
349
+        if (typeof width === 'number') {
350
+            this.preferredWidth = width;
351
+        }
352
+        if (typeof height === 'number') {
353
+            this.preferredHeight = height;
354
+        }
355
+
356
+        let widthToUse = this.preferredWidth || window.innerWidth;
327
         const { isOpen } = APP.store.getState()['features/chat'];
357
         const { isOpen } = APP.store.getState()['features/chat'];
328
 
358
 
329
         /**
359
         /**
340
         }
370
         }
341
 
371
 
342
         this.width = widthToUse;
372
         this.width = widthToUse;
343
-        this.height = height ?? (this.height > 0 ? this.height : window.innerHeight);
373
+        this.height = this.preferredHeight || window.innerHeight;
344
     }
374
     }
345
 
375
 
346
     /**
376
     /**

Loading…
Annulla
Salva