v1.0.0-rc.1
Some breaking changes were introduced with v1.0.0-rc.1
. Here is a migration guide:
appendTrack
has been renamed to shiftTrack
.
before:
const track = composition.appendTrack(VideoTrack);
after:
const track = composition.shiftTrack(VideoTrack);
appendClip
has been renamed to add
.
before:
const clip = await composition.appendClip(new Clip());
// when using tracks
const clip = await track.appendClip(new Clip());
after:
const clip = await composition.add(new Clip());
// when using tracks
const clip = await track.add(new Clip());
position
has been renamed to layer
on the track object
before:
const track = composition.appendTrack(VideoTrack).position('bottom');
after:
const track = composition.shiftTrack(VideoTrack).layer('bottom');
New Features
a new method for creating tracks has been introduced:
const track = composition.createTrack('video');
// equivalent to
const track = composition.shiftTrack(VideoTrack);
This enabled us to add a new new method to the MediaClip
for creating captions, which was previously not possible due to circular dependencies:
const audio = new AudioClip(new File(), { transcript: new Transcript() });
await composition.add(audio);
await audio.generateCaptions();
Note the
MediaClip
needs to be added to the composition for the generateCaptions method to be available.