Interface

ActiveLayerOptions

Options for selecting active timeline layers at a timeline time. Use this when integrations need named layers such as `visuals`, `audio`, `subtitles`, or `effects` instead of one flat active-clip list. The same active clip can match more than one layer.

Signature

Type Definition
Interface ActiveLayerOptions

Type parameters

NameConstraintDefaultDescription
LayerNamestringstringString literal names for the layers your integration exposes, for example `"visuals" | "audio"`.
TrackKindNonestringApp-defined track kind values matched by each layer selector.

Properties

NameSignatureDescription
layerslayers: Record<LayerName, ActiveLayerSelector<TrackKind>>Named layer selectors, such as `{ visuals, audio, subtitles, effects }`.
time?time?: RationalTimeTimeline time to inspect. Defaults to the current playhead.

Examples

ts Example
import { fromSeconds } from '@techsquidtv/canvas-timeline-utils';
import type { ActiveLayerOptions } from '@techsquidtv/canvas-timeline-core';
const options = {
time: fromSeconds(4),
layers: {
visuals: { trackKind: 'visual', sourceId: 'source-1' },
audio: { trackKind: 'audio', sourceId: 'source-1' },
},
} satisfies ActiveLayerOptions<'visuals' | 'audio', 'visual' | 'audio'>;