Concepts
Clip
Use multiple clips to segment your video logically
Clip is a container for visual and audio elements, with its own duration and transition effects.
Get the final JSON representing of the Clip
You can create Clip by JSON directly
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use multiple clips to segment your video logically
| Property | Type | Default | Description |
|---|---|---|---|
| id | string | uuid() | A unique identifier for the clip. |
| duration | number | 5 | The length of the clip in seconds. |
| durationLock | boolean | false | A boolean indicating whether the duration is locked or can be adjusted in the editor. |
| transition | string | none | The type of transition effect when moving to the next clip(e.g., none, fade, wipe, flip, slide, clock) |
| elements | array | [] | An array of Element objects contained within the clip |
| audios | array | [] | An array of AudioPlay objects for audio tracks in the clip |
| background | object | null | Optional background settings for the clip, which can override the project’s theme |
import BlendDuck, { Clip, Text, AudioPlay } from "@blendduck/node-sdk";
const clip = new Clip(5); // Create a 5-second clip
clip.transition = 'fade';
// Add a text element to the clip
const textElement = new Text();
textElement.text = "Hello, BlendDuck!";
clip.addElement(textElement);
// Add an audio track to the clip
const audio = new AudioPlay({ url: "https://s.blendduck.com/audios/motivation.mp3" });
clip.addAudioPlay(audio);
// Set a custom background for this clip
clip.background = {
color: {
type: "color",
color: "#00ff33ff"
}
};
const json = clip.toJSON();
const clip = Clip.fromJSON(json)