Usage notes
Provide timeline sources and named active layer selectors; the hook returns the callback ref used to connect a canvas for visual frames. It creates a MediabunnyAdapter, uses useTimelineMediaSync for external-clock playback, and keeps decoded frames and audio scheduling aligned with the timeline playhead.
Signature
Interface UseMediabunnyTimelineMediaOptionsType parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
LayerName | string | string | Named media layer keys inferred from `layers`, such as
`"visuals" | "audio"`. |
Properties
| Name | Signature | Description |
|---|---|---|
audio? | audio?: MediabunnyTimelineAudioOptions | Audio scheduling options for source playback. |
audioTrackKinds? | audioTrackKinds?: typeOperator | Track kinds the adapter should treat as audio scheduling sources. Defaults to `["audio"]`. |
frameRate? | frameRate?: TimecodeFrameRate | Optional sequence frame rate used to lock media playback to project frames. |
layers | layers: Record<LayerName, ActiveLayerSelector> | Named active layer selectors used by the external media surface. |
mediabunny? | mediabunny?: __module | () => Promise<__module> | Mediabunny module instance or lazy browser loader. Defaults to a browser import. |
onError? | (error: TimelineMediaError): void | Receives structured media failures with a stable machine-readable reason. |
playbackOptions? | playbackOptions?: Omit<PlaybackOptions, "clock"> | Core playback range and looping policy captured when each playback run begins. |
selectTracks? | (context: MediabunnyTrackSelectionContext): MaybePromise<MediabunnyTrackSelection> | Selects the video/audio tracks used by each source input. |
sources | sources: typeOperator | Media sources keyed by the `sourceId` values used by timeline clips. |
visualTrackKinds? | visualTrackKinds?: typeOperator | Track kinds the adapter should treat as visual frame sources. Defaults to `["visual"]`. |