INNER CODE UNIT · TypeScript
collectContinuousVideoOverlays
vargHQ/sdk · src/ai-sdk/providers/editly/index.ts:401
function collectContinuousVideoOverlays(
clips: ProcessedClip[],
): Map<string, { layer: VideoLayer; totalDuration: number }> {
const overlays = new Map<
string,
{ layer: VideoLayer; totalDuration: number }
>();
for (const clip of clips) {
for (const layer of clip.layers) {
// Only collect continuous overlays (with cutFrom/cutTo), not clip-local ones
if (layer && isContinuousVideoOverlay(layer)) {
const videoLayer = layer as VideoLayer;
const key = `${videoLayer.path}:${videoLayer.left ?? ""}:${videoLayer.top ?? ""}:${videoLayer.width ?? ""}:${videoLayer.height ?? ""}`;
const existing = overlays.get(key);
if (existing) {
existing.totalDuration += clip.duration;
} else {