Selaa lähdekoodia

chore(tileview) Add config for disabling tileview (#13692)

- show fixed number of toolbar buttons in toolbar (including custom buttons) instead of sending to overflow menu
factor2
Horatiu Muresan 2 vuotta sitten
vanhempi
commit
5345a77092
No account linked to committer's email address

+ 2
- 0
config.js Näytä tiedosto

@@ -1594,6 +1594,8 @@ var config = {
1594 1594
 
1595 1595
     // Tile view related config options.
1596 1596
     // tileView: {
1597
+    //     // Whether tileview should be disabled.
1598
+    //     disabled: false,
1597 1599
     //     // The optimal number of tiles that are going to be shown in tile view. Depending on the screen size it may
1598 1600
     //     // not be possible to show the exact number of participants specified here.
1599 1601
     //     numberOfVisibleTiles: 25,

+ 1
- 0
react/features/base/config/configType.ts Näytä tiedosto

@@ -573,6 +573,7 @@ export interface IConfig {
573 573
         testMode?: boolean;
574 574
     };
575 575
     tileView?: {
576
+        disabled?: boolean;
576 577
         numberOfVisibleTiles?: number;
577 578
     };
578 579
     tokenAuthUrl?: string;

+ 1
- 0
react/features/base/ui/constants.web.ts Näytä tiedosto

@@ -260,6 +260,7 @@ export const commonStyles = (theme: Theme) => {
260 260
             padding: 6,
261 261
             textAlign: 'center' as const,
262 262
             pointerEvents: 'all' as const,
263
+            display: 'flex',
263 264
             boxShadow: '0px 2px 8px 4px rgba(0, 0, 0, 0.25), 0px 0px 0px 1px rgba(0, 0, 0, 0.15)',
264 265
 
265 266
             '& > div': {

+ 13
- 1
react/features/filmstrip/functions.any.ts Näytä tiedosto

@@ -1,4 +1,4 @@
1
-import { IStore } from '../app/types';
1
+import { IReduxState, IStore } from '../app/types';
2 2
 import {
3 3
     getActiveSpeakersToBeDisplayed,
4 4
     getVirtualScreenshareParticipantOwnerId
@@ -95,3 +95,15 @@ export function updateRemoteParticipantsOnLeave(store: IStore, participantId: st
95 95
     reorderedParticipants.delete(participantId)
96 96
         && store.dispatch(setRemoteParticipants(Array.from(reorderedParticipants)));
97 97
 }
98
+
99
+/**
100
+ * Returns whether tileview is completely disabled.
101
+ *
102
+ * @param {IReduxState} state - Redux state.
103
+ * @returns {boolean} - Whether tileview is completely disabled.
104
+ */
105
+export function isTileViewModeDisabled(state: IReduxState) {
106
+    const { tileView = {} } = state['features/base/config'];
107
+
108
+    return tileView.disabled;
109
+}

+ 2
- 5
react/features/toolbox/components/web/Toolbox.tsx Näytä tiedosto

@@ -290,7 +290,7 @@ const Toolbox = ({
290 290
 
291 291
         setButtonsNotifyClickMode(buttons);
292 292
         const isHangupVisible = isToolbarButtonEnabled('hangup', _toolbarButtons);
293
-        let { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
293
+        const { order } = THRESHOLDS.find(({ width }) => _clientWidth > width)
294 294
             || THRESHOLDS[THRESHOLDS.length - 1];
295 295
 
296 296
         const keys = Object.keys(buttons);
@@ -302,11 +302,8 @@ const Toolbox = ({
302 302
             !_jwtDisabledButtons.includes(key)
303 303
             && (isToolbarButtonEnabled(key, _toolbarButtons) || isToolbarButtonEnabled(alias, _toolbarButtons))
304 304
         );
305
-        const filteredKeys = filtered.map(button => button.key);
306 305
 
307
-        order = order.filter(key => filteredKeys.includes(buttons[key as keyof typeof buttons].key));
308
-
309
-        let sliceIndex = order.length + 2;
306
+        let sliceIndex = _overflowDrawer ? order.length + 2 : order.length + 1;
310 307
 
311 308
         if (isHangupVisible) {
312 309
             sliceIndex -= 1;

+ 8
- 3
react/features/video-layout/actions.any.ts Näytä tiedosto

@@ -1,4 +1,5 @@
1 1
 import { IStore } from '../app/types';
2
+import { isTileViewModeDisabled } from '../filmstrip/functions.any';
2 3
 
3 4
 import {
4 5
     SET_TILE_VIEW,
@@ -34,9 +35,13 @@ export function virtualScreenshareParticipantsUpdated(participantIds: Array<stri
34 35
  * }}
35 36
  */
36 37
 export function setTileView(enabled?: boolean) {
37
-    return {
38
-        type: SET_TILE_VIEW,
39
-        enabled
38
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
39
+        const tileViewDisabled = isTileViewModeDisabled(getState());
40
+
41
+        !tileViewDisabled && dispatch({
42
+            type: SET_TILE_VIEW,
43
+            enabled
44
+        });
40 45
     };
41 46
 }
42 47
 

+ 7
- 1
react/features/video-layout/functions.any.ts Näytä tiedosto

@@ -4,7 +4,7 @@ import { getFeatureFlag } from '../base/flags/functions';
4 4
 import { pinParticipant } from '../base/participants/actions';
5 5
 import { getParticipantCount, getPinnedParticipant } from '../base/participants/functions';
6 6
 import { FakeParticipant } from '../base/participants/types';
7
-import { isStageFilmstripAvailable } from '../filmstrip/functions';
7
+import { isStageFilmstripAvailable, isTileViewModeDisabled } from '../filmstrip/functions';
8 8
 import { isVideoPlaying } from '../shared-video/functions';
9 9
 import { VIDEO_QUALITY_LEVELS } from '../video-quality/constants';
10 10
 import { getReceiverVideoQualityLevel } from '../video-quality/functions';
@@ -60,6 +60,12 @@ export function getCurrentLayout(state: IReduxState) {
60 60
  * @returns {boolean} True if tile view should be displayed.
61 61
  */
62 62
 export function shouldDisplayTileView(state: IReduxState) {
63
+    const tileViewDisabled = isTileViewModeDisabled(state);
64
+
65
+    if (tileViewDisabled) {
66
+        return false;
67
+    }
68
+
63 69
     const { tileViewEnabled } = state['features/video-layout'] ?? {};
64 70
 
65 71
     if (tileViewEnabled !== undefined) {

Loading…
Peruuta
Tallenna