2017-10-12 10:00:28 +08:00
|
|
|
import Presentations from '/imports/api/presentations';
|
2017-07-25 03:29:34 +08:00
|
|
|
import { isVideoBroadcasting } from '/imports/ui/components/screenshare/service';
|
2019-07-13 04:08:55 +08:00
|
|
|
import { getVideoUrl } from '/imports/ui/components/external-video-player/service';
|
2018-04-18 01:55:07 +08:00
|
|
|
import Settings from '/imports/ui/services/settings';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2022-03-09 21:33:18 +08:00
|
|
|
import { isExternalVideoEnabled, isScreenSharingEnabled } from '/imports/ui/services/features';
|
2021-07-17 02:42:16 +08:00
|
|
|
import { ACTIONS } from '../layout/enums';
|
2022-06-23 21:05:11 +08:00
|
|
|
import UserService from '/imports/ui/components/user-list/service';
|
2022-10-24 21:11:28 +08:00
|
|
|
import NotesService from '/imports/ui/components/notes/service';
|
2016-05-31 06:07:02 +08:00
|
|
|
|
2018-10-24 04:44:17 +08:00
|
|
|
const LAYOUT_CONFIG = Meteor.settings.public.layout;
|
|
|
|
const KURENTO_CONFIG = Meteor.settings.public.kurento;
|
2021-10-15 03:31:47 +08:00
|
|
|
const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
|
2018-10-24 04:44:17 +08:00
|
|
|
|
2017-06-03 03:25:02 +08:00
|
|
|
const getPresentationInfo = () => {
|
2017-07-01 03:16:00 +08:00
|
|
|
const currentPresentation = Presentations.findOne({
|
2017-07-25 02:46:53 +08:00
|
|
|
current: true,
|
2017-06-03 03:25:02 +08:00
|
|
|
});
|
2016-05-31 06:07:02 +08:00
|
|
|
|
|
|
|
return {
|
2017-06-03 03:25:02 +08:00
|
|
|
current_presentation: (currentPresentation != null),
|
2016-05-31 06:07:02 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-09-15 04:25:31 +08:00
|
|
|
function shouldShowWhiteboard() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-07-25 03:29:34 +08:00
|
|
|
function shouldShowScreenshare() {
|
2019-02-05 20:59:39 +08:00
|
|
|
const { viewScreenshare } = Settings.dataSaving;
|
2022-06-23 21:05:11 +08:00
|
|
|
return isScreenSharingEnabled() && (viewScreenshare || UserService.isUserPresenter()) && isVideoBroadcasting();
|
2016-09-15 04:25:31 +08:00
|
|
|
}
|
|
|
|
|
2018-11-30 01:24:02 +08:00
|
|
|
function shouldShowExternalVideo() {
|
2022-03-09 21:33:18 +08:00
|
|
|
return isExternalVideoEnabled() && getVideoUrl();
|
2018-11-30 01:24:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-24 21:11:28 +08:00
|
|
|
function shouldShowSharedNotes() {
|
|
|
|
return NotesService.isSharedNotesPinned();
|
|
|
|
}
|
|
|
|
|
2016-09-15 04:25:31 +08:00
|
|
|
function shouldShowOverlay() {
|
2019-07-25 01:04:46 +08:00
|
|
|
return getFromUserSettings('bbb_enable_video', KURENTO_CONFIG.enableVideo);
|
2016-09-15 04:25:31 +08:00
|
|
|
}
|
|
|
|
|
2022-02-11 22:30:35 +08:00
|
|
|
const setPresentationIsOpen = (layoutContextDispatch, value) => {
|
2021-08-05 19:03:24 +08:00
|
|
|
layoutContextDispatch({
|
2021-07-17 02:42:16 +08:00
|
|
|
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
|
2022-02-11 22:30:35 +08:00
|
|
|
value,
|
2021-07-17 02:42:16 +08:00
|
|
|
});
|
2018-04-10 02:48:21 +08:00
|
|
|
};
|
|
|
|
|
2016-05-31 06:07:02 +08:00
|
|
|
export default {
|
|
|
|
getPresentationInfo,
|
2016-09-15 04:25:31 +08:00
|
|
|
shouldShowWhiteboard,
|
2017-07-25 03:29:34 +08:00
|
|
|
shouldShowScreenshare,
|
2018-11-30 01:24:02 +08:00
|
|
|
shouldShowExternalVideo,
|
2016-09-15 04:25:31 +08:00
|
|
|
shouldShowOverlay,
|
2018-03-09 19:20:08 +08:00
|
|
|
isVideoBroadcasting,
|
2022-02-11 22:30:35 +08:00
|
|
|
setPresentationIsOpen,
|
2022-10-24 21:11:28 +08:00
|
|
|
shouldShowSharedNotes,
|
2016-05-31 06:07:02 +08:00
|
|
|
};
|