Selaa lähdekoodia

feat(toolbar): add 'always-visibile' config option

The visibility of the toolbar can be toggled by interacting with the main screen.
This change allows the toolbar to be configured to be 'always visible'. This voids
the 'toggle' functionality.
j8
Guus der Kinderen 7 vuotta sitten
vanhempi
commit
acc41e6d0b

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

341
 
341
 
342
     // List of undocumented settings used in jitsi-meet
342
     // List of undocumented settings used in jitsi-meet
343
     /**
343
     /**
344
-     alwaysVisibleToolbar
345
      autoRecord
344
      autoRecord
346
      autoRecordToken
345
      autoRecordToken
347
      debug
346
      debug

+ 1
- 0
interface_config.js Näytä tiedosto

13
     DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP: null,
13
     DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP: null,
14
     INITIAL_TOOLBAR_TIMEOUT: 20000,
14
     INITIAL_TOOLBAR_TIMEOUT: 20000,
15
     TOOLBAR_TIMEOUT: 4000,
15
     TOOLBAR_TIMEOUT: 4000,
16
+    TOOLBAR_ALWAYS_VISIBLE: false,
16
     DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
17
     DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
17
     DEFAULT_LOCAL_DISPLAY_NAME: 'me',
18
     DEFAULT_LOCAL_DISPLAY_NAME: 'me',
18
     SHOW_JITSI_WATERMARK: true,
19
     SHOW_JITSI_WATERMARK: true,

+ 0
- 1
react/features/base/config/functions.js Näytä tiedosto

20
     '_peerConnStatusOutOfLastNTimeout',
20
     '_peerConnStatusOutOfLastNTimeout',
21
     '_peerConnStatusRtcMuteTimeout',
21
     '_peerConnStatusRtcMuteTimeout',
22
     'abTesting',
22
     'abTesting',
23
-    'alwaysVisibleToolbar',
24
     'autoRecord',
23
     'autoRecord',
25
     'autoRecordToken',
24
     'autoRecordToken',
26
     'avgRtpStatsN',
25
     'avgRtpStatsN',

+ 24
- 3
react/features/conference/components/Conference.native.js Näytä tiedosto

90
      *
90
      *
91
      * @private
91
      * @private
92
      */
92
      */
93
-    _toolboxVisible: boolean
93
+    _toolboxVisible: boolean,
94
+
95
+    /**
96
+     * The indicator which determines whether the Toolbox is always visible.
97
+     *
98
+     * @private
99
+     */
100
+    _toolboxAlwaysVisible: boolean
94
 };
101
 };
95
 
102
 
96
 /**
103
 /**
278
      * @returns {void}
285
      * @returns {void}
279
      */
286
      */
280
     _onClick() {
287
     _onClick() {
288
+        if (this.props._toolboxAlwaysVisible) {
289
+            return;
290
+        }
291
+
281
         const toolboxVisible = !this.props._toolboxVisible;
292
         const toolboxVisible = !this.props._toolboxVisible;
282
 
293
 
283
         this.props._setToolboxVisible(toolboxVisible);
294
         this.props._setToolboxVisible(toolboxVisible);
384
  *     _connecting: boolean,
395
  *     _connecting: boolean,
385
  *     _participantCount: number,
396
  *     _participantCount: number,
386
  *     _reducedUI: boolean,
397
  *     _reducedUI: boolean,
387
- *     _toolboxVisible: boolean
398
+ *     _toolboxVisible: boolean,
399
+ *     _toolboxAlwaysVisible: boolean
388
  * }}
400
  * }}
389
  */
401
  */
390
 function _mapStateToProps(state) {
402
 function _mapStateToProps(state) {
391
     const { connecting, connection } = state['features/base/connection'];
403
     const { connecting, connection } = state['features/base/connection'];
392
     const { conference, joining, leaving } = state['features/base/conference'];
404
     const { conference, joining, leaving } = state['features/base/conference'];
393
     const { reducedUI } = state['features/base/responsive-ui'];
405
     const { reducedUI } = state['features/base/responsive-ui'];
406
+    const { alwaysVisible, visible } = state['features/toolbox'];
394
 
407
 
395
     // XXX There is a window of time between the successful establishment of the
408
     // XXX There is a window of time between the successful establishment of the
396
     // XMPP connection and the subsequent commencement of joining the MUC during
409
     // XMPP connection and the subsequent commencement of joining the MUC during
439
          * @private
452
          * @private
440
          * @type {boolean}
453
          * @type {boolean}
441
          */
454
          */
442
-        _toolboxVisible: state['features/toolbox'].visible
455
+        _toolboxVisible: visible,
456
+
457
+        /**
458
+         * The indicator which determines whether the Toolbox is always visible.
459
+         *
460
+         * @private
461
+         * @type {boolean}
462
+         */
463
+        _toolboxAlwaysVisible: alwaysVisible
443
     };
464
     };
444
 }
465
 }
445
 
466
 

+ 5
- 20
react/features/conference/components/Conference.web.js Näytä tiedosto

43
  */
43
  */
