import type { NMVideoPlayer } from '../../index.js'; import type { VideoPlaylistItem } from '../../types.js'; import { Plugin } from '@nomercy-entertainment/nomercy-player-core'; /** Options for the video {@link LiveTranscodingPlugin}. */ export interface LiveTranscodingOptions { /** Server endpoint that owns the transcoding job lifecycle (typically WebSocket). */ controlUrl?: string; /** Alias of `controlUrl`. Either one works. */ wsUrl?: string; /** Optional polling fallback for environments without WS. */ pollIntervalMs?: number; /** How many seconds of buffer must exist beyond `currentTime` before resuming. */ resumeAheadSeconds?: number; /** When seeking, max milliseconds we'll wait for the transcoder to reach the target. */ seekTimeoutMs?: number; /** Quality / bitrate preference hint sent to the encoder. */ preferredHeight?: number; } /** Events emitted by the video {@link LiveTranscodingPlugin}. */ export interface LiveTranscodingEvents { 'job:started': { jobId: string; sourceUrl: string; }; 'job:progress': { jobId: string; transcodedSeconds: number; totalSeconds?: number; variantsReady: string[]; }; 'job:ready-to-play': { jobId: string; }; 'job:error': { jobId: string; error: Error; }; 'job:complete': { jobId: string; }; } /** * Live-transcoding orchestration plugin for video. Coordinates the player * with a server that transcodes video on-demand, segment by segment. * * Real wiring on the gate side, mocked on the actual transcode server. The * plugin opens a WebSocket via `Plugin.websocket()` (auto-closes on dispose) * and gates `beforeLoad` / `beforeSeek` until the server reports the * requested timestamp is encoded. Without a server URL the plugin is inert. */ export declare class LiveTranscodingPlugin extends Plugin, LiveTranscodingOptions, LiveTranscodingEvents> { static readonly id: string; static readonly version: string; static readonly description: string; private channel; private _transcodedTo; private currentJobId; /** Opens the control WebSocket and wires `beforeLoad` / `beforeSeek` transcoder-ready gates. */ use(): void; /** Drops the WebSocket channel reference and resets transcoding progress state. */ dispose(): void; /** Returns the current transcoder write head in seconds. */ transcodedTo(): number; private onServerMessage; private waitFor; } /** Plugin alias for the video {@link LiveTranscodingPlugin}. Pass to `addPlugin(liveTranscodingPlugin)`. */ export declare const liveTranscodingPlugin: typeof LiveTranscodingPlugin;