Captions
Imperative controller that owns the Konva stage lifecycle for a single video element.
Imperative controller that owns the Konva stage lifecycle for a single video element.
Constructors
Constructor
new Captions(options): Captions;Create a controller bound to the provided video element and preset.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | CaptionsOptions | Complete configuration for the controller. |
Returns
Captions
Methods
captions()
captions(nextCaptions): void;Replace the current caption track and repaint without reloading fonts.
Parameters
| Parameter | Type | Description |
|---|---|---|
nextCaptions | Caption[] | null | Timed words that should drive the overlay. |
Returns
void
destroy()
destroy(): void;Alias for disable() to match typical imperative controller APIs.
Returns
void
disable()
disable(): void;Tear down overlays, observers and animation loops to free resources.
Returns
void
enable()
enable(): void;Mount caption overlays onto the configured video if they are not active yet.
Returns
void
getRenderCount()
getRenderCount(): number;Number of times the scene has been rebuilt. Useful for diagnostics and tests — it stays flat while the video is paused.
Returns
number
isEnabled()
isEnabled(): boolean;Whether the Konva overlay is currently attached to the video element.
Returns
boolean
true when the overlay is mounted on top of the video.
preset()
preset(nextPreset): void;Swap the active preset and re-render with updated typography/colors.
Parameters
| Parameter | Type | Description |
|---|---|---|
nextPreset | StylePreset | Preset that becomes the new render baseline. |
Returns
void
For AI agents and LLMs: this page as Markdown · llms.txt · all docs in one file