Skip to main content
The exported FrameAdapter interface is experimental v0 API. Its signatures may change before v1.
A frame adapter answers one question: what state should an animation have at frame N? Most composition authors do not implement this interface. HyperFrames already seeks registered GSAP, CSS, Anime.js, Lottie, Three.js, Web Animations, and TypeGPU animation through its browser runtime. Use the GSAP guide for the normal authoring path. Use FrameAdapter when you are building a custom host around a seekable animation object.

Interface

The context contains the composition ID, frame rate, dimensions, and optional root element.

Adapt a GSAP timeline

@hyperframes/core includes a helper for a GSAP-like timeline:
The helper pauses the timeline, derives its frame length, and converts each frame request to seconds.

Contract

A custom adapter must:
  • return a finite, non-negative frame count;
  • support forward, backward, and random seeks;
  • return the same state when the same frame is requested again;
  • avoid wall-clock timers and unseeded randomness;
  • finish asynchronous work before the frame is captured;
  • release listeners and other resources in destroy().
The host still owns the capture and encoding pipeline. The adapter owns only the animation state.

Continue

Read Deterministic rendering for the timing rules or @hyperframes/core for the package exports.