---
title: "Working with Video Clips | Rendley SDK Docs"
description: "Working with clips in the Rendley SDK. The common API shared by video, image, audio, text, shape, SVG, GIF, Lottie and custom clip types."
url: https://docs.rendley.com/sdk/getting-started/clips/
---

# Clips

A [clip](https://docs.rendley.com/sdk/api-reference/classes/Clip.html) is the smallest unit of a composition. Every clip lives on a [layer](https://docs.rendley.com/sdk/getting-started/layer/) on the [timeline](https://docs.rendley.com/sdk/getting-started/timeline/). Clips expose a common API for timing, visibility, effects, filters, animation, and masking, on top of that, each clip type (text, video, shape, lottie, and so on) adds its own specific methods.

This page covers:

- How to add a clip to a layer
- What each clip type does and where to find the full reference
- The shared API every clip exposes

## Adding a clip

Call [`layer.addClip()`](https://docs.rendley.com/sdk/api-reference/classes/Layer.html) with the clip’s options. The return value is the created clip.

Runnable exampleShow full code

Run

```
await layer.addClip({
  type: "text",
  text: "Hello World",
  startTime: 0,
  duration: 3,
  style: { fontSize: 140, color: "#FFFFFF", position: [960, 540] },
});
```

Media-based clips (video, audio, image, GIF, SVG) need a `mediaDataId` pointing to an entry in the [Library](https://docs.rendley.com/sdk/getting-started/library/):

```
const mediaId = await Engine.getInstance()
  .getLibrary()
  .addMedia("https://example.com/photo.jpg");

await layer.addClip({
  mediaDataId: mediaId,
  startTime: 0,
  duration: 5,
});
```

[!NOTE] Two clips cannot overlap on the same layer. If you want a clip to sit on top of another, create a new layer and add it there.

### Adjust layout on add

By default, adding a clip that overlaps existing clips on the same layer pushes the others to make room. Disable this behavior when you want the call to fail silently rather than reflow:

```
await layer.addClip({ mediaDataId, startTime: 0 }, { adjustLayout: false });
```

## Clip types

Each clip type has its own page covering its constructor options and type-specific API.

### Media

| Clip | What it renders |
| --- | --- |
| [Video](https://docs.rendley.com/sdk/getting-started/clips/video/) | A video file with trim, freeze frame, playback speed, and audio extraction. |
| [Audio](https://docs.rendley.com/sdk/getting-started/clips/audio/) | An audio file with trim, volume, fade in / fade out, and playback speed. |
| [Image](https://docs.rendley.com/sdk/getting-started/clips/image/) | A static image (JPEG, PNG, WebP, HEIC). |
| [Gif](https://docs.rendley.com/sdk/getting-started/clips/gif/) | An animated GIF. |
| [Svg](https://docs.rendley.com/sdk/getting-started/clips/svg/) | A vector graphic that stays crisp at any resolution. |

### Generative

| Clip | What it renders |
| --- | --- |
| [Text](https://docs.rendley.com/sdk/getting-started/clips/text/) | Text drawn on the canvas with font, color, stroke, and drop shadow controls. |
| [HTML Text](https://docs.rendley.com/sdk/getting-started/clips/html-text/) | An HTML snippet rendered as a visual element. |
| [Shape](https://docs.rendley.com/sdk/getting-started/clips/shape/) | Rectangles, circles, triangles, stars, polygons, beziers. |
| [Lottie](https://docs.rendley.com/sdk/getting-started/clips/lottie/) | An After Effects composition (Lottie JSON). |

### Special

| Clip | What it does |
| --- | --- |
| [Subtitles](https://docs.rendley.com/sdk/getting-started/clips/subtitles/) | Time-synced captions sourced from the Library. |
| [Adjustment](https://docs.rendley.com/sdk/getting-started/clips/adjustment/) | Applies effects and filters to everything below it on the frame. |
| [Placeholder](https://docs.rendley.com/sdk/getting-started/clips/placeholder/) | Holds a timeline slot until its media finishes loading. |
| [Custom](https://docs.rendley.com/sdk/getting-started/clips/custom/) | Your own clip type, extending the base [`Clip`](https://docs.rendley.com/sdk/api-reference/classes/Clip.html) class. |

## Common API

Every clip type inherits the following controls. Use this section as a reference when you’re unsure which page to look at.

### Timing and trimming

```
clip.setStartTime(2);
clip.setLeftTrim(0.5);
clip.setRightTrim(0.5);
clip.moveBy(1);

clip.getStartTime();
clip.getEndTime();
clip.getDuration();
clip.getTrimmedDuration();
```

### Visibility and audio

```
clip.setVisible(false);
clip.setMuted(true);
clip.setVolume(0.5);
```

For smooth fade-in / fade-out on audio, see [Playback Speed & Fades](https://docs.rendley.com/sdk/getting-started/playback-speed/).

### Blend mode

Controls how the clip blends with content on layers below it:

```
import { BlendModeEnum } from "@rendley/sdk";

clip.setBlendMode(BlendModeEnum.SCREEN); // NORMAL | ADD | SCREEN | MULTIPLY
```

### Wrap mode

Controls what happens outside the clip’s duration for looping clips (Lottie, GIF, custom):

```
import { WrapModeEnum } from "@rendley/sdk";

clip.setWrapMode(WrapModeEnum.PING_PONG); // CLAMP | REPEAT | PING_PONG | EMPTY
```

### Effects, filters, and masking

All clips can receive effects and filters, and any clip can be used as an alpha mask for another.

- [Effects](https://docs.rendley.com/sdk/getting-started/effects/)
- [Filters](https://docs.rendley.com/sdk/getting-started/filters/)
- [Masking](https://docs.rendley.com/sdk/getting-started/masking/)

### Animation

Every clip exposes two animation systems. Use whichever fits the task:

- [Keyframe Animation](https://docs.rendley.com/sdk/getting-started/property-animator/) (recommended) via `clip.propertyAnimator`.
- [Animation Controller](https://docs.rendley.com/sdk/getting-started/animation-layered/) via `clip.animationController`.

### Custom data

Attach metadata that survives serialization:

```
clip.setCustomData("source", "https://example.com/source");
const src = clip.getCustomData("source");
clip.hasCustomData("source");
clip.clearAllCustomData();
```

The same API is available on [Engine](https://docs.rendley.com/sdk/api-reference/classes/Engine.html), [Library](https://docs.rendley.com/sdk/api-reference/classes/Library.html), [Timeline](https://docs.rendley.com/sdk/api-reference/classes/Timeline.html), [Layer](https://docs.rendley.com/sdk/api-reference/classes/Layer.html), and [MediaData](https://docs.rendley.com/sdk/api-reference/classes/MediaData.html).

## What to read next

- **[Layers](https://docs.rendley.com/sdk/getting-started/layer/)** control stacking order and what draws on top.
- **[Timeline](https://docs.rendley.com/sdk/getting-started/timeline/)** arranges layers and clips in time.
- **[Styling](https://docs.rendley.com/sdk/getting-started/styling/)** positions, scales, rotates and colors a clip.
- **[Crop and zoom](https://docs.rendley.com/sdk/getting-started/crop/)** reframes a clip inside the composition.
- **[Custom clips](https://docs.rendley.com/sdk/getting-started/clips/custom/)** extend CustomClip to render anything you like.

[Previous pageLayers](https://docs.rendley.com/sdk/getting-started/layer/) [Next pageProject settings](https://docs.rendley.com/sdk/getting-started/settings/)
