Tracks
Track system for organizing clips
Tracks
Tracks are layers that contain clips, similar to video editing software layers.
Field Definition
interface Track {
id?: string;
type: 'visual' | 'audio' | 'subtitle' | 'overlay';
clips: Clip[];
muted?: boolean;
}Example
{
"tracks": [
{
"id": "background",
"type": "visual",
"clips": [
{ "type": "rect", "start": 0, "duration": 10 }
]
},
{
"id": "content",
"type": "visual",
"clips": [
{ "type": "text", "text": "Hello", "start": 0, "duration": 5 }
]
},
{
"id": "music",
"type": "audio",
"clips": []
}
]
}Track Types
| Type | Description | Contents |
|---|---|---|
| visual | Visual elements | text, image, video, rect, circle, layout |
| audio | Audio elements | audio clips with timing |
| subtitle | Subtitle data | subtitle clips with word timing |
| overlay | Overlay effects | visual elements on top of main content |
Track Properties
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | No | auto-generated | Unique identifier for the track |
| type | string | Yes | - | Type of track content |
| clips | array | Yes | [] | Array of clips in this track |
| muted | boolean | No | false | Whether track is muted |
Layering with zIndex
Within a track, use zIndex on clips to control stacking order. Higher values appear on top.
{
"tracks": [
{
"id": "background",
"clips": [{ "zIndex": 0 }]
},
{
"id": "foreground",
"clips": [{ "zIndex": 10 }]
}
]
}