export interface HlsSegment { url: string; duration: number; /** Set for #EXT-X-BYTERANGE segments (all slices of one resource). */ byteRange?: { length: number; offset: number; }; } /** A media-playlist parse result (video/muxed, an audio language, or subs). */ export interface HlsMediaTrack { segments: HlsSegment[]; initSegment?: string; container: "ts" | "mp4"; totalDuration: number; isLive: boolean; } export interface HlsAudioRendition extends HlsMediaTrack { lang: string; label: string; isDefault: boolean; } export interface HlsSubtitleRendition { lang: string; label: string; segments: HlsSegment[]; isDefault: boolean; } export interface HlsFallbackPlan { /** Video (or muxed video+audio) segments. */ segments: HlsSegment[]; initSegment?: string; container: "ts" | "mp4"; totalDuration: number; isLive: boolean; /** Separate audio languages (present only when the variant has an AUDIO group). */ audioRenditions?: HlsAudioRendition[]; /** Subtitle languages (segmented WebVTT). */ subtitleRenditions?: HlsSubtitleRendition[]; /** * Selectable video qualities (the master's variants in the chosen audio * group, best-first). `url` is the variant playlist URL — pass it back as * `forceVariantUrl` to switch quality. Present only when there's a choice. */ videoTracks?: { url: string; label: string; id: string; bandwidth?: number; }[]; /** The variant playlist URL this plan was built from (the active quality). */ selectedVariant?: string; } /** * Concatenate the WebVTT bodies of an HLS subtitle rendition's segments into * one VTT document with presentation-absolute cue times (each segment's cues * shifted by its X-TIMESTAMP-MAP offset). Non-cue blocks (STYLE/NOTE/REGION) * and duplicate WEBVTT headers are dropped. */ export declare function buildVttFromSegments(texts: string[]): string; /** * Fetch + parse just one variant's media playlist → its segments (and fMP4 * init). Used by the in-place quality switch, which only needs the new video * segments — no need to re-analyze the whole master, audio and subtitles. */ export declare function loadHlsVariant(variantUrl: string, headers?: Record, signal?: AbortSignal): Promise<{ segments: HlsSegment[]; initSegment?: string; } | null>; /** * Fetch and parse an HLS playlist (master or media) into a demuxable plan. * Returns null when there's nothing playable. */ export declare function analyzeHlsFallback(url: string, headers?: Record, forceVariantUrl?: string, signal?: AbortSignal): Promise; //# sourceMappingURL=HlsFallback.d.ts.map