|
|
@@ -55,6 +55,11 @@ type Props = {
|
|
55
|
55
|
*/
|
|
56
|
56
|
_conference: Object,
|
|
57
|
57
|
|
|
|
58
|
+ /**
|
|
|
59
|
+ * Whether or not desktopsharing was explicitly configured to be disabled.
|
|
|
60
|
+ */
|
|
|
61
|
+ _desktopSharingDisabledByConfig: boolean,
|
|
|
62
|
+
|
|
58
|
63
|
/**
|
|
59
|
64
|
* Whether or not screensharing is initialized.
|
|
60
|
65
|
*/
|
|
|
@@ -855,6 +860,10 @@ class ToolboxV2 extends Component<Props, State> {
|
|
855
|
860
|
* @returns {void}
|
|
856
|
861
|
*/
|
|
857
|
862
|
_onToolbarToggleScreenshare() {
|
|
|
863
|
+ if (!this.props._desktopSharingEnabled) {
|
|
|
864
|
+ return;
|
|
|
865
|
+ }
|
|
|
866
|
+
|
|
858
|
867
|
sendAnalytics(createShortcutEvent(
|
|
859
|
868
|
'toggle.screen.sharing',
|
|
860
|
869
|
ACTION_SHORTCUT_TRIGGERED,
|
|
|
@@ -897,20 +906,35 @@ class ToolboxV2 extends Component<Props, State> {
|
|
897
|
906
|
}
|
|
898
|
907
|
|
|
899
|
908
|
/**
|
|
900
|
|
- * Renders a button for togglein screen sharing.
|
|
|
909
|
+ * Renders a button for toggleing screen sharing.
|
|
901
|
910
|
*
|
|
902
|
911
|
* @private
|
|
903
|
|
- * @returns {ReactElement}
|
|
|
912
|
+ * @returns {ReactElement|null}
|
|
904
|
913
|
*/
|
|
905
|
914
|
_renderDesktopSharingButton() {
|
|
906
|
|
- const { _desktopSharingEnabled, _screensharing, t } = this.props;
|
|
|
915
|
+ const {
|
|
|
916
|
+ _desktopSharingDisabledByConfig,
|
|
|
917
|
+ _desktopSharingEnabled,
|
|
|
918
|
+ _screensharing,
|
|
|
919
|
+ t
|
|
|
920
|
+ } = this.props;
|
|
|
921
|
+
|
|
|
922
|
+ const disabledTooltipText
|
|
|
923
|
+ = interfaceConfig.DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP;
|
|
|
924
|
+ const showDisabledTooltip
|
|
|
925
|
+ = disabledTooltipText && _desktopSharingDisabledByConfig;
|
|
|
926
|
+ const visible = _desktopSharingEnabled || showDisabledTooltip;
|
|
|
927
|
+
|
|
|
928
|
+ if (!visible) {
|
|
|
929
|
+ return null;
|
|
|
930
|
+ }
|
|
|
931
|
+
|
|
907
|
932
|
const classNames = `icon-share-desktop ${
|
|
908
|
933
|
_screensharing ? 'toggled' : ''} ${
|
|
909
|
934
|
_desktopSharingEnabled ? '' : 'disabled'}`;
|
|
910
|
|
- const tooltip = _desktopSharingEnabled
|
|
911
|
|
- ? t('toolbar.sharescreen')
|
|
912
|
|
- : interfaceConfig.DESKTOP_SHARING_BUTTON_DISABLED_TOOLTIP
|
|
913
|
|
- || t('toolbar.sharescreenDisabled');
|
|
|
935
|
+ const tooltip = showDisabledTooltip
|
|
|
936
|
+ ? disabledTooltipText
|
|
|
937
|
+ : t('toolbar.sharescreen');
|
|
914
|
938
|
|
|
915
|
939
|
return (
|
|
916
|
940
|
<ToolbarButtonV2
|
|
|
@@ -1073,6 +1097,7 @@ function _mapStateToProps(state) {
|
|
1073
|
1097
|
} = state['features/base/conference'];
|
|
1074
|
1098
|
const {
|
|
1075
|
1099
|
callStatsID,
|
|
|
1100
|
+ disableDesktopSharing,
|
|
1076
|
1101
|
enableRecording,
|
|
1077
|
1102
|
enableUserRolesBasedOnToken,
|
|
1078
|
1103
|
iAmRecorder
|
|
|
@@ -1101,6 +1126,7 @@ function _mapStateToProps(state) {
|
|
1101
|
1126
|
_chatOpen: current === 'chat_container',
|
|
1102
|
1127
|
_conference: conference,
|
|
1103
|
1128
|
_desktopSharingEnabled: desktopSharingEnabled,
|
|
|
1129
|
+ _desktopSharingDisabledByConfig: disableDesktopSharing,
|
|
1104
|
1130
|
_dialOutAvailable: isDialOutAvailable,
|
|
1105
|
1131
|
_dialog: Boolean(state['features/base/dialog'].component),
|
|
1106
|
1132
|
_editingDocument: Boolean(state['features/etherpad'].editing),
|