Przeglądaj źródła

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.
j8
Leonard Kim 6 lat temu
rodzic
commit
a9d76a2577
1 zmienionych plików z 6 dodań i 22 usunięć
  1. 6
    22
      modules/UI/videolayout/VideoContainer.js

+ 6
- 22
modules/UI/videolayout/VideoContainer.js Wyświetl plik

@@ -166,22 +166,6 @@ function getCameraVideoPosition( // eslint-disable-line max-params
166 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 170
  * Container for user video.
187 171
  */
@@ -366,23 +350,23 @@ export class VideoContainer extends LargeContainer {
366 350
      * @returns {{horizontalIndent, verticalIndent}}
367 351
      */
368 352
     getVideoPosition(width, height, containerWidth, containerHeight) {
353
+        let containerWidthToUse = containerWidth;
354
+
369 355
         /* eslint-enable max-params */
370 356
         if (this.stream && this.isScreenSharing()) {
371
-            let availableContainerWidth = containerWidth;
372
-
373 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 362
                 height,
379
-                availableContainerWidth,
363
+                containerWidthToUse,
380 364
                 containerHeight);
381 365
         }
382 366
 
383 367
         return getCameraVideoPosition(width,
384 368
                 height,
385
-                containerWidth,
369
+                containerWidthToUse,
386 370
                 containerHeight);
387 371
 
388 372
     }

Ładowanie…
Anuluj
Zapisz