# @hyperframes/player Embeddable web component for playing HyperFrames compositions. Zero dependencies, works with any framework. ## Install ```bash npm install @hyperframes/player ``` Or load directly via CDN: ```html ``` ## Usage ```html ``` The player loads the composition in a sandboxed iframe, auto-detects its dimensions and duration, and scales it responsively to fit the container. ### With a framework ```typescript import "@hyperframes/player"; // The custom element is now registered — use it in your markup // React: // Vue: ``` ### Poster image Show a static image before playback starts: ```html ``` ## Attributes | Attribute | Type | Default | Description | | --------------- | ------- | ------- | ------------------------------------------- | | `src` | string | — | URL to the composition HTML file | | `width` | number | 1920 | Composition width in pixels (aspect ratio) | | `height` | number | 1080 | Composition height in pixels (aspect ratio) | | `controls` | boolean | false | Show play/pause, scrubber, and time display | | `muted` | boolean | false | Mute audio playback | | `poster` | string | — | Image URL shown before playback starts | | `playback-rate` | number | 1 | Speed multiplier (0.5 = half, 2 = double) | | `autoplay` | boolean | false | Start playing when ready | | `loop` | boolean | false | Restart when the composition ends | ## JavaScript API ```js const player = document.querySelector("hyperframes-player"); // Playback player.play(); player.pause(); player.seek(2.5); // jump to 2.5 seconds // Properties player.currentTime; // number (read/write) player.duration; // number (read-only) player.paused; // boolean (read-only) player.ready; // boolean (read-only) player.playbackRate; // number (read/write) player.muted; // boolean (read/write) player.loop; // boolean (read/write) // Inner iframe access (for advanced consumers — see "Advanced: iframe access" below) player.iframeElement; // HTMLIFrameElement (read-only) ``` ## Advanced: iframe access The composition runs inside a sandboxed `