Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

video-layout: fix calculating tile size for recorder

Saúl Ibarra Corretgéb13200ac929d
diff --git a/react/features/filmstrip/subscriber.web.js b/react/features/filmstrip/subscriber.web.js
index e1f198a2e0..9addc0365f 100644
--- a/react/features/filmstrip/subscriber.web.js
+++ b/react/features/filmstrip/subscriber.web.js
@@ -15,7 +15,7 @@ StateListenerRegistry.register(
const state = store.getState();
if (shouldDisplayTileView(state)) {
- const gridDimensions = getTileViewGridDimensions(state['features/base/participants'].length);
+ const gridDimensions = getTileViewGridDimensions(state);
const oldGridDimensions = state['features/filmstrip'].tileViewDimensions.gridDimensions;
const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
@@ -41,7 +41,7 @@ StateListenerRegistry.register(
const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
store.dispatch(setTileViewDimensions(
- getTileViewGridDimensions(state['features/base/participants'].length), {
+ getTileViewGridDimensions(state), {
clientHeight,
clientWidth
}));
diff --git a/react/features/video-layout/functions.js b/react/features/video-layout/functions.js
index e9cf7040fe..ab8ec3625b 100644
--- a/react/features/video-layout/functions.js
+++ b/react/features/video-layout/functions.js
@@ -39,13 +39,18 @@ export function getMaxColumnCount() {
* equal count of tiles for height and width, until maxColumn is reached in
* which rows will be added but no more columns.
*
- * @param {number} numberOfParticipants - The number of participants including the fake participants.
+ * @param {Object} state - The redux store state.
* @param {number} maxColumns - The maximum number of columns that can be
* displayed.
* @returns {Object} An object is return with the desired number of columns,
* rows, and visible rows (the rest should overflow) for the tile view layout.
*/
-export function getTileViewGridDimensions(numberOfParticipants: number, maxColumns: number = getMaxColumnCount()) {
+export function getTileViewGridDimensions(state: Object, maxColumns: number = getMaxColumnCount()) {
+ // When in tile view mode, we must discount ourselves (the local participant) because our
+ // tile is not visible.
+ const { iAmRecorder } = state['features/base/config'];
+ const numberOfParticipants = state['features/base/participants'].length - (iAmRecorder ? 1 : 0);
+
const columnsToMaintainASquare = Math.ceil(Math.sqrt(numberOfParticipants));
const columns = Math.min(columnsToMaintainASquare, maxColumns);
const rows = Math.ceil(numberOfParticipants / columns);