Skip to main content
Helios provides built-in support for captions and subtitles using standard SRT and WebVTT formats. Captions are automatically synchronized with your timeline and can be easily styled and positioned.

Caption formats

Helios supports two standard caption formats:
  • SRT (SubRip): Simple, widely-supported format with timecodes in HH:MM:SS,mmm format
  • WebVTT: Modern web standard with timecodes in HH:MM:SS.mmm or MM:SS.mmm format

SRT format

WebVTT format

Loading captions

Captions can be loaded when creating a Helios instance or added later.

During initialization

Setting captions at runtime

Accessing captions

Helios provides two caption-related signals:

Caption cue structure

string
Unique identifier for the caption cue
number
Start time in milliseconds
number
End time in milliseconds
string
Caption text content (may contain newlines)

Displaying captions

Create a caption component that reacts to the active captions:

Parsing utilities

Helios provides utilities for parsing and working with caption files.

parseSrt()

Parses SRT format caption content.
string
required
SRT formatted caption content
Returns: CaptionCue[]

parseWebVTT()

Parses WebVTT format caption content.
string
required
WebVTT formatted caption content (must start with “WEBVTT”)
Returns: CaptionCue[]

parseCaptions()

Automatically detects and parses SRT or WebVTT format.
string
required
Caption content in SRT or WebVTT format
Returns: CaptionCue[]

stringifySrt()

Converts caption cues back to SRT format.
CaptionCue[]
required
Array of caption cues to serialize
Returns: string - SRT formatted content

findActiveCues()

Finds captions active at a specific time.
CaptionCue[]
required
Array of caption cues to search
number
required
Time in milliseconds
Returns: CaptionCue[] - Captions active at the specified time

Common patterns

Loading captions from file

Styled caption component

Animated captions

Multi-language captions

Caption search and navigation

Export captions

Creating captions programmatically