bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js

34 lines
933 B
JavaScript
Raw Normal View History

2017-07-01 03:16:00 +08:00
import { makeCall } from '/imports/ui/services/api';
import { throttle } from '/imports/utils/throttle';
2016-08-03 06:55:20 +08:00
const PAN_ZOOM_INTERVAL = Meteor.settings.public.presentation.panZoomInterval || 200;
2023-10-12 02:41:20 +08:00
const POD_ID = 'DEFAULT_PRESENTATION_POD';
const previousSlide = (currentSlideNum) => {
2016-08-06 02:39:24 +08:00
if (currentSlideNum > 1) {
2023-10-12 02:41:20 +08:00
makeCall('switchSlide', currentSlideNum - 1, POD_ID);
2016-08-06 02:39:24 +08:00
}
};
2023-10-12 02:41:20 +08:00
const nextSlide = (currentSlideNum, numberOfSlides) => {
2016-08-06 02:39:24 +08:00
if (currentSlideNum < numberOfSlides) {
2023-10-12 02:41:20 +08:00
makeCall('switchSlide', currentSlideNum + 1, POD_ID);
2016-08-06 02:39:24 +08:00
}
};
2023-10-12 02:41:20 +08:00
const zoomSlide = throttle((currentSlideNum, widthRatio, heightRatio, xOffset, yOffset) => {
makeCall('zoomSlide', currentSlideNum, POD_ID, widthRatio, heightRatio, xOffset, yOffset);
}, PAN_ZOOM_INTERVAL);
2018-08-14 03:29:38 +08:00
2023-10-12 02:41:20 +08:00
const skipToSlide = (requestedSlideNum) => {
makeCall('switchSlide', requestedSlideNum, POD_ID);
2016-08-06 02:39:24 +08:00
};
2016-08-03 06:55:20 +08:00
export default {
2016-08-06 02:39:24 +08:00
nextSlide,
previousSlide,
skipToSlide,
2018-08-14 03:29:38 +08:00
zoomSlide,
2016-08-03 06:55:20 +08:00
};