Client: Camera as content as conent added to disabled features
This commit is contained in:
parent
6e1d2dd550
commit
294fda2c6f
@ -35,6 +35,7 @@ const propTypes = {
|
||||
setMeetingLayout: PropTypes.func.isRequired,
|
||||
setPushLayout: PropTypes.func.isRequired,
|
||||
showPushLayout: PropTypes.bool.isRequired,
|
||||
isCameraAsContentEnabled: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
@ -193,33 +194,27 @@ class ActionsDropdown extends PureComponent {
|
||||
isCameraAsContentEnabled,
|
||||
} = this.props;
|
||||
|
||||
const {
|
||||
pollBtnLabel,
|
||||
presentationLabel,
|
||||
takePresenter,
|
||||
} = intlMessages;
|
||||
const { pollBtnLabel, presentationLabel, takePresenter } = intlMessages;
|
||||
|
||||
const {
|
||||
formatMessage,
|
||||
} = intl;
|
||||
const { formatMessage } = intl;
|
||||
|
||||
const actions = [];
|
||||
|
||||
if (amIPresenter && isPresentationEnabled()) {
|
||||
actions.push({
|
||||
icon: "upload",
|
||||
dataTest: "managePresentations",
|
||||
icon: 'upload',
|
||||
dataTest: 'managePresentations',
|
||||
label: formatMessage(presentationLabel),
|
||||
key: this.presentationItemId,
|
||||
onClick: handlePresentationClick,
|
||||
dividerTop: this.props?.presentations?.length > 1 ? true : false,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (amIPresenter && isPollingEnabled) {
|
||||
actions.push({
|
||||
icon: "polling",
|
||||
dataTest: "polling",
|
||||
icon: 'polling',
|
||||
dataTest: 'polling',
|
||||
label: formatMessage(pollBtnLabel),
|
||||
key: this.pollId,
|
||||
onClick: () => {
|
||||
@ -236,12 +231,12 @@ class ActionsDropdown extends PureComponent {
|
||||
});
|
||||
Session.set('forcePollOpen', true);
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (!amIPresenter && amIModerator) {
|
||||
actions.push({
|
||||
icon: "presentation",
|
||||
icon: 'presentation',
|
||||
label: formatMessage(takePresenter),
|
||||
key: this.takePresenterId,
|
||||
onClick: () => handleTakePresenter(),
|
||||
@ -250,29 +245,31 @@ class ActionsDropdown extends PureComponent {
|
||||
|
||||
if (amIPresenter && allowExternalVideo) {
|
||||
actions.push({
|
||||
icon: !isSharingVideo ? "external-video" : "external-video_off",
|
||||
label: !isSharingVideo ? intl.formatMessage(intlMessages.startExternalVideoLabel)
|
||||
icon: !isSharingVideo ? 'external-video' : 'external-video_off',
|
||||
label: !isSharingVideo
|
||||
? intl.formatMessage(intlMessages.startExternalVideoLabel)
|
||||
: intl.formatMessage(intlMessages.stopExternalVideoLabel),
|
||||
key: "external-video",
|
||||
key: 'external-video',
|
||||
onClick: isSharingVideo ? stopExternalVideoShare : this.handleExternalVideoClick,
|
||||
dataTest: "shareExternalVideo",
|
||||
})
|
||||
dataTest: 'shareExternalVideo',
|
||||
});
|
||||
}
|
||||
|
||||
if (amIPresenter && isSelectRandomUserEnabled) {
|
||||
actions.push({
|
||||
icon: "user",
|
||||
icon: 'user',
|
||||
label: intl.formatMessage(intlMessages.selectRandUserLabel),
|
||||
key: this.selectUserRandId,
|
||||
onClick: () => this.setRandomUserSelectModalIsOpen(true),
|
||||
dataTest: "selectRandomUser",
|
||||
})
|
||||
dataTest: 'selectRandomUser',
|
||||
});
|
||||
}
|
||||
|
||||
if (amIModerator && isTimerEnabled && isTimerFeatureEnabled()) {
|
||||
actions.push({
|
||||
icon: 'time',
|
||||
label: isTimerActive ? intl.formatMessage(intlMessages.deactivateTimerLabel)
|
||||
label: isTimerActive
|
||||
? intl.formatMessage(intlMessages.deactivateTimerLabel)
|
||||
: intl.formatMessage(intlMessages.activateTimerLabel),
|
||||
key: this.timerId,
|
||||
onClick: () => this.handleTimerClick(),
|
||||
@ -289,7 +286,7 @@ class ActionsDropdown extends PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
if (isLayoutsEnabled()){
|
||||
if (isLayoutsEnabled()) {
|
||||
actions.push({
|
||||
icon: 'send',
|
||||
label: intl.formatMessage(intlMessages.layoutModal),
|
||||
@ -300,6 +297,7 @@ class ActionsDropdown extends PureComponent {
|
||||
}
|
||||
|
||||
if (isCameraAsContentEnabled && amIPresenter && !isMobile) {
|
||||
console.log(isCameraAsContentEnabled);
|
||||
actions.push({
|
||||
icon: hasCameraAsContent ? 'video_off' : 'video',
|
||||
label: hasCameraAsContent
|
||||
@ -309,9 +307,9 @@ class ActionsDropdown extends PureComponent {
|
||||
onClick: hasCameraAsContent
|
||||
? screenshareHasEnded
|
||||
: () => {
|
||||
screenshareHasEnded();
|
||||
this.setCameraAsContentModalIsOpen(true);
|
||||
},
|
||||
screenshareHasEnded();
|
||||
this.setCameraAsContentModalIsOpen(true);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -319,11 +317,7 @@ class ActionsDropdown extends PureComponent {
|
||||
}
|
||||
|
||||
makePresentationItems() {
|
||||
const {
|
||||
presentations,
|
||||
setPresentation,
|
||||
podIds,
|
||||
} = this.props;
|
||||
const { presentations, setPresentation, podIds } = this.props;
|
||||
|
||||
if (!podIds || podIds.length < 1) return [];
|
||||
|
||||
@ -332,57 +326,57 @@ class ActionsDropdown extends PureComponent {
|
||||
const { podId } = podIds[0];
|
||||
|
||||
const presentationItemElements = presentations
|
||||
.sort((a, b) => (a.name.localeCompare(b.name)))
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map((p) => {
|
||||
const customStyles = { color: colorPrimary };
|
||||
|
||||
return (
|
||||
{
|
||||
customStyles: p.current ? customStyles : null,
|
||||
icon: "file",
|
||||
iconRight: p.current ? 'check' : null,
|
||||
selected: p.current ? true : false,
|
||||
label: p.name,
|
||||
description: "uploaded presentation file",
|
||||
key: `uploaded-presentation-${p.id}`,
|
||||
onClick: () => {
|
||||
setPresentation(p.id, podId);
|
||||
},
|
||||
}
|
||||
);
|
||||
return {
|
||||
customStyles: p.current ? customStyles : null,
|
||||
icon: 'file',
|
||||
iconRight: p.current ? 'check' : null,
|
||||
selected: p.current ? true : false,
|
||||
label: p.name,
|
||||
description: 'uploaded presentation file',
|
||||
key: `uploaded-presentation-${p.id}`,
|
||||
onClick: () => {
|
||||
setPresentation(p.id, podId);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return presentationItemElements;
|
||||
}
|
||||
|
||||
setExternalVideoModalIsOpen(value) {
|
||||
this.setState({isExternalVideoModalOpen: value});
|
||||
this.setState({ isExternalVideoModalOpen: value });
|
||||
}
|
||||
setRandomUserSelectModalIsOpen(value) {
|
||||
this.setState({isRandomUserSelectModalOpen: value});
|
||||
this.setState({ isRandomUserSelectModalOpen: value });
|
||||
}
|
||||
setLayoutModalIsOpen(value) {
|
||||
this.setState({isLayoutModalOpen: value});
|
||||
this.setState({ isLayoutModalOpen: value });
|
||||
}
|
||||
setCameraAsContentModalIsOpen(value) {
|
||||
this.setState({isCameraAsContentModalOpen: value});
|
||||
this.setState({ isCameraAsContentModalOpen: value });
|
||||
}
|
||||
setPropsToPassModal(value) {
|
||||
this.setState({propsToPassModal: value});
|
||||
this.setState({ propsToPassModal: value });
|
||||
}
|
||||
setForceOpen(value){
|
||||
this.setState({forceOpen: value});
|
||||
setForceOpen(value) {
|
||||
this.setState({ forceOpen: value });
|
||||
}
|
||||
|
||||
renderModal(isOpen, setIsOpen, priority, Component) {
|
||||
return isOpen ? <Component
|
||||
{...{
|
||||
onRequestClose: () => setIsOpen(false),
|
||||
priority,
|
||||
setIsOpen,
|
||||
isOpen
|
||||
}}
|
||||
/> : null
|
||||
return isOpen ? (
|
||||
<Component
|
||||
{...{
|
||||
onRequestClose: () => setIsOpen(false),
|
||||
priority,
|
||||
setIsOpen,
|
||||
isOpen,
|
||||
}}
|
||||
/>
|
||||
) : null;
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -407,13 +401,14 @@ class ActionsDropdown extends PureComponent {
|
||||
|
||||
const availableActions = this.getAvailableActions();
|
||||
const availablePresentations = this.makePresentationItems();
|
||||
const children = availablePresentations.length > 1 && amIPresenter
|
||||
? availablePresentations.concat(availableActions) : availableActions;
|
||||
const children =
|
||||
availablePresentations.length > 1 && amIPresenter
|
||||
? availablePresentations.concat(availableActions)
|
||||
: availableActions;
|
||||
|
||||
const customStyles = { top: '-1rem' };
|
||||
|
||||
if (availableActions.length === 0
|
||||
|| !isMeteorConnected) {
|
||||
if (availableActions.length === 0 || !isMeteorConnected) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -438,24 +433,41 @@ class ActionsDropdown extends PureComponent {
|
||||
}
|
||||
actions={children}
|
||||
opts={{
|
||||
id: "actions-dropdown-menu",
|
||||
id: 'actions-dropdown-menu',
|
||||
keepMounted: true,
|
||||
transitionDuration: 0,
|
||||
elevation: 3,
|
||||
getcontentanchorel: null,
|
||||
fullwidth: "true",
|
||||
fullwidth: 'true',
|
||||
anchorOrigin: { vertical: 'top', horizontal: isRTL ? 'right' : 'left' },
|
||||
transformOrigin: { vertical: 'bottom', horizontal: isRTL ? 'right' : 'left' },
|
||||
}}
|
||||
/>
|
||||
{this.renderModal(isExternalVideoModalOpen, this.setExternalVideoModalIsOpen, "low",
|
||||
ExternalVideoModal)}
|
||||
{(amIPresenter && isSelectRandomUserEnabled) ? this.renderModal(isRandomUserSelectModalOpen, this.setRandomUserSelectModalIsOpen,
|
||||
"low", RandomUserSelectContainer) : null }
|
||||
{this.renderModal(isLayoutModalOpen, this.setLayoutModalIsOpen,
|
||||
"low", LayoutModalContainer)}
|
||||
{this.renderModal(isCameraAsContentModalOpen, this.setCameraAsContentModalIsOpen,
|
||||
'low', () => (
|
||||
{this.renderModal(
|
||||
isExternalVideoModalOpen,
|
||||
this.setExternalVideoModalIsOpen,
|
||||
'low',
|
||||
ExternalVideoModal
|
||||
)}
|
||||
{amIPresenter && isSelectRandomUserEnabled
|
||||
? this.renderModal(
|
||||
isRandomUserSelectModalOpen,
|
||||
this.setRandomUserSelectModalIsOpen,
|
||||
'low',
|
||||
RandomUserSelectContainer
|
||||
)
|
||||
: null}
|
||||
{this.renderModal(
|
||||
isLayoutModalOpen,
|
||||
this.setLayoutModalIsOpen,
|
||||
'low',
|
||||
LayoutModalContainer
|
||||
)}
|
||||
{this.renderModal(
|
||||
isCameraAsContentModalOpen,
|
||||
this.setCameraAsContentModalIsOpen,
|
||||
'low',
|
||||
() => (
|
||||
<VideoPreviewContainer
|
||||
cameraAsContent
|
||||
amIPresenter
|
||||
@ -470,7 +482,8 @@ class ActionsDropdown extends PureComponent {
|
||||
}}
|
||||
{...propsToPassModal}
|
||||
/>
|
||||
))}
|
||||
)
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import PresentationPodService from '/imports/ui/components/presentation-pod/serv
|
||||
import ActionsDropdown from './component';
|
||||
import { layoutSelectInput, layoutDispatch, layoutSelect } from '../../layout/context';
|
||||
import { SMALL_VIEWPORT_BREAKPOINT } from '../../layout/enums';
|
||||
import { isCameraAsContentEnabled } from '/imports/ui/services/features';
|
||||
|
||||
const ActionsDropdownContainer = (props) => {
|
||||
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
|
||||
@ -16,27 +17,26 @@ const ActionsDropdownContainer = (props) => {
|
||||
const isRTL = layoutSelect((i) => i.isRTL);
|
||||
|
||||
return (
|
||||
<ActionsDropdown {...{
|
||||
layoutContextDispatch,
|
||||
sidebarContent,
|
||||
sidebarNavigation,
|
||||
isMobile,
|
||||
isRTL,
|
||||
...props,
|
||||
}}
|
||||
<ActionsDropdown
|
||||
{...{
|
||||
layoutContextDispatch,
|
||||
sidebarContent,
|
||||
sidebarNavigation,
|
||||
isMobile,
|
||||
isRTL,
|
||||
...props,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const ENABLE_CAMERA_AS_CONTENT = Meteor.settings.public.app.enableCameraAsContent;
|
||||
|
||||
export default withTracker(() => {
|
||||
const presentations = Presentations.find({ 'conversion.done': true }).fetch();
|
||||
return ({
|
||||
return {
|
||||
presentations,
|
||||
isDropdownOpen: Session.get('dropdownOpen'),
|
||||
setPresentation: PresentationUploaderService.setPresentation,
|
||||
podIds: PresentationPodService.getPresentationPodIds(),
|
||||
isCameraAsContentEnabled: ENABLE_CAMERA_AS_CONTENT,
|
||||
});
|
||||
isCameraAsContentEnabled: isCameraAsContentEnabled(),
|
||||
};
|
||||
})(ActionsDropdownContainer);
|
||||
|
@ -87,3 +87,10 @@ export function isReactionsEnabled() {
|
||||
export function isTimerFeatureEnabled() {
|
||||
return getDisabledFeatures().indexOf('timer') === -1;
|
||||
}
|
||||
|
||||
export function isCameraAsContentEnabled() {
|
||||
return (
|
||||
getDisabledFeatures().indexOf('cameraAsContent') === -1 &&
|
||||
Meteor.settings.public.app.enableCameraAsContent
|
||||
);
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ const createEndpointTableData = [
|
||||
"name": "disabledFeatures",
|
||||
"required": false,
|
||||
"type": "String",
|
||||
"description": (<>List (comma-separated) of features to disable in a particular meeting. (added 2.5)<br /><br />Available options to disable:<br /><ul><li><code className="language-plaintext highlighter-rouge">breakoutRooms</code>- <b>Breakout Rooms</b> </li><li><code className="language-plaintext highlighter-rouge">captions</code>- <b>Closed Caption</b> </li><li><code className="language-plaintext highlighter-rouge">chat</code>- <b>Chat</b></li><li><code className="language-plaintext highlighter-rouge">downloadPresentationWithAnnotations</code>- <b>Annotated presentation download</b></li><li><code className="language-plaintext highlighter-rouge">snapshotOfCurrentSlide</code>- <b>Allow snapshot of the current slide</b></li><li><code className="language-plaintext highlighter-rouge">externalVideos</code>- <b>Share an external video</b> </li><li><code className="language-plaintext highlighter-rouge">importPresentationWithAnnotationsFromBreakoutRooms</code>- <b>Capture breakout presentation</b></li><li><code className="language-plaintext highlighter-rouge">importSharedNotesFromBreakoutRooms</code>- <b>Capture breakout shared notes</b></li><li><code className="language-plaintext highlighter-rouge">layouts</code>- <b>Layouts</b> (allow only default layout)</li><li><code className="language-plaintext highlighter-rouge">learningDashboard</code>- <b>Learning Analytics Dashboard</b></li><li><code className="language-plaintext highlighter-rouge">polls</code>- <b>Polls</b> </li><li><code className="language-plaintext highlighter-rouge">screenshare</code>- <b>Screen Sharing</b></li><li><code className="language-plaintext highlighter-rouge">sharedNotes</code>- <b>Shared Notes</b></li><li><code className="language-plaintext highlighter-rouge">virtualBackgrounds</code>- <b>Virtual Backgrounds</b></li><li><code className="language-plaintext highlighter-rouge">customVirtualBackgrounds</code>- <b>Virtual Backgrounds Upload</b></li><li><code className="language-plaintext highlighter-rouge">liveTranscription</code>- <b>Live Transcription</b></li><li><code className="language-plaintext highlighter-rouge">presentation</code>- <b>Presentation</b></li></ul></>)
|
||||
"description": (<>List (comma-separated) of features to disable in a particular meeting. (added 2.5)<br /><br />Available options to disable:<br /><ul><li><code className="language-plaintext highlighter-rouge">breakoutRooms</code>- <b>Breakout Rooms</b> </li><li><code className="language-plaintext highlighter-rouge">captions</code>- <b>Closed Caption</b> </li><li><code className="language-plaintext highlighter-rouge">chat</code>- <b>Chat</b></li><li><code className="language-plaintext highlighter-rouge">downloadPresentationWithAnnotations</code>- <b>Annotated presentation download</b></li><li><code className="language-plaintext highlighter-rouge">snapshotOfCurrentSlide</code>- <b>Allow snapshot of the current slide</b></li><li><code className="language-plaintext highlighter-rouge">externalVideos</code>- <b>Share an external video</b> </li><li><code className="language-plaintext highlighter-rouge">importPresentationWithAnnotationsFromBreakoutRooms</code>- <b>Capture breakout presentation</b></li><li><code className="language-plaintext highlighter-rouge">importSharedNotesFromBreakoutRooms</code>- <b>Capture breakout shared notes</b></li><li><code className="language-plaintext highlighter-rouge">layouts</code>- <b>Layouts</b> (allow only default layout)</li><li><code className="language-plaintext highlighter-rouge">learningDashboard</code>- <b>Learning Analytics Dashboard</b></li><li><code className="language-plaintext highlighter-rouge">polls</code>- <b>Polls</b> </li><li><code className="language-plaintext highlighter-rouge">screenshare</code>- <b>Screen Sharing</b></li><li><code className="language-plaintext highlighter-rouge">sharedNotes</code>- <b>Shared Notes</b></li><li><code className="language-plaintext highlighter-rouge">virtualBackgrounds</code>- <b>Virtual Backgrounds</b></li><li><code className="language-plaintext highlighter-rouge">customVirtualBackgrounds</code>- <b>Virtual Backgrounds Upload</b></li><li><code className="language-plaintext highlighter-rouge">liveTranscription</code>- <b>Live Transcription</b></li><li><code className="language-plaintext highlighter-rouge">presentation</code>- <b>Presentation</b></li><li><code className="language-plaintext highlighter-rouge">enableCameraAsContent</code>-<b>Enables/Disables camera as a content</b></li></ul></>)
|
||||
},
|
||||
{
|
||||
"name": "disabledFeaturesExclude",
|
||||
|
Loading…
Reference in New Issue
Block a user