<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
string
URL to the Helios composition HTML file. The composition will be loaded in an iframe.
boolean
Shows playback controls including play/pause, scrubber, volume, fullscreen, and export buttons.
boolean
Automatically starts playback when the composition loads. Follows browser autoplay policies.
boolean
Restarts playback from the beginning when the composition ends.
boolean
Mutes all audio output. Can be toggled at runtime via the
muted property.string
URL to a poster image displayed before the first play. Shown with a large play button overlay.
number
Width of the player in pixels. Also accessible via the
width property.number
Height of the player in pixels. Also accessible via the
height property.boolean
Enables pointer events to pass through to the composition iframe, allowing interactive content.
boolean
Enables inline playback on mobile devices (iOS). Prevents fullscreen takeover.
boolean
Disables the picture-in-picture button and functionality.
string
default:"auto"
Hint for how the player should load. Values:
"none", "metadata", "auto".string
default:"allow-scripts allow-same-origin"
Sandbox flags for the composition iframe. Controls security restrictions.
string
default:"canvas"
CSS selector for the canvas element inside the composition to use for rendering and export.
string
JSON string of input properties to pass to the composition schema. Alternative to setting via JavaScript.
string
default:"mp4"
Default export format. Values:
"mp4", "webm", "png", "jpeg".string
default:"auto"
Export capture mode. Values:
"auto", "canvas", "dom". Auto attempts canvas first, falls back to DOM.number
Custom width for exported video. Defaults to composition dimensions.
number
Custom height for exported video. Defaults to composition dimensions.
number
default:"5000000"
Video bitrate for export in bits per second.
string
default:"video"
Default filename (without extension) for exported files.
string
Controls caption rendering in exports. Values:
"burn" (render into video), "sidecar" (separate file).string
Title for Media Session API integration (system media controls).
string
Artist name for Media Session API.
string
Album name for Media Session API.
string
URL to artwork image for Media Session API.
Properties
Playback state
number
Current playback position in seconds. Reading returns the current time, writing seeks to that position.
number
Current frame number. Alternative to
currentTime for frame-accurate control.number
Total duration of the composition in seconds.
boolean
Whether playback is currently paused.
boolean
Whether playback has reached the end.
boolean
Whether a seek operation is in progress.
number
Playback speed multiplier.
1.0 is normal speed, 2.0 is double speed, 0.5 is half speed.number
Frame rate of the composition.
Audio
number
Master volume level from
0.0 (silent) to 1.0 (full volume).boolean
Whether audio is muted. Independent of volume level.
HeliosAudioTrackList
List of available audio tracks. See audio tracks API.
Video
number
Intrinsic width of the composition video in pixels.
number
Intrinsic height of the composition video in pixels.
HeliosVideoTrackList
List of available video tracks.
Text tracks
HeliosTextTrackList
List of text tracks (captions/subtitles). See text tracks API.
Ready state
number
Current ready state. Values:
HAVE_NOTHING (0), HAVE_METADATA (1), HAVE_CURRENT_DATA (2), HAVE_FUTURE_DATA (3), HAVE_ENOUGH_DATA (4).number
Current network state. Values:
NETWORK_EMPTY (0), NETWORK_IDLE (1), NETWORK_LOADING (2), NETWORK_NO_SOURCE (3).MediaError | null
Most recent error, or null if no error occurred.
Other properties
TimeRanges
Time ranges that have been buffered. For Helios, this is typically the full duration.
TimeRanges
Time ranges that can be seeked to. For Helios, this is typically the full duration.
TimeRanges
Time ranges that have been played.
string
Current source URL (same as
src).boolean
Whether audio pitch is preserved during rate changes. Default is
true.number
Default playback rate to use when resetting. Default is
1.0.boolean
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
Event
Fired when playback starts.
Event
Fired when playback pauses.
Event
Fired when playback reaches the end.
Event
Fired periodically as
currentTime updates during playback.Event
Fired when a seek operation begins.
Event
Fired when a seek operation completes.
Event
Fired when
playbackRate changes.Loading events
Event
Fired when loading begins.
Event
Fired when metadata (duration, dimensions) is loaded.
Event
Fired when the first frame is loaded.
Event
Fired when enough data is available to start playing.
Event
Fired when playback can likely play through without buffering.
Event
Fired when duration changes.
Audio events
Event
Fired when volume or muted state changes.
Display events
Event
Fired when the player dimensions change.
Event
Fired when entering picture-in-picture mode.
Event
Fired when leaving picture-in-picture mode.
Error events
ErrorEvent
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:color
default:"rgba(0, 0, 0, 0.6)"
Background color for the controls bar.
color
default:"white"
Text and icon color in controls.
color
default:"#007bff"
Accent color for interactive elements and highlights.
color
default:"#555"
Background color for range sliders.
string
default:"sans-serif"
Font family for UI text.
number
default:"0.05"
Caption font size as a fraction of video height.
color
default:"rgba(0, 0, 0, 0.7)"
Caption background color.
color
default:"white"
Caption text color.
string
default:"sans-serif"
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.