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';
|
2018-02-06 21:33:48 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
|
|
|
import Users from '/imports/api/users';
|
2016-05-31 06:07:02 +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
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-06 21:33:48 +08:00
|
|
|
const isUserPresenter = () => Users.findOne({ userId: Auth.userID }).presenter;
|
|
|
|
|
2016-09-15 04:25:31 +08:00
|
|
|
function shouldShowWhiteboard() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-07-25 03:29:34 +08:00
|
|
|
function shouldShowScreenshare() {
|
2017-11-11 09:36:55 +08:00
|
|
|
return isVideoBroadcasting() && Meteor.settings.public.kurento.enableScreensharing;
|
2016-09-15 04:25:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function shouldShowOverlay() {
|
2017-11-11 09:36:55 +08:00
|
|
|
return Meteor.settings.public.kurento.enableVideo;
|
2016-09-15 04:25:31 +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,
|
2016-09-15 04:25:31 +08:00
|
|
|
shouldShowOverlay,
|
2018-02-06 21:33:48 +08:00
|
|
|
isUserPresenter,
|
2016-05-31 06:07:02 +08:00
|
|
|
};
|