Browse Source

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

master
tmoldovan8x8 4 years ago
parent
commit
dca96f25f3
No account linked to committer's email address

+ 18
- 1
react/features/base/flags/constants.js View File

6
  */
6
  */
7
 export const ADD_PEOPLE_ENABLED = 'add-people.enabled';
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
  * Flag indicating if calendar integration should be enabled.
16
  * Flag indicating if calendar integration should be enabled.
11
  * Default: enabled (true) on Android, auto-detected on iOS.
17
  * Default: enabled (true) on Android, auto-detected on iOS.
81
  */
87
  */
82
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
88
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
83
 
89
 
84
-
85
 /**
90
 /**
86
  * Flag indicating if the notifications should be enabled.
91
  * Flag indicating if the notifications should be enabled.
87
  * Default: enabled (true).
92
  * Default: enabled (true).
88
  */
93
  */
89
 export const NOTIFICATIONS_ENABLED = 'notifications.enabled';
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
  * Flag indicating if Picture-in-Picture should be enabled.
103
  * Flag indicating if Picture-in-Picture should be enabled.
93
  * Default: auto-detected.
104
  * Default: auto-detected.
137
  */
148
  */
138
 export const TOOLBOX_ENABLED = 'toolbox.enabled';
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
  * Flag indicating if the video share button should be enabled
158
  * Flag indicating if the video share button should be enabled
142
  * Default: enabled (true).
159
  * Default: enabled (true).

+ 4
- 1
react/features/toolbox/components/AudioMuteButton.js View File

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

+ 4
- 1
react/features/toolbox/components/VideoMuteButton.js View File

9
     sendAnalytics
9
     sendAnalytics
10
 } from '../../analytics';
10
 } from '../../analytics';
11
 import { setAudioOnly } from '../../base/audio-only';
11
 import { setAudioOnly } from '../../base/audio-only';
12
+import { getFeatureFlag, VIDEO_MUTE_BUTTON_ENABLED } from '../../base/flags';
12
 import { translate } from '../../base/i18n';
13
 import { translate } from '../../base/i18n';
13
 import {
14
 import {
14
     VIDEO_MUTISM_AUTHORITY,
15
     VIDEO_MUTISM_AUTHORITY,
187
 function _mapStateToProps(state): Object {
188
 function _mapStateToProps(state): Object {
188
     const { enabled: audioOnly } = state['features/base/audio-only'];
189
     const { enabled: audioOnly } = state['features/base/audio-only'];
189
     const tracks = state['features/base/tracks'];
190
     const tracks = state['features/base/tracks'];
191
+    const enabledFlag = getFeatureFlag(state, VIDEO_MUTE_BUTTON_ENABLED, true);
190
 
192
 
191
     return {
193
     return {
192
         _audioOnly: Boolean(audioOnly),
194
         _audioOnly: Boolean(audioOnly),
193
         _videoDisabled: isVideoMuteButtonDisabled(state),
195
         _videoDisabled: isVideoMuteButtonDisabled(state),
194
         _videoMediaType: getLocalVideoType(tracks),
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 View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { openDialog } from '../../../base/dialog';
3
 import { openDialog } from '../../../base/dialog';
4
+import { getFeatureFlag, OVERFLOW_MENU_ENABLED } from '../../../base/flags';
4
 import { translate } from '../../../base/i18n';
5
 import { translate } from '../../../base/i18n';
5
 import { IconMenuThumb } from '../../../base/icons';
6
 import { IconMenuThumb } from '../../../base/icons';
6
 import { connect } from '../../../base/redux';
7
 import { connect } from '../../../base/redux';
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));

Loading…
Cancel
Save