<helios-player> element is a custom web component that provides a video-like interface for playing Helios compositions. It implements the HTMLMediaElement API for standard video compatibility.
Basic usage
Attributes
URL to the Helios composition HTML file. The composition will be loaded in an iframe.
Shows playback controls including play/pause, scrubber, volume, fullscreen, and export buttons.
Automatically starts playback when the composition loads. Follows browser autoplay policies.
Restarts playback from the beginning when the composition ends.
Mutes all audio output. Can be toggled at runtime via the
muted property.URL to a poster image displayed before the first play. Shown with a large play button overlay.
Width of the player in pixels. Also accessible via the
width property.Height of the player in pixels. Also accessible via the
height property.Enables pointer events to pass through to the composition iframe, allowing interactive content.
Enables inline playback on mobile devices (iOS). Prevents fullscreen takeover.
Disables the picture-in-picture button and functionality.
Hint for how the player should load. Values:
"none", "metadata", "auto".Sandbox flags for the composition iframe. Controls security restrictions.
CSS selector for the canvas element inside the composition to use for rendering and export.
JSON string of input properties to pass to the composition schema. Alternative to setting via JavaScript.
Default export format. Values:
"mp4", "webm", "png", "jpeg".Export capture mode. Values:
"auto", "canvas", "dom". Auto attempts canvas first, falls back to DOM.Custom width for exported video. Defaults to composition dimensions.
Custom height for exported video. Defaults to composition dimensions.
Video bitrate for export in bits per second.
Default filename (without extension) for exported files.
Controls caption rendering in exports. Values:
"burn" (render into video), "sidecar" (separate file).Title for Media Session API integration (system media controls).
Artist name for Media Session API.
Album name for Media Session API.
URL to artwork image for Media Session API.
Properties
Playback state
Current playback position in seconds. Reading returns the current time, writing seeks to that position.
Current frame number. Alternative to
currentTime for frame-accurate control.Total duration of the composition in seconds.
Whether playback is currently paused.
Whether playback has reached the end.
Whether a seek operation is in progress.
Playback speed multiplier.
1.0 is normal speed, 2.0 is double speed, 0.5 is half speed.Frame rate of the composition.
Audio
Master volume level from
0.0 (silent) to 1.0 (full volume).Whether audio is muted. Independent of volume level.
List of available audio tracks. See audio tracks API.
Video
Intrinsic width of the composition video in pixels.
Intrinsic height of the composition video in pixels.
List of available video tracks.
Text tracks
List of text tracks (captions/subtitles). See text tracks API.
Ready state
Current ready state. Values:
HAVE_NOTHING (0), HAVE_METADATA (1), HAVE_CURRENT_DATA (2), HAVE_FUTURE_DATA (3), HAVE_ENOUGH_DATA (4).Current network state. Values:
NETWORK_EMPTY (0), NETWORK_IDLE (1), NETWORK_LOADING (2), NETWORK_NO_SOURCE (3).Most recent error, or null if no error occurred.
Other properties
Time ranges that have been buffered. For Helios, this is typically the full duration.
Time ranges that can be seeked to. For Helios, this is typically the full duration.
Time ranges that have been played.
Current source URL (same as
src).Whether audio pitch is preserved during rate changes. Default is
true.Default playback rate to use when resetting. Default is
1.0.Default muted state (reflects the
muted attribute).Methods
play()
Starts or resumes playback.Promise<void> - Resolves when playback starts.
pause()
Pauses playback.load()
Loads or reloads the composition from thesrc attribute.
fastSeek(time)
Seeks to the specified time. Identical to settingcurrentTime.
time(number) - Time in seconds
canPlayType(type)
Returns whether the player can play the given MIME type. Always returns empty string since Helios only plays compositions.type(string) - MIME type to check
"" | "maybe" | "probably"
requestPictureInPicture()
Requests picture-in-picture mode.Promise<PictureInPictureWindow>
addTextTrack(kind, label, language)
Adds a new text track to the player.kind(string) - Track kind:"subtitles","captions","descriptions", etc.label(string) - Human-readable labellanguage(string) - BCP 47 language code
HeliosTextTrack
getDiagnostics()
Returns diagnostic information about the composition and player state.Promise<DiagnosticReport>
Events
Playback events
Fired when playback starts.
Fired when playback pauses.
Fired when playback reaches the end.
Fired periodically as
currentTime updates during playback.Fired when a seek operation begins.
Fired when a seek operation completes.
Fired when
playbackRate changes.Loading events
Fired when loading begins.
Fired when metadata (duration, dimensions) is loaded.
Fired when the first frame is loaded.
Fired when enough data is available to start playing.
Fired when playback can likely play through without buffering.
Fired when duration changes.
Audio events
Fired when volume or muted state changes.
Display events
Fired when the player dimensions change.
Fired when entering picture-in-picture mode.
Fired when leaving picture-in-picture mode.
Error events
Fired when an error occurs.
Event handler properties
All events can be listened to viaaddEventListener() or by setting the corresponding on* property:
onplay, onpause, onended, ontimeupdate, onseeking, onseeked, onvolumechange, onratechange, ondurationchange, onresize, onloadstart, onloadedmetadata, onloadeddata, oncanplay, oncanplaythrough, onerror, onenterpictureinpicture, onleavepictureinpicture.
CSS custom properties
The player supports extensive theming via CSS custom properties:Background color for the controls bar.
Text and icon color in controls.
Accent color for interactive elements and highlights.
Background color for range sliders.
Font family for UI text.
Caption font size as a fraction of video height.
Caption background color.
Caption text color.
Font family for captions.
CSS parts
The player exposes Shadow DOM parts for advanced styling:iframe, controls, play-pause-button, volume-control, volume-button, volume-slider, scrubber-wrapper, scrubber, time-display, fullscreen-button, pip-button, cc-button, export-button, audio-button, settings-button, poster, poster-image, big-play-button, captions, overlay, markers, tooltip.