Browse Source

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

master
utkarshmarwaha 5 years ago
parent
commit
7f5751b918
No account linked to committer's email address

+ 6
- 0
react/features/base/flags/constants.js View File

112
  */
112
  */
113
 export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
113
 export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
114
 
114
 
115
+/**
116
+ * Flag indicating if the video share button should be enabled
117
+ * Default: enabled (true).
118
+ */
119
+export const VIDEO_SHARE_BUTTON_ENABLED = 'video-share.enabled';
120
+
115
 /**
121
 /**
116
  * Flag indicating if the welcome page should be enabled.
122
  * Flag indicating if the welcome page should be enabled.
117
  * Default: disabled (false).
123
  * Default: disabled (false).

+ 9
- 3
react/features/youtube-player/components/VideoShareButton.js View File

2
 
2
 
3
 import type { Dispatch } from 'redux';
3
 import type { Dispatch } from 'redux';
4
 
4
 
5
+import { getFeatureFlag, VIDEO_SHARE_BUTTON_ENABLED } from '../../base/flags';
5
 import { translate } from '../../base/i18n';
6
 import { translate } from '../../base/i18n';
6
 import { IconShareVideo } from '../../base/icons';
7
 import { IconShareVideo } from '../../base/icons';
7
 import { getLocalParticipant } from '../../base/participants';
8
 import { getLocalParticipant } from '../../base/participants';
90
  * Maps part of the Redux state to the props of this component.
91
  * Maps part of the Redux state to the props of this component.
91
  *
92
  *
92
  * @param {Object} state - The Redux state.
93
  * @param {Object} state - The Redux state.
94
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
93
  * @private
95
  * @private
94
  * @returns {Props}
96
  * @returns {Props}
95
  */
97
  */
96
-function _mapStateToProps(state): Object {
98
+function _mapStateToProps(state, ownProps): Object {
97
     const { ownerId, status: sharedVideoStatus } = state['features/youtube-player'];
99
     const { ownerId, status: sharedVideoStatus } = state['features/youtube-player'];
98
     const localParticipantId = getLocalParticipant(state).id;
100
     const localParticipantId = getLocalParticipant(state).id;
101
+    const enabled = getFeatureFlag(state, VIDEO_SHARE_BUTTON_ENABLED, true);
102
+    const { visible = enabled } = ownProps;
99
 
103
 
100
     if (ownerId !== localParticipantId) {
104
     if (ownerId !== localParticipantId) {
101
         return {
105
         return {
102
             _isDisabled: isSharingStatus(sharedVideoStatus),
106
             _isDisabled: isSharingStatus(sharedVideoStatus),
103
-            _sharingVideo: false };
107
+            _sharingVideo: false,
108
+            visible };
104
     }
109
     }
105
 
110
 
106
     return {
111
     return {
107
-        _sharingVideo: isSharingStatus(sharedVideoStatus)
112
+        _sharingVideo: isSharingStatus(sharedVideoStatus),
113
+        visible
108
     };
114
     };
109
 }
115
 }
110
 
116
 

Loading…
Cancel
Save