浏览代码

feat(config) add connection indicators flags

master
Tudor D. Pop 3 年前
父节点
当前提交
d95d52843f
没有帐户链接到提交者的电子邮件

+ 8
- 0
config.js 查看文件

253
     // Default value for the channel "last N" attribute. -1 for unlimited.
253
     // Default value for the channel "last N" attribute. -1 for unlimited.
254
     channelLastN: -1,
254
     channelLastN: -1,
255
 
255
 
256
+    // Connection indicators
257
+    // connectionIndicators: {
258
+    //     autoHide: true,
259
+    //     autoHideTimeout: 5000,
260
+    //     disabled: false,
261
+    //     inactiveDisabled: false
262
+    // },
263
+
256
     // Provides a way for the lastN value to be controlled through the UI.
264
     // Provides a way for the lastN value to be controlled through the UI.
257
     // When startLastN is present, conference starts with a last-n value of startLastN and channelLastN
265
     // When startLastN is present, conference starts with a last-n value of startLastN and channelLastN
258
     // value will be used when the quality level is selected using "Manage Video Quality" slider.
266
     // value will be used when the quality level is selected using "Manage Video Quality" slider.

+ 8
- 28
interface_config.js 查看文件

25
     BRAND_WATERMARK_LINK: '',
25
     BRAND_WATERMARK_LINK: '',
26
 
26
 
27
     CLOSE_PAGE_GUEST_HINT: false, // A html text to be shown to guests on the close page, false disables it
27
     CLOSE_PAGE_GUEST_HINT: false, // A html text to be shown to guests on the close page, false disables it
28
-    /**
29
-     * Whether the connection indicator icon should hide itself based on
30
-     * connection strength. If true, the connection indicator will remain
31
-     * displayed while the participant has a weak connection and will hide
32
-     * itself after the CONNECTION_INDICATOR_HIDE_TIMEOUT when the connection is
33
-     * strong.
34
-     *
35
-     * @type {boolean}
36
-     */
37
-    CONNECTION_INDICATOR_AUTO_HIDE_ENABLED: true,
38
 
28
 
39
-    /**
40
-     * How long the connection indicator should remain displayed before hiding.
41
-     * Used in conjunction with CONNECTION_INDICATOR_AUTOHIDE_ENABLED.
42
-     *
43
-     * @type {number}
44
-     */
45
-    CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT: 5000,
46
-
47
-    /**
48
-     * If true, hides the connection indicators completely.
49
-     *
50
-     * @type {boolean}
51
-     */
52
-    CONNECTION_INDICATOR_DISABLED: false,
29
+    // Connection indicators (
30
+    // CONNECTION_INDICATOR_AUTO_HIDE_ENABLED,
31
+    // CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT,
32
+    // CONNECTION_INDICATOR_DISABLED) got moved to config.js.
53
 
33
 
54
     DEFAULT_BACKGROUND: '#474747',
34
     DEFAULT_BACKGROUND: '#474747',
55
     DEFAULT_LOCAL_DISPLAY_NAME: 'me',
35
     DEFAULT_LOCAL_DISPLAY_NAME: 'me',
185
     SHOW_BRAND_WATERMARK: false,
165
     SHOW_BRAND_WATERMARK: false,
186
 
166
 
187
     /**
167
     /**
188
-    * Decides whether the chrome extension banner should be rendered on the landing page and during the meeting.
189
-    * If this is set to false, the banner will not be rendered at all. If set to true, the check for extension(s)
190
-    * being already installed is done before rendering.
191
-    */
168
+     * Decides whether the chrome extension banner should be rendered on the landing page and during the meeting.
169
+     * If this is set to false, the banner will not be rendered at all. If set to true, the check for extension(s)
170
+     * being already installed is done before rendering.
171
+     */
192
     SHOW_CHROME_EXTENSION_BANNER: false,
172
     SHOW_CHROME_EXTENSION_BANNER: false,
193
 
173
 
194
     SHOW_DEEP_LINKING_IMAGE: false,
174
     SHOW_DEEP_LINKING_IMAGE: false,

+ 1
- 0
react/features/base/config/configWhitelist.js 查看文件

70
     'callUUID',
70
     'callUUID',
71
 
71
 
72
     'channelLastN',
72
     'channelLastN',
73
+    'connectionIndicators',
73
     'constraints',
74
     'constraints',
74
     'brandingRoomAlias',
75
     'brandingRoomAlias',
75
     'debug',
76
     'debug',

+ 12
- 0
react/features/base/config/reducer.js 查看文件

194
         newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
194
         newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
195
     }
195
     }
196
 
196
 
197
+    if (!oldValue.connectionIndicators
198
+            && typeof interfaceConfig === 'object'
199
+            && (interfaceConfig.hasOwnProperty('CONNECTION_INDICATOR_DISABLED')
200
+                || interfaceConfig.hasOwnProperty('CONNECTION_INDICATOR_AUTO_HIDE_ENABLED')
201
+                || interfaceConfig.hasOwnProperty('CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT'))) {
202
+        newValue.connectionIndicators = {
203
+            disabled: interfaceConfig.CONNECTION_INDICATOR_DISABLED,
204
+            autoHide: interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED,
205
+            autoHideTimeout: interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT
206
+        };
207
+    }
208
+
197
     if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
209
     if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
