Skip to main content
The player package provides a <hyperframes-player> custom element that embeds a HyperFrames composition in plain HTML or a framework application.
Use Player when an application needs to play and seek an HTML composition. Use Studio to edit it or the CLI and Producer to render a video file.

Embed a composition

Via CDN

With a package manager:
Set autoplay muted only when playback should start without a user gesture.

Attributes

Player also accepts shader-capture-scale and shader-loading for previewing projects that use shader transitions. These are preview controls, not composition authoring attributes.

JavaScript API

The main API follows familiar media-player behavior:

Events

Advanced: iframe access

The composition runs inside a sandboxed <iframe> in the player’s Shadow DOM. For most use cases you don’t need direct access — the JavaScript API and events above are sufficient. But if you’re building an editor, recorder, or custom timeline on top of the player, you’ll need to inspect the composition’s DOM or read its __player / __timelines runtime objects. The iframeElement getter exposes the inner iframe for these consumers:
This is the canonical way to bridge the player into editor tools like @hyperframes/studio. The studio exports a resolveIframe helper that handles both direct iframe refs and web-component refs:

React: declarative ref pattern

If you prefer JSX over imperative element creation, attach a ref to the web component and resolve the iframe inside an effect:
A hook that expects an iframe cannot use the <hyperframes-player> host directly. Pass iframeElement, or use resolveIframe.

How it works

The composition runs in a sandboxed iframe inside the player’s Shadow DOM. This isolates its styles, scales it to the player container, and lets the player communicate with the HyperFrames runtime through postMessage.