import type { PlayerState } from '../core/player-state.js'; import { type VttCue } from './webvtt-parser.js'; /** A loaded track with its parsed cues */ export interface CaptionTrack { srclang: string; label: string; cues: VttCue[]; isDefault: boolean; } /** * Caption / subtitle renderer. * * Fetches `` children via their `src` attribute, parses the * WebVTT content, and renders the active cue as a HUD overlay * positioned at the bottom of the player viewport. * * The overlay stays fixed relative to the viewport so that * captions remain visible regardless of camera orientation in * 360° video. */ export declare class CaptionRenderer { private tracks; private activeTrackIndex; private overlay; private shadow; private unsubscribes; private lastCueId; constructor(shadow: ShadowRoot, state: PlayerState); /** * Load all `` children from the host element. * Each track with a valid `src` is fetched and parsed. */ loadTracks(hostElement: HTMLElement): Promise; /** Get all loaded tracks */ getTracks(): Readonly; /** Get the currently active track index (-1 = off) */ getActiveTrackIndex(): number; /** Set the active caption track by index. -1 = off. */ setActiveTrack(index: number): void; /** Toggle captions on/off. If off, activates the first available track. */ toggle(): void; /** Whether captions are currently active */ isActive(): boolean; /** Whether any tracks are loaded */ hasTracks(): boolean; dispose(): void; private fetchAndParse; /** Find and render the active cue for the given time */ private renderCue; /** * Linear search for the active cue at the given time. * WebVTT cue arrays are typically small (<200 entries), * so linear scan is fine. */ private findActiveCue; } //# sourceMappingURL=caption-renderer.d.ts.map