Преглед изворни кода

fix(large-video): vertically align center screenshare

Stop using special case logic for aligning screenshare videos.
It may be possible to have positioning all done using CSS but that
seems to be a more significant refactoring.
master
Leonard Kim пре 6 година
родитељ
комит
a9d76a2577
1 измењених фајлова са 6 додато и 22 уклоњено
  1. 6
    22
      modules/UI/videolayout/VideoContainer.js

+ 6
- 22
modules/UI/videolayout/VideoContainer.js Прегледај датотеку

166
         verticalIndent };
166
         verticalIndent };
167
 }
167
 }
168
 
168
 
169
-/**
170
- * Returns an array of the video horizontal and vertical indents.
171
- * Centers horizontally and top aligns vertically.
172
- *
173
- * @return an array with 2 elements, the horizontal indent and the vertical
174
- * indent
175
- */
176
-function getDesktopVideoPosition(videoWidth, videoHeight, videoSpaceWidth) {
177
-    const horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
178
-
179
-    const verticalIndent = 0;// Top aligned
180
-
181
-    return { horizontalIndent,
182
-        verticalIndent };
183
-}
184
-
185
 /**
169
 /**
186
  * Container for user video.
170
  * Container for user video.
187
  */
171
  */
366
      * @returns {{horizontalIndent, verticalIndent}}
350
      * @returns {{horizontalIndent, verticalIndent}}
367
      */
351
      */
368
     getVideoPosition(width, height, containerWidth, containerHeight) {
352
     getVideoPosition(width, height, containerWidth, containerHeight) {
353
+        let containerWidthToUse = containerWidth;
354
+
369
         /* eslint-enable max-params */
355
         /* eslint-enable max-params */
370
         if (this.stream && this.isScreenSharing()) {
356
         if (this.stream && this.isScreenSharing()) {
371
-            let availableContainerWidth = containerWidth;
372
-
373
             if (interfaceConfig.VERTICAL_FILMSTRIP) {
357
             if (interfaceConfig.VERTICAL_FILMSTRIP) {
374
-                availableContainerWidth -= Filmstrip.getFilmstripWidth();
358
+                containerWidthToUse -= Filmstrip.getFilmstripWidth();
375
             }
359
             }
376
 
360
 
377
-            return getDesktopVideoPosition(width,
361
+            return getCameraVideoPosition(width,
378
                 height,
362
                 height,
379
-                availableContainerWidth,
363
+                containerWidthToUse,
380
                 containerHeight);
364
                 containerHeight);
381
         }
365
         }
382
 
366
 
383
         return getCameraVideoPosition(width,
367
         return getCameraVideoPosition(width,
384
                 height,
368
                 height,
385
-                containerWidth,
369
+                containerWidthToUse,
386
                 containerHeight);
370
                 containerHeight);
387
 
371
 
388
     }
372
     }

Loading…
Откажи
Сачувај