2022-02-07 21:22:52 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
|
|
|
import Meetings from '/imports/api/meetings';
|
2024-05-16 22:43:23 +08:00
|
|
|
import useMeeting from '../../core/hooks/useMeeting';
|
2022-02-07 21:22:52 +08:00
|
|
|
|
|
|
|
export function getDisabledFeatures() {
|
|
|
|
const selector = {
|
|
|
|
meetingId: Auth.meetingID,
|
|
|
|
};
|
|
|
|
|
2024-03-26 19:57:28 +08:00
|
|
|
const meetingData = Meetings.findOne(selector, { fields: { disabledFeatures: 1 } });
|
|
|
|
const disabledFeatures = (meetingData || {}).disabledFeatures || [];
|
2022-02-07 21:22:52 +08:00
|
|
|
|
|
|
|
return disabledFeatures;
|
|
|
|
}
|
|
|
|
|
2024-05-16 22:43:23 +08:00
|
|
|
export function useDisabledFeatures() {
|
|
|
|
const { data: meetingData } = useMeeting((m) => ({
|
|
|
|
disabledFeatures: m.disabledFeatures,
|
|
|
|
}));
|
|
|
|
const disabledFeatures = meetingData?.disabledFeatures || [];
|
|
|
|
return disabledFeatures;
|
|
|
|
}
|
|
|
|
|
2022-02-07 21:22:52 +08:00
|
|
|
export function isScreenSharingEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('screenshare') === -1 && window.meetingClientSettings.public.kurento.enableScreensharing;
|
2022-02-07 21:22:52 +08:00
|
|
|
}
|
2022-03-02 04:27:54 +08:00
|
|
|
|
2024-05-17 21:37:32 +08:00
|
|
|
export function useIsScreenSharingEnabled() {
|
|
|
|
return useDisabledFeatures().indexOf('screenshare') === -1 && window.meetingClientSettings.public.kurento.enableScreensharing;
|
|
|
|
}
|
|
|
|
|
2022-03-02 04:27:54 +08:00
|
|
|
export function isLearningDashboardEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('learningDashboard') === -1;
|
|
|
|
}
|
2022-03-09 02:05:24 +08:00
|
|
|
|
|
|
|
export function isPollingEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('polls') === -1 && window.meetingClientSettings.public.poll.enabled;
|
2022-03-09 02:05:24 +08:00
|
|
|
}
|
2022-03-09 21:33:18 +08:00
|
|
|
|
2024-05-16 22:43:23 +08:00
|
|
|
export function useIsPollingEnabled() {
|
|
|
|
return useDisabledFeatures().indexOf('polls') === -1 && window.meetingClientSettings.public.poll.enabled;
|
|
|
|
}
|
|
|
|
|
2022-03-09 21:33:18 +08:00
|
|
|
export function isExternalVideoEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('externalVideos') === -1 && window.meetingClientSettings.public.externalVideoPlayer.enabled;
|
2022-03-09 21:33:18 +08:00
|
|
|
}
|
2022-03-09 22:19:25 +08:00
|
|
|
|
|
|
|
export function isChatEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('chat') === -1 && window.meetingClientSettings.public.chat.enabled;
|
2022-03-09 22:19:25 +08:00
|
|
|
}
|
2022-03-15 21:40:02 +08:00
|
|
|
|
2022-03-10 03:23:38 +08:00
|
|
|
export function isSharedNotesEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('sharedNotes') === -1 && window.meetingClientSettings.public.notes.enabled;
|
2022-03-10 03:23:38 +08:00
|
|
|
}
|
2022-03-11 02:02:20 +08:00
|
|
|
|
|
|
|
export function isCaptionsEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('captions') === -1 && window.meetingClientSettings.public.captions.enabled;
|
2022-03-11 02:02:20 +08:00
|
|
|
}
|
2022-03-15 02:30:41 +08:00
|
|
|
|
2023-01-09 21:47:22 +08:00
|
|
|
export function isLiveTranscriptionEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('liveTranscription') === -1 && window.meetingClientSettings.public.app.audioCaptions.enabled;
|
2022-12-17 04:04:14 +08:00
|
|
|
}
|
|
|
|
|
2022-03-15 02:30:41 +08:00
|
|
|
export function isBreakoutRoomsEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('breakoutRooms') === -1;
|
|
|
|
}
|
2022-03-19 02:46:45 +08:00
|
|
|
|
2022-03-15 21:40:02 +08:00
|
|
|
export function isLayoutsEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('layouts') === -1;
|
|
|
|
}
|
2022-03-23 03:01:27 +08:00
|
|
|
|
|
|
|
export function isVirtualBackgroundsEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('virtualBackgrounds') === -1 && window.meetingClientSettings.public.virtualBackgrounds.enabled;
|
2022-03-23 03:01:27 +08:00
|
|
|
}
|
2022-07-09 04:01:57 +08:00
|
|
|
|
|
|
|
export function isCustomVirtualBackgroundsEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('customVirtualBackgrounds') === -1;
|
2022-03-23 03:01:27 +08:00
|
|
|
}
|
2022-07-13 00:58:56 +08:00
|
|
|
|
2022-08-02 21:53:40 +08:00
|
|
|
export function isDownloadPresentationWithAnnotationsEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('downloadPresentationWithAnnotations') === -1 && window.meetingClientSettings.public.presentation.allowDownloadWithAnnotations;
|
2023-08-01 04:03:29 +08:00
|
|
|
}
|
|
|
|
|
2023-08-25 22:37:32 +08:00
|
|
|
export function isDownloadPresentationConvertedToPdfEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('downloadPresentationConvertedToPdf') === -1;
|
|
|
|
}
|
|
|
|
|
2023-08-25 20:27:01 +08:00
|
|
|
export function isDownloadPresentationOriginalFileEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('downloadPresentationOriginalFile') === -1 && window.meetingClientSettings.public.presentation.allowDownloadOriginal;
|
2022-07-13 00:58:56 +08:00
|
|
|
}
|
|
|
|
|
2023-06-07 20:35:56 +08:00
|
|
|
export function isSnapshotOfCurrentSlideEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('snapshotOfCurrentSlide') === -1 && window.meetingClientSettings.public.presentation.allowSnapshotOfCurrentSlide;
|
2023-04-03 21:13:54 +08:00
|
|
|
}
|
|
|
|
|
2022-08-02 21:53:40 +08:00
|
|
|
export function isImportPresentationWithAnnotationsFromBreakoutRoomsEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('importPresentationWithAnnotationsFromBreakoutRooms') === -1;
|
2022-07-13 00:58:56 +08:00
|
|
|
}
|
2022-09-20 23:43:13 +08:00
|
|
|
|
2022-10-20 01:09:11 +08:00
|
|
|
export function isImportSharedNotesFromBreakoutRoomsEnabled() {
|
2022-09-20 23:43:13 +08:00
|
|
|
return getDisabledFeatures().indexOf('importSharedNotesFromBreakoutRooms') === -1;
|
|
|
|
}
|
2023-02-17 23:44:36 +08:00
|
|
|
|
2023-02-23 04:16:43 +08:00
|
|
|
export function isPresentationEnabled() {
|
|
|
|
return getDisabledFeatures().indexOf('presentation') === -1;
|
2023-02-17 23:44:36 +08:00
|
|
|
}
|
2023-05-26 05:05:50 +08:00
|
|
|
|
|
|
|
export function isReactionsEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
const USER_REACTIONS_ENABLED = window.meetingClientSettings.public.userReaction.enabled;
|
|
|
|
const REACTIONS_BUTTON_ENABLED = window.meetingClientSettings.public.app.reactionsButton.enabled;
|
2023-08-11 21:14:16 +08:00
|
|
|
|
|
|
|
return getDisabledFeatures().indexOf('reactions') === -1 && USER_REACTIONS_ENABLED && REACTIONS_BUTTON_ENABLED;
|
2023-05-26 05:05:50 +08:00
|
|
|
}
|
2023-05-26 21:33:38 +08:00
|
|
|
|
2024-05-17 21:37:32 +08:00
|
|
|
export function useIsReactionsEnabled() {
|
|
|
|
const USER_REACTIONS_ENABLED = window.meetingClientSettings.public.userReaction.enabled;
|
|
|
|
const REACTIONS_BUTTON_ENABLED = window.meetingClientSettings.public.app.reactionsButton.enabled;
|
|
|
|
|
|
|
|
return useDisabledFeatures().indexOf('reactions') === -1 && USER_REACTIONS_ENABLED && REACTIONS_BUTTON_ENABLED;
|
|
|
|
}
|
|
|
|
|
2023-06-09 03:24:25 +08:00
|
|
|
export function isTimerFeatureEnabled() {
|
2024-03-07 01:28:18 +08:00
|
|
|
return getDisabledFeatures().indexOf('timer') === -1 && window.meetingClientSettings.public.timer.enabled;
|
2023-06-15 03:47:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function isCameraAsContentEnabled() {
|
|
|
|
return (
|
2024-03-26 19:57:28 +08:00
|
|
|
getDisabledFeatures().indexOf('cameraAsContent') === -1
|
|
|
|
&& window.meetingClientSettings.public.app.enableCameraAsContent
|
2023-06-15 03:47:57 +08:00
|
|
|
);
|
2023-03-02 00:30:30 +08:00
|
|
|
}
|