* fix(player): a sealed film is heard when its frame may not start sound When a browser refuses the film's own play (an iPhone, or Chrome's tap-first rule for a sealed frame), the player plays copies of the film's media in its page. A sealed player could not read the frame, so it made no copies and muted the frame anyway: silence. The runtime now sends the clips to copy with the refusal, and again whenever they change. The player copies only files under the composition's own folder, anonymously, and mutes the frame only while a copy plays instead. * fix(player): a sealed film's copy plays its file from the composition's own origin The copy's address is now the composition's origin followed by the checked path, never the string the frame sent. The player's size budget rises by exactly what the sealed copies add (npm pack, main vs this branch). * fix(player): a sealed film's copy address is rebuilt from encoded path parts * fix(player): a sealed film's copy refuses an encoded way out of its folder * fix(player): a sealed film is muted only once its copy plays, and only from web addresses Copies come only from http(s) addresses, so two opaque origins never match. A clip with an invalid file address gets no copy, and the rest are still listed. The frame is muted once a copy is playing, and gets its sound back when the last one fails or is dropped. * fix(player): a sealed film gets its sound back when its last playing copy fails * fix(player): a sealed film's mute follows its copies' own state, whatever order events arrive in
@hyperframes/core
Types, parsers, generators, compiler, linter, runtime, and frame adapters for the Hyperframes video framework.
Install
npm install @hyperframes/core
Most users don't need to install core directly — the CLI, producer, and studio packages depend on it internally.
What's inside
| Module | Description |
|---|---|
| Types | TimelineElement, CompositionSpec, Asset, canvas dimensions, defaults |
| Parsers | parseHtml — extract timeline elements from HTML; parseGsapScript — parse GSAP animations |
| Generators | generateHyperframesHtml — produce valid Hyperframes HTML from a composition spec |
| Compiler | compileTimingAttrs — resolve data-start / data-duration into absolute times |
| Linter | lintHyperframeHtml — validate Hyperframes HTML (missing attributes, overlapping tracks, etc.) |
| Runtime | IIFE script injected into the browser — manages seek, media playback, and the window.__hf protocol |
| Frame Adapters | Pluggable animation drivers (GSAP, Lottie, CSS, or custom) |
Generated composition trust
Composition generators require trusted authors for code-bearing inputs. styles and
generateHyperframesStyles preserve authored CSS, which can load external resources.
animations may contain __raw: values that are emitted as JavaScript;
includeScripts: true includes executable timeline code. serializeGsapAnimations
also accepts raw preamble, postamble, and a code-bearing timelineVar. Never fill
these inputs with untrusted data. Attribute encoding and closing-tag containment
are not a sandbox; render untrusted compositions in an appropriately isolated
execution environment and never serve them on a privileged origin.
Text content retains the supported inline-formatting sanitizer contract. The clip parser intentionally flattens inner formatting to text, so parse/generate is not a lossless replacement for editing the source HTML.
Frame Adapters
A frame adapter tells the engine how to seek your animation to a specific frame:
import { createGSAPFrameAdapter } from "@hyperframes/core";
const adapter = createGSAPFrameAdapter({
getTimeline: () => gsap.timeline(),
compositionId: "my-video",
});
Implement FrameAdapter for custom animation runtimes:
import type { FrameAdapter } from "@hyperframes/core";
const myAdapter: FrameAdapter = {
id: "my-adapter",
getDurationFrames: () => 300,
seekFrame: (frame) => {
/* seek your animation */
},
};
Parsing and generating HTML
import { parseHtml, generateHyperframesHtml } from "@hyperframes/core";
const { elements, metadata } = parseHtml(htmlString);
const html = generateHyperframesHtml(spec);
Linting
import { lintHyperframeHtml } from "@hyperframes/core/lint";
const result = lintHyperframeHtml(htmlString);
// result.findings: { severity, message, elementId }[]
Documentation
Full documentation: hyperframes.heygen.com/packages/core
Related packages
@hyperframes/engine— rendering engine that drives the browser@hyperframes/producer— full render pipeline (capture + encode)hyperframes— CLI