198
         newValue.audioQuality = {
210
         newValue.audioQuality = {
199
             opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,
211
             opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,

+ 25
- 4
react/features/connection-indicator/components/AbstractConnectionIndicator.js 查看文件

6
 
6
 
7
 declare var interfaceConfig: Object;
7
 declare var interfaceConfig: Object;
8
 
8
 
9
+const defaultAutoHideTimeout = 5000;
10
+
9
 /**
11
 /**
10
  * The connection quality percentage that must be reached to be considered of
12
  * The connection quality percentage that must be reached to be considered of
11
  * good quality and can result in the connection indicator being hidden.
13
  * good quality and can result in the connection indicator being hidden.
19
  */
21
  */
20
 export type Props = {
22
 export type Props = {
21
 
23
 
24
+    /**
25
+     * How long the connection indicator should remain displayed before hiding.
26
+     */
27
+    _autoHideTimeout: number,
28
+
22
     /**
29
     /**
23
      * The ID of the participant associated with the displayed connection indication and
30
      * The ID of the participant associated with the displayed connection indication and
24
      * stats.
31
      * stats.
52
  *
59
  *
53
  * @extends {Component}
60
  * @extends {Component}
54
  */
61
  */
55
-export default class AbstractConnectionIndicator<P: Props, S: State> extends Component<P, S> {
62
+class AbstractConnectionIndicator<P: Props, S: State> extends Component<P, S> {
56
     /**
63
     /**
57
      * The timeout for automatically hiding the indicator.
64
      * The timeout for automatically hiding the indicator.
58
      */
65
      */
165
                 this.setState({
172
                 this.setState({
166
                     showIndicator: false
173
                     showIndicator: false
167
                 });
174
                 });
168
-            }, typeof interfaceConfig === 'undefined'
169
-                ? 5000
170
-                : interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT);
175
+            }, this.props._autoHideTimeout);
171
         }
176
         }
172
     }
177
     }
173
 }
178
 }
179
+
180
+/**
181
+ * Maps (parts of) the Redux state to the associated props for the
182
+ * {@code ConnectorIndicator} component.
183
+ *
184
+ * @param {Object} state - The Redux state.
185
+ * @private
186
+ * @returns {Props}
187
+ */
188
+export function mapStateToProps(state: Object) {
189
+    return {
190
+        _autoHideTimeout: state['features/base/config'].connectionIndicators.autoHideTimeout ?? defaultAutoHideTimeout
191
+    };
192
+}
193
+
194
+export default AbstractConnectionIndicator;

+ 12
- 2
react/features/connection-indicator/components/web/ConnectionIndicator.js 查看文件

64
      */
64
      */
65
     _connectionStatus: string,
65
     _connectionStatus: string,
66
 
66
 
67
+    /**
68
+     * Disable/enable inactive indicator.
69
+     */
70
+    _connectionIndicatorInactiveDisabled: boolean,
71
+
67
     /**
72
     /**
68
      * Whether or not the component should ignore setting a visibility class for
73
      * Whether or not the component should ignore setting a visibility class for
69
      * hiding the component when the connection quality is not strong.
74
      * hiding the component when the connection quality is not strong.
224
      * @returns {ReactElement}
229
      * @returns {ReactElement}
225
      */
230
      */
226
     _renderIcon() {
231
     _renderIcon() {
227
-        if (this.props._connectionStatus
228
-            === JitsiParticipantConnectionStatus.INACTIVE) {
232
+        if (this.props._connectionStatus === JitsiParticipantConnectionStatus.INACTIVE) {
233
+            if (this.props._connectionIndicatorInactiveDisabled) {
234
+                return null;
235
+            }
236
+
229
             return (
237
             return (
230
                 <span className = 'connection_ninja'>
238
                 <span className = 'connection_ninja'>
231
                     <Icon
239
                     <Icon
289
         = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
297
         = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
290
 
298
 
291
     return {
299
     return {
300
+        _connectionIndicatorInactiveDisabled:
301
+        Boolean(state['features/base/config'].connectionIndicators?.inactiveDisabled),
292
         _connectionStatus: participant?.connectionStatus
302
         _connectionStatus: participant?.connectionStatus
293
     };
303
     };
294
 }
304
 }

+ 4
- 2
react/features/filmstrip/components/web/Thumbnail.js 查看文件

1093
 
1093
 
1094
     return {
1094
     return {
1095
         _audioTrack,
1095
         _audioTrack,
1096
-        _connectionIndicatorAutoHideEnabled: interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED,
1097
-        _connectionIndicatorDisabled: _isMobile || interfaceConfig.CONNECTION_INDICATOR_DISABLED,
1096
+        _connectionIndicatorAutoHideEnabled:
1097
+        Boolean(state['features/base/config'].connectionIndicators?.autoHide ?? true),
1098
+        _connectionIndicatorDisabled: _isMobile
1099
+            || Boolean(state['features/base/config'].connectionIndicators?.disabled),
1098
         _currentLayout,
1100
         _currentLayout,
1099
         _defaultLocalDisplayName: interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME,
1101
         _defaultLocalDisplayName: interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME,
1100
         _disableLocalVideoFlip: Boolean(disableLocalVideoFlip),
1102
         _disableLocalVideoFlip: Boolean(disableLocalVideoFlip),

正在加载...
取消
保存