bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/features/index.js

99 lines
3.7 KiB
JavaScript
Raw Normal View History

import useMeeting from '../../core/hooks/useMeeting';
2022-02-07 21:22:52 +08:00
export function useDisabledFeatures() {
const { data: meetingData } = useMeeting((m) => ({
disabledFeatures: m.disabledFeatures,
}));
const disabledFeatures = meetingData?.disabledFeatures || [];
return disabledFeatures;
}
export function useIsScreenSharingEnabled() {
return useDisabledFeatures().indexOf('screenshare') === -1 && window.meetingClientSettings.public.kurento.enableScreensharing;
}
2024-06-14 21:30:48 +08:00
export function useIsLearningDashboardEnabled() {
return useDisabledFeatures().indexOf('learningDashboard') === -1;
2022-03-09 02:05:24 +08:00
}
export function useIsPollingEnabled() {
return useDisabledFeatures().indexOf('polls') === -1 && window.meetingClientSettings.public.poll.enabled;
}
2024-06-13 22:48:15 +08:00
export function useIsPresentationEnabled() {
return useDisabledFeatures().indexOf('presentation') === -1;
}
export function useIsExternalVideoEnabled() {
return useDisabledFeatures().indexOf('externalVideos') === -1 && window.meetingClientSettings.public.externalVideoPlayer.enabled;
}
2024-06-14 21:30:48 +08:00
export function useIsChatEnabled() {
return useDisabledFeatures().indexOf('chat') === -1 && window.meetingClientSettings.public.chat.enabled;
}
2022-03-11 02:02:20 +08:00
2024-06-14 21:30:48 +08:00
export function useIsSharedNotesEnabled() {
return useDisabledFeatures().indexOf('sharedNotes') === -1 && window.meetingClientSettings.public.notes.enabled;
2022-03-11 02:02:20 +08:00
}
2024-06-14 21:30:48 +08:00
export function useIsLiveTranscriptionEnabled() {
return useDisabledFeatures().indexOf('liveTranscription') === -1 && window.meetingClientSettings.public.app.audioCaptions.enabled;
}
2024-06-14 21:30:48 +08:00
export function useIsBreakoutRoomsEnabled() {
return useDisabledFeatures().indexOf('breakoutRooms') === -1;
}
2024-06-14 21:30:48 +08:00
export function useIsLayoutsEnabled() {
return useDisabledFeatures().indexOf('layouts') === -1;
2022-03-15 21:40:02 +08:00
}
2024-06-14 21:30:48 +08:00
export function useIsVirtualBackgroundsEnabled() {
return useDisabledFeatures().indexOf('virtualBackgrounds') === -1 && window.meetingClientSettings.public.virtualBackgrounds.enabled;
}
2024-06-14 21:30:48 +08:00
export function useIsCustomVirtualBackgroundsEnabled() {
return useDisabledFeatures().indexOf('customVirtualBackgrounds') === -1;
}
export function useIsDownloadPresentationWithAnnotationsEnabled() {
2024-06-14 21:30:48 +08:00
return useDisabledFeatures().indexOf('downloadPresentationWithAnnotations') === -1 && window.meetingClientSettings.public.presentation.allowDownloadWithAnnotations;
}
export function useIsDownloadPresentationConvertedToPdfEnabled() {
2024-06-14 21:30:48 +08:00
return useDisabledFeatures().indexOf('downloadPresentationConvertedToPdf') === -1;
}
export function useIsDownloadPresentationOriginalFileEnabled() {
return useDisabledFeatures().indexOf('downloadPresentationOriginalFile') === -1 && window.meetingClientSettings.public.presentation.allowDownloadOriginal;
}
2024-06-14 21:30:48 +08:00
export function useIsSnapshotOfCurrentSlideEnabled() {
return useDisabledFeatures().indexOf('snapshotOfCurrentSlide') === -1 && window.meetingClientSettings.public.presentation.allowSnapshotOfCurrentSlide;
}
2024-06-14 21:30:48 +08:00
export function useIsImportPresentationWithAnnotationsFromBreakoutRoomsEnabled() {
return useDisabledFeatures().indexOf('importPresentationWithAnnotationsFromBreakoutRooms') === -1;
}
2024-06-14 21:30:48 +08:00
export function useIsImportSharedNotesFromBreakoutRoomsEnabled() {
return useDisabledFeatures().indexOf('importSharedNotesFromBreakoutRooms') === -1;
}
export function useIsReactionsEnabled() {
const USER_REACTIONS_ENABLED = window.meetingClientSettings.public.userReaction.enabled;
return useDisabledFeatures().indexOf('reactions') === -1 && USER_REACTIONS_ENABLED;
}
2024-06-14 21:30:48 +08:00
export function useIsTimerFeatureEnabled() {
return useDisabledFeatures().indexOf('timer') === -1 && window.meetingClientSettings.public.timer.enabled;
2023-06-15 03:47:57 +08:00
}
2024-06-14 21:30:48 +08:00
export function useIsCameraAsContentEnabled() {
2023-06-15 03:47:57 +08:00
return (
2024-06-14 21:30:48 +08:00
useDisabledFeatures().indexOf('cameraAsContent') === -1
&& window.meetingClientSettings.public.app.enableCameraAsContent
2023-06-15 03:47:57 +08:00
);
}