<hyperframes-player> custom element that embeds a
HyperFrames composition in plain HTML or a framework application.
Embed a composition
Via CDN
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:
@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: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 throughpostMessage.