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

TypeDescriptionContents
visualVisual elementstext, image, video, rect, circle, layout
audioAudio elementsaudio clips with timing
subtitleSubtitle datasubtitle clips with word timing
overlayOverlay effectsvisual elements on top of main content

Track Properties

FieldTypeRequiredDefaultDescription
idstringNoauto-generatedUnique identifier for the track
typestringYes-Type of track content
clipsarrayYes[]Array of clips in this track
mutedbooleanNofalseWhether 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 }]
    }
  ]
}