Helios class is the core engine that manages animation state, timeline synchronization, and media playback.
Constructor
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.Frame number to seek to (will be clamped to valid range)
seekToTime()
Seeks to a specific time in seconds.Time in seconds to seek to
seekToMarker()
Seeks to a marker by ID.Marker ID to seek to
setDuration()
Updates the composition duration.New duration in seconds (must be non-negative)
setFps()
Updates the frame rate.New frame rate (must be greater than 0)
setSize()
Updates the canvas dimensions.New width in pixels
New height in pixels
setLoop()
Updates the loop state.Whether to loop playback
setInputProps()
Updates the input properties.New input properties (will be validated against schema)
setPlaybackRate()
Updates the playback rate.Playback speed multiplier
setAudioVolume()
Updates the master audio volume.Volume level (0.0 to 1.0, will be clamped)
setAudioMuted()
Updates the master audio mute state.Whether audio should be muted
setAudioTrackVolume()
Updates the volume for a specific audio track.ID of the audio track
Volume level (0.0 to 1.0, will be clamped)
setAudioTrackMuted()
Updates the mute state for a specific audio track.ID of the audio track
Whether the track should be muted
setAvailableAudioTracks()
Manually sets available audio tracks (useful for headless environments).Array of audio track metadata
setCaptions()
Updates the captions.SRT/WebVTT string or array of caption cues
setTimeline()
Updates the timeline.Timeline structure with tracks and clips
setMarkers()
Replaces all markers.Array of markers (will be validated and sorted)
addMarker()
Adds a single marker.Marker to add (must have unique ID)
removeMarker()
Removes a marker by ID.ID of the marker to remove
setPlaybackRange()
Sets a playback range.Starting frame (must be >= 0)
Ending frame (must be > startFrame)
clearPlaybackRange()
Clears the playback range.getState()
Gets the current state snapshot.Current state object containing all signal values
subscribe()
Subscribes to state changes.Function called on each state change
Function to unsubscribe from state changes
unsubscribe()
Unsubscribes a specific callback.The callback function to unsubscribe
waitUntilStable()
Waits for all asynchronous operations to complete.Resolves when the composition is stable (images loaded, media seeked, etc.)
registerStabilityCheck()
Registers a custom stability check.Async function that resolves when stable
Function to unregister the stability check
getAudioContext()
Gets the shared AudioContext.The AudioContext instance or null if not available
getAudioSourceNode()
Gets the MediaElementAudioSourceNode for a track.ID of the audio track
The audio source node or null if not available
bindTo()
Binds this instance to another Helios instance.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.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