bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/layout/push-layout/service.ts
2024-08-29 11:47:50 -03:00

26 lines
630 B
TypeScript

import { Output } from '../layoutTypes';
const calculatePresentationVideoRate = (cameraDockOutput: Output['cameraDock']) => {
const {
position,
height,
width,
} = cameraDockOutput;
const horizontalPosition = position === 'contentLeft' || position === 'contentRight';
let presentationVideoRate;
if (horizontalPosition) {
presentationVideoRate = width / window.innerWidth;
} else {
presentationVideoRate = height / window.innerHeight;
}
return parseFloat(presentationVideoRate.toFixed(2));
};
export {
calculatePresentationVideoRate,
};
export default {
calculatePresentationVideoRate,
};