Tutorials
Add Subtitles
1. Inline subtitle example
{
"type": "subtitle",
"start": 0,
"duration": 6,
"words": [
{ "word": "hello", "punctuated_word": "Hello", "start": 0, "end": 0.4 },
{ "word": "world", "punctuated_word": "world!", "start": 0.4, "end": 0.9 }
],
"config": {
"position": "bottom",
"fontSize": 58,
"textColor": "#ffffff",
"highlightColor": "#22d3ee",
"backgroundColor": "rgba(0,0,0,0.45)"
}
}2. Asset-based subtitle example
{
"assets": {
"subtitles": [
{
"id": "sub-main",
"words": [
{ "word": "hello", "punctuated_word": "Hello", "start": 0, "end": 0.4 },
{ "word": "world", "punctuated_word": "world!", "start": 0.4, "end": 0.9 }
]
}
]
}
}Use it like this:
{
"type": "subtitle",
"start": 0,
"duration": 6,
"words": { "$ref": "sub-main" },
"config": {
"position": "bottom",
"fontSize": 58,
"highlightColor": "#22d3ee"
}
}3. Remote subtitle JSON
{
"type": "subtitle",
"start": 0,
"duration": 6,
"words": {
"src": "https://example.com/subtitle.json"
}
}4. Practical tips
- Align subtitle duration with the spoken segment
- Keep bottom padding high enough for mobile-safe areas
- Prefer
$refwhen the same subtitles are reused in multiple templates or examples
5. Related docs
- Subtitle element: Subtitle Element
- Example collection: Examples