Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

563 B
Raw Blame
import { usePlayerStore } from "../player/store/playerStore";
import type { EditMoment } from "../components/editor/manualEditsTypes";
import type { DragStamp } from "./draggedGsapPosition";

export function playheadMoment(): EditMoment {
  const { currentTime, activeKeyframePct } = usePlayerStore.getState();
  return { time: currentTime, keyframePct: activeKeyframePct };
}

/** The playhead an edit writes at: its gesture's press, else the playhead now. */
export function editMoment(stamp?: DragStamp): EditMoment {
  return stamp?.at ?? playheadMoment();
}