浏览代码

feat(mobile) adds feature flags for audioMute, videoMute and overflow… (#8537)

master
tmoldovan8x8 4 年前
父节点
当前提交
dca96f25f3
没有帐户链接到提交者的电子邮件

+ 18
- 1
react/features/base/flags/constants.js 查看文件

@@ -6,6 +6,12 @@
6 6
  */
7 7
 export const ADD_PEOPLE_ENABLED = 'add-people.enabled';
8 8
 
9
+/**
10
+ * Flag indicating if the audio mute button should be displayed.
11
+ * Default: enabled (true).
12
+ */
13
+export const AUDIO_MUTE_BUTTON_ENABLED = 'audio-mute.enabled';
14
+
9 15
 /**
10 16
  * Flag indicating if calendar integration should be enabled.
11 17
  * Default: enabled (true) on Android, auto-detected on iOS.
@@ -81,13 +87,18 @@ export const MEETING_NAME_ENABLED = 'meeting-name.enabled';
81 87
  */
82 88
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
83 89
 
84
-
85 90
 /**
86 91
  * Flag indicating if the notifications should be enabled.
87 92
  * Default: enabled (true).
88 93
  */
89 94
 export const NOTIFICATIONS_ENABLED = 'notifications.enabled';
90 95
 
96
+/**
97
+ * Flag indicating if the audio overflow menu button should be displayed.
98
+ * Default: enabled (true).
99
+ */
100
+export const OVERFLOW_MENU_ENABLED = 'overflow-menu.enabled';
101
+
91 102
 /**
92 103
  * Flag indicating if Picture-in-Picture should be enabled.
93 104
  * Default: auto-detected.
@@ -137,6 +148,12 @@ export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
137 148
  */
138 149
 export const TOOLBOX_ENABLED = 'toolbox.enabled';
139 150
 
151
+/**
152
+ * Flag indicating if the video mute button should be displayed.
153
+ * Default: enabled (true).
154
+ */
155
+export const VIDEO_MUTE_BUTTON_ENABLED = 'video-mute.enabled';
156
+
140 157
 /**
141 158
  * Flag indicating if the video share button should be enabled
142 159
  * Default: enabled (true).

+ 4
- 1
react/features/toolbox/components/AudioMuteButton.js 查看文件

@@ -6,6 +6,7 @@ import {
6 6
     createShortcutEvent,
7 7
     sendAnalytics
8 8
 } from '../../analytics';
9
+import { getFeatureFlag, AUDIO_MUTE_BUTTON_ENABLED } from '../../base/flags';
9 10
 import { translate } from '../../base/i18n';
10 11
 import { MEDIA_TYPE } from '../../base/media';
11 12
 import { connect } from '../../base/redux';
@@ -151,10 +152,12 @@ class AudioMuteButton extends AbstractAudioMuteButton<Props, *> {
151 152
 function _mapStateToProps(state): Object {
152 153
     const _audioMuted = isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.AUDIO);
153 154
     const _disabled = state['features/base/config'].startSilent;
155
+    const enabledFlag = getFeatureFlag(state, AUDIO_MUTE_BUTTON_ENABLED, true);
154 156
 
155 157
     return {
156 158
         _audioMuted,
157
-        _disabled
159
+        _disabled,
160
+        visible: enabledFlag
158 161
     };
159 162
 }
160 163
 

+ 4
- 1
react/features/toolbox/components/VideoMuteButton.js 查看文件

@@ -9,6 +9,7 @@ import {
9 9
     sendAnalytics
10 10
 } from '../../analytics';
11 11
 import { setAudioOnly } from '../../base/audio-only';
12
+import { getFeatureFlag, VIDEO_MUTE_BUTTON_ENABLED } from '../../base/flags';
12 13
 import { translate } from '../../base/i18n';
13 14
 import {
14 15
     VIDEO_MUTISM_AUTHORITY,
@@ -187,12 +188,14 @@ class VideoMuteButton extends AbstractVideoMuteButton<Props, *> {
187 188
 function _mapStateToProps(state): Object {
188 189
     const { enabled: audioOnly } = state['features/base/audio-only'];
189 190
     const tracks = state['features/base/tracks'];
191
+    const enabledFlag = getFeatureFlag(state, VIDEO_MUTE_BUTTON_ENABLED, true);
190 192
 
191 193
     return {
192 194
         _audioOnly: Boolean(audioOnly),
193 195
         _videoDisabled: isVideoMuteButtonDisabled(state),
194 196
         _videoMediaType: getLocalVideoType(tracks),
195
-        _videoMuted: isLocalCameraTrackMuted(tracks)
197
+        _videoMuted: isLocalCameraTrackMuted(tracks),
198
+        visible: enabledFlag
196 199
     };
197 200
 }
198 201
 

+ 18
- 1
react/features/toolbox/components/native/OverflowMenuButton.js 查看文件

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { openDialog } from '../../../base/dialog';
4
+import { getFeatureFlag, OVERFLOW_MENU_ENABLED } from '../../../base/flags';
4 5
 import { translate } from '../../../base/i18n';
5 6
 import { IconMenuThumb } from '../../../base/icons';
6 7
 import { connect } from '../../../base/redux';
@@ -38,4 +39,20 @@ class OverflowMenuButton extends AbstractButton<Props, *> {
38 39
     }
39 40
 }
40 41
 
41
-export default translate(connect()(OverflowMenuButton));
42
+/**
43
+ * Maps (parts of) the redux state to the associated props for the
44
+ * {@code OverflowMenuButton} component.
45
+ *
46
+ * @param {Object} state - The Redux state.
47
+ * @private
48
+ * @returns {Props}
49
+ */
50
+function _mapStateToProps(state): Object {
51
+    const enabledFlag = getFeatureFlag(state, OVERFLOW_MENU_ENABLED, true);
52
+
53
+    return {
54
+        visible: enabledFlag
55
+    };
56
+}
57
+
58
+export default translate(connect(_mapStateToProps)(OverflowMenuButton));

正在加载...
取消
保存