Overview
The Editor structure defines a complete video or image composition with multiple layers, channels, and segments. It provides frame-accurate control over timing, positioning, effects, and layering.Video vs Image Output:
- Video Rendering: Supports all segment types (video, audio, text, image, nested editors)
- Image Rendering: Only supports text and image segments (renders a static frame at time 0)
Editor Configuration
Root Properties
| Property | Type | Required | Description |
|---|---|---|---|
width | number | ✅ | Canvas width in pixels (e.g., 1080 for TikTok/Instagram) |
height | number | ✅ | Canvas height in pixels (e.g., 1920 for vertical video) |
fps | number | ✅ | Frames per second (typically 30 or 60) |
duration | number | ✅ | Total duration in milliseconds (can be auto-calculated from segments) |
channels | Channel[] | ✅ | Array of channels, each containing segments |
Channel Structure
Channels are independent layers that can contain multiple segments. All segments within a channel play sequentially, while segments across different channels play simultaneously.| Property | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique channel identifier (e.g., "background", "text-layer") |
segments | Segment[] | ✅ | Array of segments in this channel |
Segment Types
Base Segment Properties
All segment types inherit these properties:| Property | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique segment identifier |
type | string | ✅ | Segment type: video, image, text, audio, or editor |
source | string | ✅ | Public URL to media file (empty "" for text segments) |
order | number | ✅ | Sequence order within channel (0-based) |
offset | TimeValue | ✅ | Delay after previous segment starts |
startTrim | number | ⚪ | Trim from start in milliseconds (default: 0) |
endTrim | number | ⚪ | Trim from end in milliseconds (default: 0) |
duration | TimeValue | ⚪ | Override segment duration (auto-calculated if omitted) |
Visual Segment Properties
Video, image, text, and editor segments include these positioning properties:| Property | Type | Default | Description |
|---|---|---|---|
xOffset | number | 0 | Horizontal position from left edge in pixels |
yOffset | number | 0 | Vertical position from top edge in pixels |
width | number | Required | Width in pixels |
height | number | Required | Height in pixels |
zIndex | number | 0 | Stacking order (higher values appear on top) |
scale | number | 1 | Scale multiplier (1.0 = 100%, 2.0 = 200%) |
rotation | number | 0 | Rotation in degrees (clockwise) |
opacity | number | 100 | Opacity percentage (0 = transparent, 100 = opaque) |
Video Segment
Displays video content with optional audio. Additional Properties:| Property | Type | Default | Description |
|---|---|---|---|
fit | 'cover' | 'contain' | 'fill' | 'cover' | How the video fits in the bounds • cover: Fill entire area, crop overflow• contain: Fit entire video, may have letterboxing• fill: Stretch to fill, may distort |
speed | number | 1 | Playback speed multiplier (0.5 = half speed, 2.0 = double speed) |
volume | number | 100 | Audio volume percentage (0 = muted, 100 = full volume) |
Image Segment
Displays static images or animated GIFs. Additional Properties:| Property | Type | Default | Description |
|---|---|---|---|
fit | 'cover' | 'contain' | 'fill' | 'contain' | How the image fits in the bounds |
loop | boolean | false | Loop animated GIFs (only affects GIFs) |
Text Segment
Rich text overlays with full typography and styling control. Typography Properties:| Property | Type | Default | Description |
|---|---|---|---|
text | string | Required | The text content (supports emojis) |
fontType | 'arial' | 'tiktok' | 'apple' | 'tiktok' | Font family |
fontSize | number | 40 | Font size in pixels |
fontWeight | 'normal' | 'bold' | 'normal' | Font weight |
lineHeight | number | 1.2 | Line height multiplier |
letterSpacing | number | 0 | Letter spacing in pixels |
| Property | Type | Default | Description |
|---|---|---|---|
alignment | 'left' | 'center' | 'right' | 'justify' | 'left' | Horizontal text alignment |
verticalAlign | 'top' | 'middle' | 'bottom' | 'top' | Vertical alignment within bounds |
direction | 'ltr' | 'rtl' | 'ltr' | Text direction (left-to-right or right-to-left) |
padding | number | 0 | Inner padding in pixels |
| Property | Type | Default | Description |
|---|---|---|---|
textWrap | 'word' | 'char' | 'none' | 'word' | How text wraps to new lines |
wordBreak | 'normal' | 'break-all' | 'break-word' | 'normal' | How words break across lines |
hyphenation | 'none' | 'auto' | 'none' | Automatic hyphenation |
maxLines | number | 0 | Maximum lines (0 = unlimited) |
textOverflow | 'clip' | 'ellipsis' | 'clip' | How overflow is handled |
ellipsis | string | '...' | Ellipsis string for overflow |
| Property | Type | Default | Description |
|---|---|---|---|
color | string | '#FFFFFF' | Text color in hex format (e.g., #FF0000 for red) |
backgroundColor | string | 'transparent' | Background color with optional alpha (e.g., #00000080 for 50% black) |
strokeColor | string | undefined | Text outline color (e.g., #000000 for black outline) |
strokeWidth | number | 0 | Outline width in pixels |
Audio Segment
Background audio or music tracks. Audio segments don’t have visual properties. Properties:| Property | Type | Default | Description |
|---|---|---|---|
| (base properties) | All base segment properties apply | ||
volume | number | 100 | Audio volume percentage (0 = muted, 100 = full) |
Editor Segment (Nested Composition)
Nest entire editor configurations within segments for complex compositions. Additional Properties:| Property | Type | Description |
|---|---|---|
editor | Editor | Complete nested editor configuration |
| (all visual properties) | Same as video segments |
Time Value Format
Time values can be specified as absolute (milliseconds) or relative (percentage):- Offset:
{ type: "absolute", value: 1000 }= start 1 second after previous segment - Duration:
{ type: "relative", value: 0.5 }= last for 50% of total video duration
Timing & Duration Calculation
How Segment Timing Works
- Sequential within channels: Segments in the same channel play one after another
- Parallel across channels: Segments in different channels play simultaneously
- Offset delays: Each segment can delay relative to the previous one
Duration Calculation Rules
Example Timeline
Positioning & Transform Properties
Position
| Property | Description | Example |
|---|---|---|
xOffset | Distance from left edge in pixels | 540 centers a 1080px-wide element in a 1920px canvas |
yOffset | Distance from top edge in pixels | 0 places at the top |
Size
| Property | Description | Notes |
|---|---|---|
width | Element width in pixels | Combined with fit mode for media |
height | Element height in pixels | Combined with fit mode for media |
Transforms
| Property | Range | Description |
|---|---|---|
scale | 0.1 - 10 | Size multiplier (1 = original size, 2 = 200%, 0.5 = 50%) |
rotation | 0 - 360 | Rotation in degrees (clockwise) |
opacity | 0 - 100 | Transparency (0 = invisible, 100 = fully opaque) |
zIndex | any integer | Layer order (higher numbers appear on top) |
Fit Modes
Controls how media (video/image) fits within specified width/height bounds.cover (Default for video)
- Behavior: Fills entire area, crops overflow
- Use case: Full-screen backgrounds
- Aspect ratio: Maintained
- Example: 16:9 video in 9:16 canvas → sides cropped
contain (Default for image)
- Behavior: Fits entire media, may have letterboxing
- Use case: Logos, overlays that must be fully visible
- Aspect ratio: Maintained
- Example: Square image in rectangular area → bars on sides or top/bottom
fill
- Behavior: Stretches to fill entire area
- Use case: Rare - usually avoid as it distorts
- Aspect ratio: Not maintained
- Example: Any aspect ratio → stretched to match bounds exactly
Text Styling Reference
Font Options
fontType | Description |
|---|---|
'tiktok' | TikTok Sans font family (default, recommended) |
'apple' | SF Pro font (Apple system font) |
'arial' | Arial fallback font |
Font Weight Options
fontWeight | Rendering |
|---|---|
'normal' | Regular weight |
'bold' | Bold weight |
Text Alignment
alignment | Effect |
|---|---|
'left' | Align to left edge |
'center' | Center horizontally |
'right' | Align to right edge |
'justify' | Justify text (stretch to fill width) |
verticalAlign | Effect |
|---|---|
'top' | Align to top edge |
'middle' | Center vertically |
'bottom' | Align to bottom edge |
Text Wrapping Modes
textWrap | Behavior |
|---|---|
'word' | Break at word boundaries (recommended) |
'char' | Break at any character |
'none' | No wrapping, text may overflow |
wordBreak | Behavior |
|---|---|
'normal' | Break at normal word boundaries |
'break-all' | Break between any two characters |
'break-word' | Break long words if necessary |
Color Format
All colors use hex format with optional alpha channel:#FFFFFF- White#000000- Black#FF0000- Red#00000080- 50% transparent black#FFFFFF00- Fully transparent white
Complete Example: Multi-Layer Video
Complete Example: Static Image
Best Practices
Layering
- Use
zIndexto control stacking order - Background elements:
zIndex: 0 - Mid-layer elements:
zIndex: 5 - Text/overlays:
zIndex: 10+ - Keep zIndex values spaced for easy insertion
Performance
- Limit segments: < 50 per composition
- Optimize source media: compress before upload
- Use appropriate resolutions:
- TikTok/Instagram: 1080x1920 (9:16)
- YouTube Shorts: 1080x1920 (9:16)
- Square: 1080x1080 (1:1)
Timing
- Use
offsetfor staggered animations - Combine absolute and relative times for flexibility
- Test edge cases (segment boundaries, overlaps)
Text Rendering
- Readability: Use high contrast (white text on dark bg or vice versa)
- Stroke: Add
strokeWidth: 3-5for text on video backgrounds - Font size: Minimum 40px for mobile readability
- Line count: Keep under 3 lines for best engagement
- Emojis: Fully supported, render correctly
Color Selection
- Text on video: White with black stroke (
color: "#FFFFFF",strokeColor: "#000000") - Backgrounds: Use semi-transparent (
#00000080for 50% black) - Highlights: Brand colors with full opacity
- Test: Verify colors on different screens/backgrounds
Media Sources
- URLs must be publicly accessible: No auth required
- Supported formats:
- Video: MP4, MOV, WebM
- Image: PNG, JPEG, GIF, WebP
- Audio: MP3, WAV, OGG
- HTTPS required: All source URLs must use HTTPS
- CORS: Ensure proper CORS headers on your media server
Common Patterns
Full-Screen Video Background
Centered Logo Overlay
Bottom-Third Text Banner
Fade In Effect (Manual)
Troubleshooting
Text Not Appearing
- Check
zIndex- must be higher than background elements - Verify
opacityis > 0 - Ensure
colorcontrasts with background - Check timing - verify segment is active during playback
Media Not Loading
- Verify URL is publicly accessible (test in browser)
- Check CORS headers on media server
- Ensure HTTPS (not HTTP)
- Verify file format is supported
Unexpected Timing
- Review
offsetvalues - they’re relative to previous segment - Check
startTrimandendTrimvalues - Verify
durationoverrides if specified - Remember: segments in same channel are sequential, different channels are parallel
Quality Issues
- Use higher resolution source media
- Avoid over-scaling (
scale> 2.0) - Use
fit: 'contain'instead offillto avoid distortion - Ensure FPS matches source media (typically 30fps)
