Element Reference
Video Element
1. Shape
interface VideoClip extends BaseClip {
type: "video";
src: string | { $ref: string };
source?: {
start?: number;
end?: number;
};
volume?: number;
muted?: boolean;
playbackRate?: number;
}2. Supported fields
src
- Type:
string | { $ref: string } - Required: yes
- Purpose: direct video URL or video asset reference
source.start
- Type:
number - Required: no
- Unit: seconds
- Purpose: trim start time inside the source media
source.end
- Type:
number - Required: no
- Unit: seconds
- Purpose: trim end time inside the source media
volume
- Type:
number - Required: no
- Default:
1
muted
- Type:
boolean - Required: no
- Default:
false
playbackRate
- Type:
number - Required: no
- Default:
1
3. Current runtime behavior
srcsupports direct URLssrcsupports$refsource.startworkssource.endworksmuted: trueforces effective volume to0source.endaffects the effective playable duration of the clip
4. Shared fields that work well with video
You can safely combine video with:
transformstylezIndexanimationskeyframestransition
Notes:
style.borderRadiusworksstyle.objectFitworks withfill / cover / containstyle.filtersworksfill: stretches to the target box and may distortcover: preserves aspect ratio and may cropcontain: preserves aspect ratio and may letterbox
5. Example
{
"type": "video",
"start": 0,
"duration": 6,
"src": { "$ref": "hero-video" },
"source": {
"start": 2,
"end": 8
},
"muted": true,
"playbackRate": 1,
"transform": {
"x": "50%",
"y": "50%",
"width": "100%",
"height": "100%"
},
"style": {
"objectFit": "cover",
"filters": [
{ "type": "blur", "value": 32 },
{ "type": "brightness", "value": 0.7 }
]
},
"transition": {
"type": "fade",
"duration": 0.2
}
}