Interface

UseTimelineMediaPlaybackOptions

Options for coordinating timeline playback with an external media clock.

Usage notes

Use this hook when your preview surface owns the media clock. The hook tells TimelineEngine to play with an external clock, reads timeline seconds from `getClockTime`, and calls `syncLayers` with an ActiveLayerResult whenever active clips need to be rendered, sought, or paused. Higher-level adapters such as `useHTMLTimelineMedia` and `useMediabunnyTimelineMedia` wrap this contract for common media stacks.

Signature

Type Definition
Interface UseTimelineMediaPlaybackOptions

Type parameters

NameConstraintDefaultDescription
LayerNamestringstringNamed media layer keys inferred from `layers`, such as `"visuals" | "audio"`.

Properties

NameSignatureDescription
frameRate?frameRate?: TimecodeFrameRateOptional sequence frame rate used to quantize playback updates to project frames.
getClockTime(): numberReturns current timeline seconds from the external media clock.
layerslayers: Record<LayerName, ActiveLayerSelector>Named active layer selectors used by the external media surface.
onStatus?(status: TimelineContentPlaybackStatus): voidReceives high-level playback status changes.
stopClock?(): voidStops the external media clock when timeline playback pauses or leaves active content.
syncLayers?(details: TimelineLayerSyncDetails<LayerName>): MaybePromise<void>Synchronizes external rendering, audio, text, or effects for the active layers.