<helios-player> web component provides a drop-in UI for reviewing and exporting Helios compositions. It implements a subset of the HTMLMediaElement interface for familiar programmatic control.
Installation
Usage
Basic setup
Import the player and use the custom element in your HTML:Connecting the composition
For the player to control your composition, the composition page must connect to the parent window. Using@helios-project/core:
window.helios on the iframe’s content window if available. However, connectToParent is recommended for cross-origin support and sandboxing.
Attributes
User interface
The player includes comprehensive controls:- Playback - Play/Pause, scrubber, time display
- Audio - Volume, mute, and track menu for individual track control
- Settings menu (gear icon):
- Speed adjustment (0.25x - 2x)
- Loop toggle
- Playback range (In/Out points)
- Diagnostics (WebCodecs support)
- Shortcuts reference
- Tools - Fullscreen, Picture-in-Picture, captions (CC), export
Keyboard shortcuts
API reference
The<helios-player> element implements a subset of the HTMLMediaElement interface.
Methods
play(): Promise<void>
Starts playback.
pause(): void
Pauses playback.
load(): void
Reloads the iframe (useful if src changed or to retry connection).
export(options?: HeliosExportOptions): Promise<void>
Programmatically trigger client-side export.
diagnose(): Promise<DiagnosticReport>
Runs environment diagnostics (WebCodecs, WebGL) and returns a report.
requestPictureInPicture(): Promise<PictureInPictureWindow>
Requests Picture-in-Picture mode for the player.
addTextTrack(kind: string, label?: string, language?: string): TextTrack
Adds a new text track to the media element.
fastSeek(time: number): void
Seeks to the specified time as fast as possible (currently equivalent to setting currentTime).
Properties
Events
The element dispatches standard media events:play- Playback startspause- Playback pausedended- Playback completedtimeupdate- Current time/frame changedvolumechange- Volume or mute state changedratechange- Playback rate changeddurationchange- Duration changedloadstart- Browser begins looking for medialoadedmetadata- Duration and dimensions determinedloadeddata- Data for current frame availablecanplay- Browser can resume playbackcanplaythrough- Browser can play through without buffering
Controllers
The player uses two controller patterns for managing compositions:DirectController
For same-origin compositions with direct access to theHelios instance.
See /home/daytona/workspace/source/packages/player/src/controllers.ts:38
BridgeController
For cross-origin or sandboxed compositions usingpostMessage communication.
See /home/daytona/workspace/source/packages/player/src/controllers.ts:245
Client-side export
The player supports browser-based export to video (MP4/WebM) or image snapshots (PNG/JPEG) using WebCodecs.Export modes
canvas- Captures frames from a<canvas>element. Fast and efficient.dom- Captures the entire DOM usingforeignObjectSVG serialization. For compositions using DOM elements.auto- Automatically detects the best strategy.
Configuration example
Image snapshots
Setexport-format="png" or export-format="jpeg" to capture a single frame instead of rendering video.
Audio fades
Apply audio fades during export by addingdata-helios-fade-in and data-helios-fade-out attributes to audio elements: