Interface

UseMediabunnyTimelineMediaOptions

Options for wiring Mediabunny decoded preview directly to timeline playback.

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

Type Definition
Interface UseMediabunnyTimelineMediaOptions

Type parameters

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

Properties

NameSignatureDescription
audio?audio?: MediabunnyTimelineAudioOptionsAudio scheduling options for source playback.
audioTrackKinds?audioTrackKinds?: typeOperatorTrack kinds the adapter should treat as audio scheduling sources. Defaults to `["audio"]`.
frameRate?frameRate?: TimecodeFrameRateOptional sequence frame rate used to lock media playback to project frames.
layerslayers: 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): voidReceives 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.
sourcessources: typeOperatorMedia sources keyed by the `sourceId` values used by timeline clips.
visualTrackKinds?visualTrackKinds?: typeOperatorTrack kinds the adapter should treat as visual frame sources. Defaults to `["visual"]`.