GIF Clip
The GifClip renders animated GIFs and is the go-to choice for stickers and other animated visual elements that need transparency.
Create a GIF Clip
typescript
const mediaId = await Engine.getInstance()
.getLibrary()
.addMedia("https://example.com/sticker.gif");
await layer.addClip({
mediaDataId: mediaId,
startTime: 0,
});Playback Speed
GIFs support speed changes the same way videos do:
typescript
gifClip.setPlaybackSpeed(2); // twice as fast
gifClip.setPlaybackSpeed(0.5); // half speedSee Playback Speed & Fades for the full range and caveats.
Wrap Mode
Control what happens after the animation reaches its end:
typescript
import { WrapModeEnum } from "@rendley/sdk";
gifClip.setWrapMode(WrapModeEnum.REPEAT); // loop
gifClip.setWrapMode(WrapModeEnum.PING_PONG); // reverse and replay
gifClip.setWrapMode(WrapModeEnum.CLAMP); // freeze on the last frame
gifClip.setWrapMode(WrapModeEnum.EMPTY); // disappearSee Also
- Image
- Lottie: richer animation authored in After Effects.
- Clip API Reference
- API reference:
GifClip