diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js index 2d3e2dd58..a32ecf80d 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 a39f0ca5b..83907d1e3 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 { * 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 }; }