| 属性 | 类型 | 必需 | 示例 | 值范围 | 描述 |
|---|---|---|---|---|---|
| type | string | false | video | video | animation | 项目类型(例如,“视频”或“动画”)。 |
| width | number | true | 1920 | 720 - 3840 | 项目画布的宽度。用作缩放的基础分辨率。 |
| height | number | true | 1080 | 720 - 3840 | 项目画布的高度。用作缩放的基础分辨率。 |
| fill | string | object | true | #000000 | - | 项目画布的背景。可以是十六进制颜色字符串(例如,“#000000”)或具有类型“线性”或“径向”的渐变对象,包含 colorStops 数组和起始/结束坐标。 |
| duration | number | true | 10 | > 0 | 项目的总持续时间(以秒为单位)。 |
| view | array | true | - | - | 表示项目中视觉内容的元素数组,包括 2D 元素(图像、视频、文本、形状等)和 3D 元素。此数组不能为空。 |
| audio | array | false | - | - | 项目中使用的音轨数组。 |
| effect | array | false | - | - | 应用于画布的视觉效果数组。 |
| transition | array | false | - | - | 在不同视图之间应用的过渡数组。 |
| remoteFonts | array | false | - | - | 可以在文本和字幕元素中使用的远程字体定义数组。 |
remoteFonts 字段允许您在项目中包含自定义网络字体。每个字体定义必须包含指向字体文件的直接链接(仅限 HTTPS)和字体元数据。
| 属性 | 类型 | 必需 | 示例 | 值范围 | 描述 |
|---|---|---|---|---|---|
| family | string | true | My Custom Font | - | 将在文本元素中引用此字体的字体家族名称。 |
| url | string | true | https://example.com/fonts/mycustomfont.woff2 | - | 指向字体文件的直接 HTTPS URL。必须是公开可访问的链接。 |
| weight | string | false | 400 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 字体粗细。常见值为 100-900。 |
| style | string | false | normal | normal, italic | 字体样式。 |
| formatHint | string | false | woff2 | woff2, woff, opentype, truetype | 字体文件的格式。这有助于浏览器优化字体加载。 |
| unicodeRange | string | false | U+0000-00FF | - | 可选的 Unicode 范围,以限制此字体适用的字符。 |
重要:
- 字体 URL 必须使用 HTTPS 协议以确保安全
- 字体文件必须是公开可访问的
- 支持的格式:WOFF2(推荐)、WOFF、OpenType、TrueType
- 您可以定义同一字体家族的多个变体,具有不同的粗细和样式
fill 字段可以接受具有以下结构的渐变对象:
| 属性 | 类型 | 必需 | 示例 | 值范围 | 描述 |
|---|---|---|---|---|---|
| type | string | true | - | linear, radial | 渐变的类型。 |
| colorStops | array | true | - | - | 定义颜色及其在渐变中位置的颜色停靠对象数组。 |
| start | object | true | - | - | 渐变的起始坐标,作为具有 x 和 y 属性的对象。 |
| end | object | true | - | - | 渐变的结束坐标,作为具有 x 和 y 属性的对象。 |
| 属性 | 类型 | 必需 | 示例 | 值范围 | 描述 |
|---|---|---|---|---|---|
| color | string | true | - | - | 此停靠处的颜色值,以十六进制格式表示。 |
| offset | number | true | - | 0 - 1 | 此颜色停靠在渐变中的位置(0.0 到 1.0)。 |
{
"type": "",
"width": 1920,
"height": 1080,
"fill": "#000000",
"view": [
{
"id": "8ecf7475-2c6c-47f9-827b-a09c7913f4c0",
"type": "Image",
"start": 0,
"duration": 5,
"trackIndex": 0,
"x": -570.0335392757963,
"y": -170.90659033307685,
"blendMode": "normal",
"anchorX": 1302,
"anchorY": 2312,
"rotation": 0,
"scaleX": 0.23356401384083045,
"scaleY": 0.23356401384083045,
"alpha": 1,
"skewX": 0,
"skewY": 0,
"keyframes": [],
"externalUrl": "https://images.pexels.com/photos/30465303/pexels-photo-30465303.jpeg",
"ext": "jpeg"
}
],
"audio": [],
"effect": [],
"transition": [],
"remoteFonts": [
{
"family": "My Custom Font",
"url": "https://example.com/fonts/mycustomfont.woff2",
"weight": "400",
"style": "normal",
"formatHint": "woff2"
},
{
"family": "My Custom Font",
"url": "https://example.com/fonts/mycustomfont-bold.woff2",
"weight": "700",
"style": "normal",
"formatHint": "woff2"
}
],
"version": 0,
"duration": 5
}