Browse Source

fix(pre-meeting) Hide invite button for JaaS

master
hmuresan 4 years ago
parent
commit
a892d5fed1

+ 4
- 0
config.js View File

@@ -515,6 +515,10 @@ var config = {
515 515
     //    '__end'
516 516
     // ],
517 517
 
518
+    // List of pre meeting screens buttons to hide. The values must be one or more of the 5 allowed buttons:
519
+    // 'microphone', 'camera', 'select-background', 'invite', 'settings'
520
+    // hiddenPremeetingButtons: [],
521
+
518 522
     // Stats
519 523
     //
520 524
 

+ 1
- 0
react/features/base/config/configWhitelist.js View File

@@ -134,6 +134,7 @@ export default [
134 134
     'forceTurnRelay',
135 135
     'gatherStats',
136 136
     'googleApiApplicationClientID',
137
+    'hiddenPremeetingButtons',
137 138
     'hideConferenceSubject',
138 139
     'hideRecordingLabel',
139 140
     'hideParticipantsStats',

+ 10
- 0
react/features/base/config/constants.js View File

@@ -46,3 +46,13 @@ export const TOOLBAR_BUTTONS = [
46 46
     'toggle-camera',
47 47
     'videoquality'
48 48
 ];
49
+
50
+/**
51
+ * The toolbar buttons to show on premeeting screens.
52
+ */
53
+export const PREMEETING_BUTTONS = [ 'microphone', 'camera', 'select-background', 'invite', 'settings' ];
54
+
55
+/**
56
+  * The toolbar buttons to show on 3rdParty prejoin screen.
57
+  */
58
+export const THIRD_PARTY_PREJOIN_BUTTONS = [ 'microphone', 'camera', 'select-background' ];

+ 33
- 7
react/features/base/premeeting/components/web/PreMeetingScreen.js View File

@@ -2,14 +2,21 @@
2 2
 
3 3
 import React, { PureComponent } from 'react';
4 4
 
5
+import { connect } from '../../../../base/redux';
5 6
 import DeviceStatus from '../../../../prejoin/components/preview/DeviceStatus';
6 7
 import { Toolbox } from '../../../../toolbox/components/web';
8
+import { PREMEETING_BUTTONS, THIRD_PARTY_PREJOIN_BUTTONS } from '../../../config/constants';
7 9
 
8 10
 import ConnectionStatus from './ConnectionStatus';
9 11
 import Preview from './Preview';
10 12
 
11 13
 type Props = {
12 14
 
15
+    /**
16
+     * The list of toolbar buttons to render.
17
+     */
18
+    _buttons: Array<string>,
19
+
13 20
     /**
14 21
      * Children component(s) to be rendered on the screen.
15 22
      */
@@ -46,9 +53,9 @@ type Props = {
46 53
     title?: string,
47 54
 
48 55
     /**
49
-     * Override for default toolbar buttons
56
+     * Whether it's used in the 3rdParty prejoin screen or not.
50 57
      */
51
-     toolbarButtons?: Array<string>,
58
+    thirdParty?: boolean,
52 59
 
53 60
     /**
54 61
      * True if the preview overlay should be muted, false otherwise.
@@ -61,13 +68,11 @@ type Props = {
61 68
     videoTrack?: Object
62 69
 }
63 70
 
64
-const buttons = [ 'microphone', 'camera', 'select-background', 'invite', 'settings' ];
65
-
66 71
 /**
67 72
  * Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
68 73
  * on the prejoin screen (pre-connection) or lobby (post-connection).
69 74
  */
70
-export default class PreMeetingScreen extends PureComponent<Props> {
75
+class PreMeetingScreen extends PureComponent<Props> {
71 76
     /**
72 77
      * Default values for {@code Prejoin} component's properties.
73 78
      *
@@ -85,12 +90,12 @@ export default class PreMeetingScreen extends PureComponent<Props> {
85 90
      */
86 91
     render() {
87 92
         const {
93
+            _buttons,
88 94
             children,
89 95
             className,
90 96
             showDeviceStatus,
91 97
             skipPrejoinButton,
92 98
             title,
93
-            toolbarButtons,
94 99
             videoMuted,
95 100
             videoTrack
96 101
         } = this.props;
@@ -107,7 +112,7 @@ export default class PreMeetingScreen extends PureComponent<Props> {
107 112
                             { title }
108 113
                         </h1>
109 114
                         { children }
110
-                        <Toolbox toolbarButtons = { toolbarButtons || buttons } />
115
+                        { _buttons.length && <Toolbox toolbarButtons = { _buttons } /> }
111 116
                         { skipPrejoinButton }
112 117
                         { showDeviceStatus && <DeviceStatus /> }
113 118
                     </div>
@@ -120,3 +125,24 @@ export default class PreMeetingScreen extends PureComponent<Props> {
120 125
         );
121 126
     }
122 127
 }
128
+
129
+
130
+/**
131
+ * Maps (parts of) the redux state to the React {@code Component} props.
132
+ *
133
+ * @param {Object} state - The redux state.
134
+ * @param {Object} ownProps - The props passed to the component.
135
+ * @returns {Object}
136
+ */
137
+function mapStateToProps(state, ownProps): Object {
138
+    const hideButtons = state['features/base/config'].hiddenPremeetingButtons || [];
139
+    const premeetingButtons = ownProps.thirdParty
140
+        ? THIRD_PARTY_PREJOIN_BUTTONS
141
+        : PREMEETING_BUTTONS;
142
+
143
+    return {
144
+        _buttons: premeetingButtons.filter(b => !hideButtons.includes(b))
145
+    };
146
+}
147
+
148
+export default connect(mapStateToProps)(PreMeetingScreen);

+ 1
- 2
react/features/prejoin/components/PrejoinThirdParty.js View File

@@ -37,7 +37,6 @@ type Props = {
37 37
     videoTrack: ?Object
38 38
 };
39 39
 
40
-const buttons = [ 'microphone', 'camera', 'select-background' ];
41 40
 
42 41
 /**
43 42
  * This component is displayed before joining a meeting.
@@ -62,7 +61,7 @@ class PrejoinThirdParty extends Component<Props> {
62 61
                 className = { `prejoin-third-party ${className}` }
63 62
                 showDeviceStatus = { deviceStatusVisible }
64 63
                 skipPrejoinButton = { false }
65
-                toolbarButtons = { buttons }
64
+                thirdParty = { true }
66 65
                 videoMuted = { !showCameraPreview }
67 66
                 videoTrack = { videoTrack } />
68 67
         );

Loading…
Cancel
Save