Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(flags) add feature flag for audio-only button

trippledave68c2c9be407b
diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js
index e126d9b7b2..4457852745 100644
--- a/react/features/base/flags/constants.js
+++ b/react/features/base/flags/constants.js
@@ -19,6 +19,12 @@ export const AUDIO_FOCUS_DISABLED = 'audio-focus.disabled';
*/
export const AUDIO_MUTE_BUTTON_ENABLED = 'audio-mute.enabled';
+/**
+ * Flag indicating that the Audio only button in the overflow menu is enabled.
+ * Default: enabled (true).
+ */
+export const AUDIO_ONLY_BUTTON_ENABLED = 'audio-only.enabled';
+
/**
* Flag indicating if calendar integration should be enabled.
* Default: enabled (true) on Android, auto-detected on iOS.
diff --git a/react/features/toolbox/components/native/AudioOnlyButton.js b/react/features/toolbox/components/native/AudioOnlyButton.js
index 29fe05ea55..eb49db51fc 100644
--- a/react/features/toolbox/components/native/AudioOnlyButton.js
+++ b/react/features/toolbox/components/native/AudioOnlyButton.js
@@ -1,6 +1,7 @@
// @flow
import { toggleAudioOnly } from '../../../base/audio-only';
+import { AUDIO_ONLY_BUTTON_ENABLED, getFeatureFlag } from '../../../base/flags';
import { translate } from '../../../base/i18n';
import { IconAudioOnly, IconAudioOnlyOff } from '../../../base/icons';
import { connect } from '../../../base/redux';
@@ -60,16 +61,20 @@ class AudioOnlyButton extends AbstractButton<Props, *> {
* {@code AudioOnlyButton} component.
*
* @param {Object} state - The Redux state.
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
* @private
* @returns {{
* _audioOnly: boolean
* }}
*/
-function _mapStateToProps(state): Object {
+function _mapStateToProps(state, ownProps): Object {
const { enabled: audioOnly } = state['features/base/audio-only'];
+ const enabledInFeatureFlags = getFeatureFlag(state, AUDIO_ONLY_BUTTON_ENABLED, true);
+ const { visible = enabledInFeatureFlags } = ownProps;
return {
- _audioOnly: Boolean(audioOnly)
+ _audioOnly: Boolean(audioOnly),
+ visible
};
}