Pārlūkot izejas kodu

video-layout: fix calculating tile size for recorder

When the reccorder joins, they have a local participant, which is not rendered,
so don't count it towards the partcipant count used for computing the tile
sizes.
j8
Saúl Ibarra Corretgé 5 gadus atpakaļ
vecāks
revīzija
b13200ac92

+ 2
- 2
react/features/filmstrip/subscriber.web.js Parādīt failu

15
         const state = store.getState();
15
         const state = store.getState();
16
 
16
 
17
         if (shouldDisplayTileView(state)) {
17
         if (shouldDisplayTileView(state)) {
18
-            const gridDimensions = getTileViewGridDimensions(state['features/base/participants'].length);
18
+            const gridDimensions = getTileViewGridDimensions(state);
19
             const oldGridDimensions = state['features/filmstrip'].tileViewDimensions.gridDimensions;
19
             const oldGridDimensions = state['features/filmstrip'].tileViewDimensions.gridDimensions;
20
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
20
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
21
 
21
 
41
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
41
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
42
 
42
 
43
             store.dispatch(setTileViewDimensions(
43
             store.dispatch(setTileViewDimensions(
44
-                getTileViewGridDimensions(state['features/base/participants'].length), {
44
+                getTileViewGridDimensions(state), {
45
                     clientHeight,
45
                     clientHeight,
46
                     clientWidth
46
                     clientWidth
47
                 }));
47
                 }));

+ 7
- 2
react/features/video-layout/functions.js Parādīt failu

39
  * equal count of tiles for height and width, until maxColumn is reached in
39
  * equal count of tiles for height and width, until maxColumn is reached in
40
  * which rows will be added but no more columns.
40
  * which rows will be added but no more columns.
41
  *
41
  *
42
- * @param {number} numberOfParticipants - The number of participants including the fake participants.
42
+ * @param {Object} state - The redux store state.
43
  * @param {number} maxColumns - The maximum number of columns that can be
43
  * @param {number} maxColumns - The maximum number of columns that can be
44
  * displayed.
44
  * displayed.
45
  * @returns {Object} An object is return with the desired number of columns,
45
  * @returns {Object} An object is return with the desired number of columns,
46
  * rows, and visible rows (the rest should overflow) for the tile view layout.
46
  * rows, and visible rows (the rest should overflow) for the tile view layout.
47
  */
47
  */
48
-export function getTileViewGridDimensions(numberOfParticipants: number, maxColumns: number = getMaxColumnCount()) {
48
+export function getTileViewGridDimensions(state: Object, maxColumns: number = getMaxColumnCount()) {
49
+    // When in tile view mode, we must discount ourselves (the local participant) because our
50
+    // tile is not visible.
51
+    const { iAmRecorder } = state['features/base/config'];
52
+    const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
53
+
49
     const columnsToMaintainASquare = Math.ceil(Math.sqrt(numberOfParticipants));
54
     const columnsToMaintainASquare = Math.ceil(Math.sqrt(numberOfParticipants));
50
     const columns = Math.min(columnsToMaintainASquare, maxColumns);
55
     const columns = Math.min(columnsToMaintainASquare, maxColumns);
51
     const rows = Math.ceil(numberOfParticipants / columns);
56
     const rows = Math.ceil(numberOfParticipants / columns);

Notiek ielāde…
Atcelt
Saglabāt