MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / formatTime

Function formatTime

packages/studio/src/player/lib/time.ts:3–8  ·  view source on GitHub ↗
(time: number)

Source from the content-addressed store, hash-verified

1export const STUDIO_PREVIEW_FPS = 30;
2
3export function formatTime(time: number): string {
4 if (!Number.isFinite(time) || time < 0) return "0:00";
5 const mins = Math.floor(time / 60);
6 const secs = Math.floor(time % 60);
7 return `${mins}:${secs.toString().padStart(2, "0")}`;
8}
9
10export function secondsToFrame(time: number, fps = STUDIO_PREVIEW_FPS): number {
11 if (!Number.isFinite(time) || time <= 0) return 0;

Callers 11

formatCompositionContextFunction · 0.90
buildElementAgentPromptFunction · 0.90
Timeline.test.tsFile · 0.90
PlayerControls.tsxFile · 0.90
EditPopoverFunction · 0.90
ShortcutsPanel.tsxFile · 0.90
buildTimelineAgentPromptFunction · 0.90
updateProgressFunction · 0.90
formatTimelineTickLabelFunction · 0.90
time.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected