Helios class is the core engine that manages animation state, timeline synchronization, and media playback.
Constructor
HeliosOptions<TInputProps>
required
Configuration options for the Helios instance
Signals
Helios exposes reactive signals that can be subscribed to for updates.currentFrame
currentTime
isPlaying
loop
inputProps
playbackRate
volume
muted
audioTracks
availableAudioTracks
captions
activeCaptions
activeClips
markers
playbackRange
width
height
duration
fps
Properties
isVirtualTimeBound
Methods
play()
Starts playback.pause()
Pauses playback.seek()
Seeks to a specific frame.number
required
Frame number to seek to (will be clamped to valid range)
seekToTime()
Seeks to a specific time in seconds.number
required
Time in seconds to seek to
seekToMarker()
Seeks to a marker by ID.string
required
Marker ID to seek to
setDuration()
Updates the composition duration.number
required
New duration in seconds (must be non-negative)
setFps()
Updates the frame rate.number
required
New frame rate (must be greater than 0)
setSize()
Updates the canvas dimensions.number
required
New width in pixels
number
required
New height in pixels
setLoop()
Updates the loop state.boolean
required
Whether to loop playback
setInputProps()
Updates the input properties.TInputProps
required
New input properties (will be validated against schema)
setPlaybackRate()
Updates the playback rate.number
required
Playback speed multiplier
setAudioVolume()
Updates the master audio volume.number
required
Volume level (0.0 to 1.0, will be clamped)
setAudioMuted()
Updates the master audio mute state.boolean
required
Whether audio should be muted
setAudioTrackVolume()
Updates the volume for a specific audio track.string
required
ID of the audio track
number
required
Volume level (0.0 to 1.0, will be clamped)
setAudioTrackMuted()
Updates the mute state for a specific audio track.string
required
ID of the audio track
boolean
required
Whether the track should be muted
setAvailableAudioTracks()
Manually sets available audio tracks (useful for headless environments).AudioTrackMetadata[]
required
Array of audio track metadata
setCaptions()
Updates the captions.string | CaptionCue[]
required
SRT/WebVTT string or array of caption cues
setTimeline()
Updates the timeline.HeliosTimeline
required
Timeline structure with tracks and clips
setMarkers()
Replaces all markers.Marker[]
required
Array of markers (will be validated and sorted)
addMarker()
Adds a single marker.Marker
required
Marker to add (must have unique ID)
removeMarker()
Removes a marker by ID.string
required
ID of the marker to remove
setPlaybackRange()
Sets a playback range.number
required
Starting frame (must be >= 0)
number
required
Ending frame (must be > startFrame)
clearPlaybackRange()
Clears the playback range.getState()
Gets the current state snapshot.HeliosState<TInputProps>
Current state object containing all signal values
subscribe()
Subscribes to state changes.(state: HeliosState<TInputProps>) => void
required
Function called on each state change
() => void
Function to unsubscribe from state changes
unsubscribe()
Unsubscribes a specific callback.HeliosSubscriber<TInputProps>
required
The callback function to unsubscribe
waitUntilStable()
Waits for all asynchronous operations to complete.Promise<void>
Resolves when the composition is stable (images loaded, media seeked, etc.)
registerStabilityCheck()
Registers a custom stability check.() => Promise<void>
required
Async function that resolves when stable
() => void
Function to unregister the stability check
getAudioContext()
Gets the shared AudioContext.Promise<unknown>
The AudioContext instance or null if not available
getAudioSourceNode()
Gets the MediaElementAudioSourceNode for a track.string
required
ID of the audio track
Promise<unknown>
The audio source node or null if not available
bindTo()
Binds this instance to another Helios instance.Helios<any>
required
The master Helios instance to sync with
unbind()
Unbinds from any master instance or document timeline.bindToDocumentTimeline()
Binds to the document.timeline for external synchronization.unbindFromDocumentTimeline()
Unbinds from the document.timeline.dispose()
Cleans up resources.Static methods
Helios.diagnose()
Runs diagnostics on browser capabilities.DiagnosticReport
Diagnostic report containing:
waapi: Web Animations API supportwebCodecs: WebCodecs API supportoffscreenCanvas: OffscreenCanvas supportwebgl: WebGL supportwebgl2: WebGL2 supportwebAudio: Web Audio API supportcolorGamut: Color gamut supportvideoCodecs: Supported video codecsaudioCodecs: Supported audio codecsvideoDecoders: Supported video decodersaudioDecoders: Supported audio decodersuserAgent: User agent string