瀏覽代碼

fix(large-video): Resize calculations.

Since the verical filmstrip doesn't set its width explicitly anymore,
calculating the available area for the large video based on the
filmstrip width retrieved from the HTML element was wrong
in the cases when the rendering and cleanup of the filmstrip hasn't
finish yet. For example when switching from tile view to stage view.
j8
Hristo Terezov 5 年之前
父節點
當前提交
06fa175a6c

+ 1
- 1
modules/UI/UI.js 查看文件

166
     // resizeVideoArea) because the animation is not visible anyway. Plus with
166
     // resizeVideoArea) because the animation is not visible anyway. Plus with
167
     // the current dom layout, the quality label is part of the video layout and
167
     // the current dom layout, the quality label is part of the video layout and
168
     // will be seen animating in.
168
     // will be seen animating in.
169
-    VideoLayout.resizeVideoArea(true, false);
169
+    VideoLayout.resizeVideoArea();
170
 
170
 
171
     sharedVideoManager = new SharedVideoManager(eventEmitter);
171
     sharedVideoManager = new SharedVideoManager(eventEmitter);
172
 
172
 

+ 1
- 1
modules/UI/etherpad/Etherpad.js 查看文件

120
 
120
 
121
         if (interfaceConfig.VERTICAL_FILMSTRIP) {
121
         if (interfaceConfig.VERTICAL_FILMSTRIP) {
122
             height = containerHeight - getToolboxHeight();
122
             height = containerHeight - getToolboxHeight();
123
-            width = containerWidth - Filmstrip.getFilmstripWidth();
123
+            width = containerWidth - Filmstrip.getVerticalFilmstripWidth();
124
         } else {
124
         } else {
125
             height = containerHeight - Filmstrip.getFilmstripHeight();
125
             height = containerHeight - Filmstrip.getFilmstripHeight();
126
             width = containerWidth;
126
             width = containerWidth;

+ 1
- 1
modules/UI/shared_video/SharedVideo.js 查看文件

661
 
661
 
662
         if (interfaceConfig.VERTICAL_FILMSTRIP) {
662
         if (interfaceConfig.VERTICAL_FILMSTRIP) {
663
             height = containerHeight - getToolboxHeight();
663
             height = containerHeight - getToolboxHeight();
664
-            width = containerWidth - Filmstrip.getFilmstripWidth();
664
+            width = containerWidth - Filmstrip.getVerticalFilmstripWidth();
665
         } else {
665
         } else {
666
             height = containerHeight - Filmstrip.getFilmstripHeight();
666
             height = containerHeight - Filmstrip.getFilmstripHeight();
667
             width = containerWidth;
667
             width = containerWidth;

+ 6
- 11
modules/UI/videolayout/Filmstrip.js 查看文件

1
 /* global $, APP, interfaceConfig */
1
 /* global $, APP, interfaceConfig */
2
 
2
 
3
-import { isFilmstripVisible } from '../../../react/features/filmstrip';
3
+import { getVerticalFilmstripVisibleAreaWidth, isFilmstripVisible } from '../../../react/features/filmstrip';
4
 
4
 
5
 const Filmstrip = {
5
 const Filmstrip = {
6
     /**
6
     /**
19
     },
19
     },
20
 
20
 
21
     /**
21
     /**
22
-     * Returns the width of filmstip
23
-     * @returns {number} width
22
+     * Returns the width of the vertical filmstip if the filmstrip is visible and 0 otherwise.
23
+     *
24
+     * @returns {number} - The width of the vertical filmstip if the filmstrip is visible and 0 otherwise.
24
      */
25
      */
25
-    getFilmstripWidth() {
26
-        const filmstrip = $('#remoteVideos');
27
-
28
-        return isFilmstripVisible(APP.store)
29
-            ? filmstrip.outerWidth()
30
-                - parseInt(filmstrip.css('paddingLeft'), 10)
31
-                - parseInt(filmstrip.css('paddingRight'), 10)
32
-            : 0;
26
+    getVerticalFilmstripWidth() {
27
+        return isFilmstripVisible(APP.store) ? getVerticalFilmstripVisibleAreaWidth() : 0;
33
     },
28
     },
34
 
29
 
35
     /**
30
     /**

+ 2
- 2
modules/UI/videolayout/VideoContainer.js 查看文件

46
 
46
 
47
     if (interfaceConfig.VERTICAL_FILMSTRIP) {
47
     if (interfaceConfig.VERTICAL_FILMSTRIP) {
48
         // eslint-disable-next-line no-param-reassign
48
         // eslint-disable-next-line no-param-reassign
49
-        videoSpaceWidth -= Filmstrip.getFilmstripWidth();
49
+        videoSpaceWidth -= Filmstrip.getVerticalFilmstripWidth();
50
     } else {
50
     } else {
51
         // eslint-disable-next-line no-param-reassign
51
         // eslint-disable-next-line no-param-reassign
52
         videoSpaceHeight -= Filmstrip.getFilmstripHeight();
52
         videoSpaceHeight -= Filmstrip.getFilmstripHeight();
332
         /* eslint-enable max-params */
332
         /* eslint-enable max-params */
333
         if (this.stream && this.isScreenSharing()) {
333
         if (this.stream && this.isScreenSharing()) {
334
             if (interfaceConfig.VERTICAL_FILMSTRIP) {
334
             if (interfaceConfig.VERTICAL_FILMSTRIP) {
335
-                containerWidthToUse -= Filmstrip.getFilmstripWidth();
335
+                containerWidthToUse -= Filmstrip.getVerticalFilmstripWidth();
336
             }
336
             }
337
 
337
 
338
             return getCameraVideoPosition(width,
338
             return getCameraVideoPosition(width,

+ 2
- 6
modules/UI/videolayout/VideoLayout.js 查看文件

542
 
542
 
543
     /**
543
     /**
544
      * Resizes the video area.
544
      * Resizes the video area.
545
-     *
546
-     * TODO: Remove the "animate" param as it is no longer passed in as true.
547
-     *
548
-     * @param forceUpdate indicates that hidden thumbnails will be shown
549
      */
545
      */
550
-    resizeVideoArea(animate = false) {
546
+    resizeVideoArea() {
551
         if (largeVideo) {
547
         if (largeVideo) {
552
             largeVideo.updateContainerSize();
548
             largeVideo.updateContainerSize();
553
-            largeVideo.resize(animate);
549
+            largeVideo.resize(false);
554
         }
550
         }
555
     },
551
     },
556
 
552
 

+ 17
- 0
react/features/filmstrip/functions.web.js 查看文件

116
         width
116
         width
117
     };
117
     };
118
 }
118
 }
119
+
120
+/**
121
+ * Returns the width of the visible area (doesn't include the left margin/padding) of the the vertical filmstrip.
122
+ *
123
+ * @returns {number} - The width of the vertical filmstrip.
124
+ */
125
+export function getVerticalFilmstripVisibleAreaWidth() {
126
+    // Adding 11px for the 2px right margin, 2px borders on the left and right and 5px right padding.
127
+    // Also adding 7px for the scrollbar. Note that we are not counting the left margins and paddings because this
128
+    // function is used for calculating the available space and they are invisible.
129
+    // TODO: Check if we can remove the left margins and paddings from the CSS.
130
+    // FIXME: This function is used to calculate the size of the large video, etherpad or shared video. Once everything
131
+    // is reactified this calculation will need to move to the corresponding components.
132
+    const filmstripMaxWidth = (interfaceConfig.FILM_STRIP_MAX_HEIGHT || 120) + 18;
133
+
134
+    return Math.min(filmstripMaxWidth, window.innerWidth);
135
+}

+ 1
- 1
react/features/video-layout/middleware.web.js 查看文件

74
         break;
74
         break;
75
 
75
 
76
     case SET_FILMSTRIP_VISIBLE:
76
     case SET_FILMSTRIP_VISIBLE:
77
-        VideoLayout.resizeVideoArea(true, false);
77
+        VideoLayout.resizeVideoArea();
78
         break;
78
         break;
79
 
79
 
80
     case TRACK_ADDED:
80
     case TRACK_ADDED:

Loading…
取消
儲存