Core timeline concepts
Time representations
Helios uses two primary time representations:- Frames: Integer frame numbers (0, 1, 2, …)
- Seconds: Floating-point time values (0.0, 0.033, 0.067, …)
time = frame / fps
Reactive state
All timeline state is exposed as signals for reactive programming:packages/core/src/Helios.ts:123 for signal definitions.
Playback controls
Play and pause
Helios.ts:885:
Seeking
- Seek by frame
- Seek by time
- Seek to marker
[0, duration * fps].Looping
Helios.ts:1229:
Playback rate
Control playback speed:- Frame advancement during
play() - Audio/video element playback (via drivers)
- Animation speed (when using time-based animations)
Playback rate does not affect seeking.
seek(100) always jumps to frame 100 regardless of playback rate.Playback range
Limit playback to a specific frame range:- Where
play()starts (at range start) - Where playback stops (at range end)
- Loop boundaries (wraps within range)
Helios.ts:832 for playback range API.
Timeline binding
Helios can be driven by different time sources:Standalone playback (default)
Bound to document timeline
__HELIOS_VIRTUAL_TIME__ via CDP, and bound instances automatically sync to it.
See Helios.ts:1085 for binding implementation.
When bound to document timeline, calling
play() has no effect—time is controlled externally.Bound to another Helios instance
Helios.ts:994 for instance binding.
Unbinding
Frame-accurate rendering
For deterministic rendering, Helios provides aRenderSession API:
packages/core/src/render-session.ts:9 for implementation.
Stability waiting
Before capturing each frame, wait for all async operations to complete:Helios.ts:943:
- Driver stability (fonts, images, media)
- Custom registered checks
- Virtual time sync (if bound to document timeline)
State subscription
Subscribe to all state changes at once:Helios.ts:9:
Dynamic configuration
Most configuration can be changed at runtime:Duration and FPS
Changing FPS recalculates the current frame to maintain the same time position. For example, if you’re at 3 seconds (frame 90 at 30fps), changing to 60fps moves you to frame 180.
Dimensions
Advanced timeline patterns
Scrubbing with momentum
Time remapping
Frame-by-frame control
Performance considerations
Seeking performance
Seeking triggers:- Signal updates (fast)
- Driver sync (may trigger layout/paint)
- Subscriber callbacks (depends on your code)
Batch updates
Multiple state changes can be batched:Next steps
- Learn about the animation system for motion control
- Explore drivers to understand time sources
- See compositions for configuration details