Skip to main content
The <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:
Legacy mode (same-origin only): The player will automatically access 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 starts
  • pause - Playback paused
  • ended - Playback completed
  • timeupdate - Current time/frame changed
  • volumechange - Volume or mute state changed
  • ratechange - Playback rate changed
  • durationchange - Duration changed
  • loadstart - Browser begins looking for media
  • loadedmetadata - Duration and dimensions determined
  • loadeddata - Data for current frame available
  • canplay - Browser can resume playback
  • canplaythrough - 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 the Helios instance. See /home/daytona/workspace/source/packages/player/src/controllers.ts:38

BridgeController

For cross-origin or sandboxed compositions using postMessage 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 using foreignObject SVG serialization. For compositions using DOM elements.
  • auto - Automatically detects the best strategy.

Configuration example

Image snapshots

Set export-format="png" or export-format="jpeg" to capture a single frame instead of rendering video.

Audio fades

Apply audio fades during export by adding data-helios-fade-in and data-helios-fade-out attributes to audio elements:
Values are in seconds.

CSS variables

Customize the player controls with CSS variables:

Verification

Run the E2E verification suite:
This uses Playwright to verify core functionality (playback, scrubber, menus, volume) with a dependency-free mock composition.