Skip to content

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

rn,flags: add flag to show/hide video share button

utkarshmarwaha7f5751b9185b
diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js
index 2d3e2dd588..a32ecf80d4 100644
--- a/react/features/base/flags/constants.js
+++ b/react/features/base/flags/constants.js
@@ -112,6 +112,12 @@ export const TILE_VIEW_ENABLED = 'tile-view.enabled';
*/
export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
+/**
+ * Flag indicating if the video share button should be enabled
+ * Default: enabled (true).
+ */
+export const VIDEO_SHARE_BUTTON_ENABLED = 'video-share.enabled';
+
/**
* Flag indicating if the welcome page should be enabled.
* Default: disabled (false).
diff --git a/react/features/youtube-player/components/VideoShareButton.js b/react/features/youtube-player/components/VideoShareButton.js
index a39f0ca5ba..83907d1e3d 100644
--- a/react/features/youtube-player/components/VideoShareButton.js
+++ b/react/features/youtube-player/components/VideoShareButton.js
@@ -2,6 +2,7 @@
import type { Dispatch } from 'redux';
+import { getFeatureFlag, VIDEO_SHARE_BUTTON_ENABLED } from '../../base/flags';
import { translate } from '../../base/i18n';
import { IconShareVideo } from '../../base/icons';
import { getLocalParticipant } from '../../base/participants';
@@ -90,21 +91,26 @@ class VideoShareButton extends AbstractButton<Props, *> {
* Maps part of the Redux state to the props of this component.
*
* @param {Object} state - The Redux state.
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
* @private
* @returns {Props}
*/
-function _mapStateToProps(state): Object {
+function _mapStateToProps(state, ownProps): Object {
const { ownerId, status: sharedVideoStatus } = state['features/youtube-player'];
const localParticipantId = getLocalParticipant(state).id;
+ const enabled = getFeatureFlag(state, VIDEO_SHARE_BUTTON_ENABLED, true);
+ const { visible = enabled } = ownProps;
if (ownerId !== localParticipantId) {
return {
_isDisabled: isSharingStatus(sharedVideoStatus),
- _sharingVideo: false };
+ _sharingVideo: false,
+ visible };
}
return {
- _sharingVideo: isSharingStatus(sharedVideoStatus)
+ _sharingVideo: isSharingStatus(sharedVideoStatus),
+ visible
};
}