UNPKG

remotion

Version:

Make videos programmatically

18 lines (17 loc) 595 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateLoopDuration = void 0; const calculateLoopDuration = ({ endAt, mediaDuration, playbackRate, startFrom, }) => { let duration = mediaDuration; // Account for endAt if (typeof endAt !== 'undefined') { duration = endAt; } // Account for startFrom if (typeof startFrom !== 'undefined') { duration -= startFrom; } const actualDuration = duration / playbackRate; return Math.floor(actualDuration); }; exports.calculateLoopDuration = calculateLoopDuration;