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

32 lines
913 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 previousSlide = (currentSlideNum, podId) => {
if (currentSlideNum > 1) {
makeCall('switchSlide', currentSlideNum - 1, podId);
}
};
const nextSlide = (currentSlideNum, numberOfSlides, podId) => {
if (currentSlideNum < numberOfSlides) {
makeCall('switchSlide', currentSlideNum + 1, podId);
}
};
const zoomSlide = throttle((currentSlideNum, podId, widthRatio, heightRatio, xOffset, yOffset) => {
makeCall('zoomSlide', currentSlideNum, podId, widthRatio, heightRatio, xOffset, yOffset);
}, PAN_ZOOM_INTERVAL);
const skipToSlide = (requestedSlideNum, podId) => {
makeCall('switchSlide', requestedSlideNum, podId);
};
export default {
nextSlide,
previousSlide,
skipToSlide,
zoomSlide,
};