GitHub

Layer types

Add Sequence

Use composition.addSequence() to sequence a list of layers in a composition.

composition.addSequence() signature

addSequence(
  layers: (Audio | Html | Image | Lottie | Text | Video | Waveform )[],
  config?:SequenceLayerConfig
): Promise<Sequence>

Sequence layer configuration

The config argument supports the following layer configuration properties:

Sequence class

Calling composition.addSequence() returns an instance of the Sequence class, which allows you to read its layer options and read/update its layer configuration through getters/setters.

Reading layer options

sequence.type; // "sequence"

Examples

Minimal

const video1 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/doge-short.mp4"
);
const video2 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/drone-lagoon-short.mp4"
);
const video3 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/fire-short.mp4"
);


await composition.addSequence([video1, video2, video3]);

Output

All layer configuration

const video1 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/doge-short.mp4"
);
const video2 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/drone-lagoon-short.mp4"
);
const video3 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/fire-short.mp4"
);


await composition.addSequence([video1, video2, video3], {
  timeline: { start: 1 },
});

Output

Method chaining approach

const video1 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/doge-short.mp4"
);
const video2 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/drone-lagoon-short.mp4"
);
const video3 = await composition.addVideo(
  "https://editframe.com/docs/layer-types/add-sequence/fire-short.mp4"
);


const sequence = await composition.addSequence([video1, video2, video3]);\n
// Timeline
sequence.setStart(1);

Output

Previous
Add Lottie