44
 type Props = {
44
 type Props = {
45
 
45
 
46
-    /**
47
-     * Whether the toolbar should stay visible or be able to autohide.
48
-     */
49
-    _alwaysVisibleToolbar: boolean,
50
-
51
     /**
46
     /**
52
      * Whether the local participant is recording the conference.
47
      * Whether the local participant is recording the conference.
53
      */
48
      */
105
         FULL_SCREEN_EVENTS.forEach(name =>
100
         FULL_SCREEN_EVENTS.forEach(name =>
106
             document.addEventListener(name, this._onFullScreenChange));
101
             document.addEventListener(name, this._onFullScreenChange));
107
 
102
 
108
-        const { _alwaysVisibleToolbar, dispatch, t } = this.props;
103
+        const { dispatch, t } = this.props;
109
 
104
 
110
         dispatch(connect());
105
         dispatch(connect());
106
+
111
         maybeShowSuboptimalExperienceNotification(dispatch, t);
107
         maybeShowSuboptimalExperienceNotification(dispatch, t);
112
 
108
 
113
-        dispatch(setToolboxAlwaysVisible(
114
-            _alwaysVisibleToolbar || interfaceConfig.filmStripOnly));
109
+        interfaceConfig.filmStripOnly
110
+            && dispatch(setToolboxAlwaysVisible(true));
115
     }
111
     }
116
 
112
 
117
     /**
113
     /**
208
  * @param {Object} state - The Redux state.
204
  * @param {Object} state - The Redux state.
209
  * @private
205
  * @private
210
  * @returns {{
206
  * @returns {{
211
- *     _alwaysVisibleToolbar: boolean,
212
  *     _iAmRecorder: boolean
207
  *     _iAmRecorder: boolean
213
  * }}
208
  * }}
214
  */
209
  */
215
 function _mapStateToProps(state) {
210
 function _mapStateToProps(state) {
216
-    const {
217
-        alwaysVisibleToolbar,
218
-        iAmRecorder
219
-    } = state['features/base/config'];
211
+    const { iAmRecorder } = state['features/base/config'];
220
 
212
 
221
     return {
213
     return {
222
-        /**
223
-         * Whether the toolbar should stay visible or be able to autohide.
224
-         *
225
-         * @private
226
-         */
227
-        _alwaysVisibleToolbar: alwaysVisibleToolbar,
228
-
229
         /**
214
         /**
230
          * Whether the local participant is recording the conference.
215
          * Whether the local participant is recording the conference.
231
          *
216
          *

+ 2
- 2
react/features/toolbox/components/native/Toolbox.js Näytä tiedosto

237
  * }}
237
  * }}
238
  */
238
  */
239
 function _mapStateToProps(state: Object): Object {
239
 function _mapStateToProps(state: Object): Object {
240
-    const { enabled, visible } = state['features/toolbox'];
240
+    const { alwaysVisible, enabled, visible } = state['features/toolbox'];
241
 
241
 
242
     return {
242
     return {
243
-        _visible: enabled && visible
243
+        _visible: enabled && (alwaysVisible || visible)
244
     };
244
     };
245
 }
245
 }
246
 
246
 

+ 23
- 7
react/features/toolbox/reducer.js Näytä tiedosto

31
  * }}
31
  * }}
32
  */
32
  */
33
 function _getInitialState() {
33
 function _getInitialState() {
34
+    // Does the toolbar eventually fade out, or is it always visible?
35
+    let alwaysVisible = false;
36
+
37
+    // Toolbar (initial) visibility.
38
+    let visible = false;
39
+
34
     // Default toolbox timeout for mobile app.
40
     // Default toolbox timeout for mobile app.
35
     let timeoutMS = 5000;
41
     let timeoutMS = 5000;
36
 
42
 
37
-    if (typeof interfaceConfig !== 'undefined'
38
-            && interfaceConfig.INITIAL_TOOLBAR_TIMEOUT) {
39
-        timeoutMS = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
43
+    if (typeof interfaceConfig !== 'undefined') {
44
+        if (interfaceConfig.INITIAL_TOOLBAR_TIMEOUT) {
45
+            timeoutMS = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
46
+        }
47
+        if (typeof interfaceConfig.TOOLBAR_ALWAYS_VISIBLE !== 'undefined') {
48
+            alwaysVisible = interfaceConfig.TOOLBAR_ALWAYS_VISIBLE;
49
+        }
50
+    }
51
+
52
+    // When the toolbar is always visible, it must initially be visible too.
53
+    if (alwaysVisible === true) {
54
+        visible = true;
40
     }
55
     }
41
 
56
 
42
     return {
57
     return {
43
         /**
58
         /**
44
          * The indicator which determines whether the Toolbox should always be
59
          * The indicator which determines whether the Toolbox should always be
45
-         * visible.
60
+         * visible. When false, the toolbar will fade out after timeoutMS.
46
          *
61
          *
47
          * @type {boolean}
62
          * @type {boolean}
48
          */
63
          */
49
-        alwaysVisible: false,
64
+        alwaysVisible,
50
 
65
 
51
         /**
66
         /**
52
          * The indicator which determines whether the Toolbox is enabled.
67
          * The indicator which determines whether the Toolbox is enabled.
91
          *
106
          *
92
          * @type {boolean}
107
          * @type {boolean}
93
          */
108
          */
94
-        visible: false
109
+        visible
95
     };
110
     };
96
 }
111
 }
97
 
112
 
126
         case SET_TOOLBOX_ALWAYS_VISIBLE:
141
         case SET_TOOLBOX_ALWAYS_VISIBLE:
127
             return {
142
             return {
128
                 ...state,
143
                 ...state,
129
-                alwaysVisible: action.alwaysVisible
144
+                alwaysVisible: action.alwaysVisible,
145
+                visible: action.alwaysVisible === true ? true : state.visible
130
             };
146
             };
131
 
147
 
132
         case SET_TOOLBOX_ENABLED:
148
         case SET_TOOLBOX_ENABLED:

Loading…
Peruuta
Tallenna