mcut
@mcut/editor

elementForAsset

Generated TypeScript API reference for the public mcut SDK.

mcut SDK


mcut SDK / editor/src / elementForAsset

Function: elementForAsset()

function elementForAsset(engine, asset): TimelineElementInput;

Defined in: packages/editor/src/timeline-operators.ts:79

Default timeline element for a media-bin asset.

Parameters

engine

EditorEngine

asset

durationMs?

number = ...

hash?

string = ...

Content hash of the media file (stable identity across reloads/moves).

height?

number = ...

id

`a-${string}` = assetIdSchema

kind

"video" | "audio" | "image" = ...

mimeType?

string = ...

name?

string = ...

nativePreview?

boolean = ...

True when the browser's native media elements can preview this asset. Containers such as Matroska may import/export through Mediabunny while still needing decoded-frame fallback for interactive canvas preview.

src

string = ...

Object URL, data URL, or remote URL. Projects stay JSON-serializable — but treat this as a RUNTIME BINDING, not identity: object URLs are dead after a reload, so persistence layers re-resolve src on load (e.g. from OPFS via hash) and relink UIs match on hash/name.

width?

number = ...

Returns

TimelineElementInput

On this page