v1.0.0-rc.1
diffusionstudio/corev1.0.0-rc.1Sep 3, 2024by k9p5
AI Summary
This release introduces significant API changes, renaming methods and properties for consistency, while adding new methods for track creation and automatic caption generation.
Key Highlights
- Renamed `appendTrack` to `shiftTrack`
- Renamed `appendClip` to `add`
- Renamed `position` to `layer`
- New `createTrack` method
- New `generateCaptions` method
Breaking Changes
- `appendTrack` has been renamed to `shiftTrack`
- `appendClip` has been renamed to `add`
- `position` has been renamed to `layer`
New Features
- createTrack method
- generateCaptions method
Full Release Notes
Some breaking changes were introduced with `v1.0.0-rc.1`. Here is a migration guide:
## `appendTrack` has been renamed to `shiftTrack`.
before:
```typescript
const track = composition.appendTrack(VideoTrack);
```
after:
```typescript
const track = composition.shiftTrack(VideoTrack);
```
## `appendClip` has been renamed to `add`.
before:
```typescript
const clip = await composition.appendClip(new Clip());
// when using tracks
const clip = await track.appendClip(new Clip());
```
after:
```typescript
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:
```typescript
const track = composition.appendTrack(VideoTrack).position('bottom');
```
after:
```typescript
const track = composition.shiftTrack(VideoTrack).layer('bottom');
```
# New Features
a new method for creating tracks has been introduced:
```typescript
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:
```typescript
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.