/** * @copyright * (c) 2025 netTrek GmbH & Co. KG – All rights reserved. * * This source code is part of the C2PA-HLS integration library. */ import type Hls from 'hls.js'; import { Interval } from '@flatten-js/interval-tree'; import { C2paManifestHelper } from './C2paManifestHelper'; import { AbstractC2PABridge, type C2PAConfig } from './C2paBridge'; /** * A bridge class that connects HLS.js with the C2PA.js runtime to enable real-time * fragment validation for fMP4-based HLS streams (VOD and live). * * It intercepts fragment loading, extracts raw binary data, validates via the C2PA WebAssembly API, * and maps manifest data to timecode ranges using an interval tree. */ export declare class C2paHlsBridge extends AbstractC2PABridge { #private; /** * Creates a new C2PAHlsBridge instance. * @param hls - The HLS.js player instance to attach fragment hooks to. */ constructor(config: C2PAConfig | undefined, hls: Hls); getC2PAMetaByTimeCode(timeCode: number): C2paManifestHelper | null; getTamperedWithIntervals(): Interval[]; dispose(): void; /** * The C2PA runtime initializes asynchronously (WASM load). For short or * already-buffered streams, every fragment can finish loading *before* the * runtime is ready — in which case the FRAG_LOADING-driven queue bailed on * `!this.c2pa` and nothing would ever re-trigger it. Now that the runtime is * available, drain any level that still has pending fragments. */ protected onRuntimeReady(): void; }