|
@@ -39,13 +39,18 @@ export function getMaxColumnCount() {
|
39
|
39
|
* equal count of tiles for height and width, until maxColumn is reached in
|
40
|
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
|
43
|
* @param {number} maxColumns - The maximum number of columns that can be
|
44
|
44
|
* displayed.
|
45
|
45
|
* @returns {Object} An object is return with the desired number of columns,
|
46
|
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
|
54
|
const columnsToMaintainASquare = Math.ceil(Math.sqrt(numberOfParticipants));
|
50
|
55
|
const columns = Math.min(columnsToMaintainASquare, maxColumns);
|
51
|
56
|
const rows = Math.ceil(numberOfParticipants / columns);
|