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