Просмотр исходного кода

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 лет назад
Родитель
Сommit
acc41e6d0b

+ 0
- 1
config.js Просмотреть файл

@@ -341,7 +341,6 @@ var config = {
341 341
 
342 342
     // List of undocumented settings used in jitsi-meet
343 343
     /**
344
-     alwaysVisibleToolbar
345 344
      autoRecord
346 345
      autoRecordToken
347 346
      debug

+ 1
- 0
interface_config.js Просмотреть файл

@@ -13,6 +13,7 @@ var interfaceConfig = {
13 13
     DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP: null,
14 14
     INITIAL_TOOLBAR_TIMEOUT: 20000,
15 15
     TOOLBAR_TIMEOUT: 4000,
16
+    TOOLBAR_ALWAYS_VISIBLE: false,
16 17
     DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
17 18
     DEFAULT_LOCAL_DISPLAY_NAME: 'me',
18 19
     SHOW_JITSI_WATERMARK: true,

+ 0
- 1
react/features/base/config/functions.js Просмотреть файл

@@ -20,7 +20,6 @@ const WHITELISTED_KEYS = [
20 20
     '_peerConnStatusOutOfLastNTimeout',
21 21
     '_peerConnStatusRtcMuteTimeout',
22 22
     'abTesting',
23
-    'alwaysVisibleToolbar',
24 23
     'autoRecord',
25 24
     'autoRecordToken',
26 25
     'avgRtpStatsN',

+ 24
- 3
react/features/conference/components/Conference.native.js Просмотреть файл

@@ -90,7 +90,14 @@ type Props = {
90 90
      *
91 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,6 +285,10 @@ class Conference extends Component<Props> {
278 285
      * @returns {void}
279 286
      */
280 287
     _onClick() {
288
+        if (this.props._toolboxAlwaysVisible) {
289
+            return;
290
+        }
291
+
281 292
         const toolboxVisible = !this.props._toolboxVisible;
282 293
 
283 294
         this.props._setToolboxVisible(toolboxVisible);
@@ -384,13 +395,15 @@ function _mapDispatchToProps(dispatch) {
384 395
  *     _connecting: boolean,
385 396
  *     _participantCount: number,
386 397
  *     _reducedUI: boolean,
387
- *     _toolboxVisible: boolean
398
+ *     _toolboxVisible: boolean,
399
+ *     _toolboxAlwaysVisible: boolean
388 400
  * }}
389 401
  */
390 402
 function _mapStateToProps(state) {
391 403
     const { connecting, connection } = state['features/base/connection'];
392 404
     const { conference, joining, leaving } = state['features/base/conference'];
393 405
     const { reducedUI } = state['features/base/responsive-ui'];
406
+    const { alwaysVisible, visible } = state['features/toolbox'];
394 407
 
395 408
     // XXX There is a window of time between the successful establishment of the
396 409
     // XMPP connection and the subsequent commencement of joining the MUC during
@@ -439,7 +452,15 @@ function _mapStateToProps(state) {
439 452
          * @private
440 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 Просмотреть файл

@@ -43,11 +43,6 @@ const FULL_SCREEN_EVENTS = [
43 43
  */
44 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 47
      * Whether the local participant is recording the conference.
53 48
      */
@@ -105,13 +100,14 @@ class Conference extends Component<Props> {
105 100
         FULL_SCREEN_EVENTS.forEach(name =>
106 101
             document.addEventListener(name, this._onFullScreenChange));
107 102
 
108
-        const { _alwaysVisibleToolbar, dispatch, t } = this.props;
103
+        const { dispatch, t } = this.props;
109 104
 
110 105
         dispatch(connect());
106
+
111 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,24 +204,13 @@ class Conference extends Component<Props> {
208 204
  * @param {Object} state - The Redux state.
209 205
  * @private
210 206
  * @returns {{
211
- *     _alwaysVisibleToolbar: boolean,
212 207
  *     _iAmRecorder: boolean
213 208
  * }}
214 209
  */
215 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 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 215
          * Whether the local participant is recording the conference.
231 216
          *

+ 2
- 2
react/features/toolbox/components/native/Toolbox.js Просмотреть файл

@@ -237,10 +237,10 @@ class Toolbox extends Component<Props, State> {
237 237
  * }}
238 238
  */
239 239
 function _mapStateToProps(state: Object): Object {
240
-    const { enabled, visible } = state['features/toolbox'];
240
+    const { alwaysVisible, enabled, visible } = state['features/toolbox'];
241 241
 
242 242
     return {
243
-        _visible: enabled && visible
243
+        _visible: enabled && (alwaysVisible || visible)
244 244
     };
245 245
 }
246 246
 

+ 23
- 7
react/features/toolbox/reducer.js Просмотреть файл

@@ -31,22 +31,37 @@ declare var interfaceConfig: Object;
31 31
  * }}
32 32
  */
33 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 40
     // Default toolbox timeout for mobile app.
35 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 57
     return {
43 58
         /**
44 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 62
          * @type {boolean}
48 63
          */
49
-        alwaysVisible: false,
64
+        alwaysVisible,
50 65
 
51 66
         /**
52 67
          * The indicator which determines whether the Toolbox is enabled.
@@ -91,7 +106,7 @@ function _getInitialState() {
91 106
          *
92 107
          * @type {boolean}
93 108
          */
94
-        visible: false
109
+        visible
95 110
     };
96 111
 }
97 112
 
@@ -126,7 +141,8 @@ ReducerRegistry.register(
126 141
         case SET_TOOLBOX_ALWAYS_VISIBLE:
127 142
             return {
128 143
                 ...state,
129
-                alwaysVisible: action.alwaysVisible
144
+                alwaysVisible: action.alwaysVisible,
145
+                visible: action.alwaysVisible === true ? true : state.visible
130 146
             };
131 147
 
132 148
         case SET_TOOLBOX_ENABLED:

Загрузка…
Отмена
Сохранить