Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/core/entities/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AudioPlayer } from "./audio-player";
import { Entity } from "./entity";
import { HtmlPlayer } from "./html-player";
import { ImagePlayer } from "./image-player";
import { LumaPlayer } from "./luma-player";
import type { Player } from "./player";
import { ShapePlayer } from "./shape-player";
import { TextPlayer } from "./text-player";
Expand Down Expand Up @@ -439,6 +440,10 @@ export class Edit extends Entity {
player = new AudioPlayer(this, clipConfiguration);
break;
}
case "luma": {
player = new LumaPlayer(this, clipConfiguration);
break;
}
default:
throw new Error(`Unsupported clip type: ${(clipConfiguration.asset as any).type}`);
}
Expand All @@ -465,8 +470,15 @@ export class Edit extends Entity {
}

trackContainer.addChild(clipToAdd.getContainer());

const isClipMask = clipToAdd instanceof LumaPlayer;

await clipToAdd.load();

if (isClipMask) {
trackContainer.setMask({ mask: clipToAdd.getMask(), inverse: true });
}

this.updateTotalDuration();
}
}