bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/media/service.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

import getFromUserSettings from '/imports/ui/services/users-settings';
import { ACTIONS } from '../layout/enums';
2016-09-15 04:25:31 +08:00
function shouldShowWhiteboard() {
return true;
}
function shouldShowOverlay() {
const KURENTO_CONFIG = window.meetingClientSettings.public.kurento;
return getFromUserSettings('bbb_enable_video', KURENTO_CONFIG.enableVideo);
2016-09-15 04:25:31 +08:00
}
const setPresentationIsOpen = (layoutContextDispatch, value) => {
2021-08-05 19:03:24 +08:00
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
value,
});
2018-04-10 02:48:21 +08:00
};
const buildLayoutWhenPresentationAreaIsDisabled = (
layoutContextDispatch,
isSharingVideo,
isSharedNotesPinned,
isThereWebcam,
2024-06-14 21:30:48 +08:00
isScreenSharingEnabled,
isPresentationEnabled,
) => {
2024-06-14 21:30:48 +08:00
const hasScreenshare = isScreenSharingEnabled;
const isGeneralMediaOff = !hasScreenshare && !isSharedNotesPinned && !isSharingVideo;
const webcamIsOnlyContent = isThereWebcam && isGeneralMediaOff;
const isThereNoMedia = !isThereWebcam && isGeneralMediaOff;
2024-06-14 21:30:48 +08:00
const isPresentationDisabled = !isPresentationEnabled;
if (isPresentationDisabled && (webcamIsOnlyContent || isThereNoMedia)) {
setPresentationIsOpen(layoutContextDispatch, false);
}
2024-06-14 21:30:48 +08:00
};
export default {
buildLayoutWhenPresentationAreaIsDisabled,
2016-09-15 04:25:31 +08:00
shouldShowWhiteboard,
shouldShowOverlay,
setPresentationIsOpen,
};