PreviewMediaPool
Generated TypeScript API reference for the public mcut SDK.
mcut SDK / media/src / PreviewMediaPool
Class: PreviewMediaPool
Defined in: packages/media/src/preview-pool.ts:207
The approximate, low-latency FrameSource used for interactive
preview: one pooled <video>/<audio> element per media asset, kept in
sync with the playback clock, plus decoded ImageBitmaps for images.
Audio plays through the media elements themselves (no Web Audio graph);
the deterministic export pipeline is a separate implementation.
Known approximation: two simultaneously-active elements sharing one asset share one media element, so they render the same source frame.
Implements
Constructors
Constructor
new PreviewMediaPool(resolveAsset): PreviewMediaPool;Defined in: packages/media/src/preview-pool.ts:216
Parameters
resolveAsset
(assetId) =>
| {
durationMs?: number;
hash?: string;
height?: number;
id: `a-${string}`;
kind: "video" | "audio" | "image";
mimeType?: string;
name?: string;
nativePreview?: boolean;
src: string;
width?: number;
}
| undefined
Returns
PreviewMediaPool
Methods
dispose()
dispose(): void;Defined in: packages/media/src/preview-pool.ts:379
Returns
void
getFrame()
getFrame(assetId, sourceTimeMs): CanvasImageSource | null;Defined in: packages/media/src/preview-pool.ts:218
Image for assetId at sourceTimeMs (media-local time, after trim).
Return null when no frame is available yet; the compositor skips it.
Parameters
assetId
`a-${string}`
sourceTimeMs
number
Returns
CanvasImageSource | null
Implementation of
pauseAll()
pauseAll(): void;Defined in: packages/media/src/preview-pool.ts:373
Pause everything (e.g. when the player unmounts a project).
Returns
void
sync()
sync(items, options): void;Defined in: packages/media/src/preview-pool.ts:263
Reconcile pooled media elements with the items active under the playhead. Called by the playback loop every frame and on seeks.
Parameters
items
options
Returns
void