在 projectData 中,視圖、音頻、效果和過渡都是元素的數組。
每個元素包含以下共同參數:
| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| id | string | true | b895d96c-e974-4d3f-af6d-ddc464fd4997 | - | 元素的唯一標識符。建議使用 UUID。 |
| type | string | true | - | Video | Image | Gif | Text | Caption | Shape | Chart | Progress | SoundWave | Group | Transition | Audio | Filter | Tone | Lut | 3D | LaTeX | Function Graph | 元素的類型。這決定了元素的渲染方式。 |
| start | number | true | - | >= 0 | 元素在項目時間線上出現的時間,以秒為單位。 |
| duration | number | true | - | > 0 | 元素在時間線上的總持續時間,以秒為單位。 |
| trackIndex | number | true | - | >= 0 | 元素在時間線中放置的軌道索引。 |
{
"id": "bba95c7f-652b-4380-b166-6bece989f527",
"type": "Image",
"start": 0,
"duration": 5,
"trackIndex": 0,
"x": 0,
"y": 0,
"width": 3629,
"height": 5444,
"blendMode": "normal",
"anchorX": 1814.5,
"anchorY": 2722,
"rotation": 0,
"scaleX": 0.19838354151359294,
"scaleY": 0.19838354151359294,
"alpha": 1,
"skewX": 0,
"skewY": 0,
"hidden": false,
"locked": false,
"keyframes": [],
"externalUrl": "https://images.pexels.com/photos/33189512/pexels-photo-33189512.jpeg",
"ext": "jpeg"
}