bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js
2023-10-11 15:41:20 -03:00

34 lines
933 B
JavaScript
Executable File

import { makeCall } from '/imports/ui/services/api';
import { throttle } from '/imports/utils/throttle';
const PAN_ZOOM_INTERVAL = Meteor.settings.public.presentation.panZoomInterval || 200;
const POD_ID = 'DEFAULT_PRESENTATION_POD';
const previousSlide = (currentSlideNum) => {
if (currentSlideNum > 1) {
makeCall('switchSlide', currentSlideNum - 1, POD_ID);
}
};
const nextSlide = (currentSlideNum, numberOfSlides) => {
if (currentSlideNum < numberOfSlides) {
makeCall('switchSlide', currentSlideNum + 1, POD_ID);
}
};
const zoomSlide = throttle((currentSlideNum, widthRatio, heightRatio, xOffset, yOffset) => {
makeCall('zoomSlide', currentSlideNum, POD_ID, widthRatio, heightRatio, xOffset, yOffset);
}, PAN_ZOOM_INTERVAL);
const skipToSlide = (requestedSlideNum) => {
makeCall('switchSlide', requestedSlideNum, POD_ID);
};
export default {
nextSlide,
previousSlide,
skipToSlide,
zoomSlide,
};