type MatchingKeys = K extends (TRecord[K] extends TMatch ? K : never) ? K : never; type VoidKeys = MatchingKeys; type EventListenerReturnType = (() => void) | void; declare class Emitter = VoidKeys, ArgEvents extends Exclude = Exclude, ArgLessEmits extends VoidKeys = VoidKeys, ArgEmits extends Exclude = Exclude> { private listeners; /** * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch; * an override that returns lets the remaining listeners and deferred functions run. */ protected handleListenerError(error: unknown, _eventName: PropertyKey): void; emit(eventName: T): void; emit(eventName: T, args: TEmits[T]): void; /** * Remove an event listener from `eventName` */ off(eventName: T, fn: () => EventListenerReturnType): void; off(eventName: T, fn: (args: TEvents[T]) => EventListenerReturnType): void; /** * Add an event listener to `eventName` * * Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. * This is useful when one listener may want everone to have reacted to an event before calling something. */ on(eventName: T, fn: () => void): void; on(eventName: T, fn: (args: TEvents[T]) => void): void; /** * Add an event listener to `eventName` that will be called once only * * Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. * This is useful when one listener may want everone to have reacted to an event before calling something. */ once(eventName: T, fn: () => void): void; once(eventName: T, fn: (args: TEvents[T]) => void): void; /** * Check whether there are any listeners registered for the given event. */ hasListeners(eventName: T): boolean; /** * Reset the event emitter */ reset(): void; private add; } declare const LogLevels: readonly [ "off", "error", "warn", "info", "debug", "trace" ]; type LogLevel = (typeof LogLevels)[number]; declare const LogLevel: { ERROR: "error"; WARN: "warn"; INFO: "info"; DEBUG: "debug"; TRACE: "trace"; OFF: "off"; }; type VideoCodec = "h264" | "h265" | "av1"; interface ReconnectState { /** * The number or retry attempts so far. * This gets reset on every successful connect, so it will start from zero every * time the client instance gets disconnected and will increment until the * client instance makes a connection attempt is successful. */ reconnectRetries: number; } interface Size { /** */ width: number; /** */ height: number; } interface AdvancedOptions { } interface DrmOptions { /** * Headers to be added to requests to license servers */ headers?: Record; /** * Query parameters to be added to requests to license servers */ queryParams?: Record; /** * Widevine options to override default behaviour */ widevine?: { videoRobustness?: string[]; audioRobustness?: string[]; }; /** * Playready options to override default behaviour */ playready?: { videoRobustness?: string[]; audioRobustness?: string[]; }; } type Media = "audio" | "video" | "audio+video"; type WebCodecsHardwareAccelerationPreference = "no-preference" | "prefer-hardware" | "prefer-software"; type DecoderType = "mse" | "webcodecs" | "wasm"; interface MediaSessionMetadata { title?: string; artist?: string; album?: string; /** Fetched by the operating system, so the URLs should not carry credentials. */ artwork?: Array<{ src: string; sizes?: string; type?: string; }>; } interface Options { /** * URL to use when connecting to the stream */ url: string; /** * Channel ID to connect to initially - can be changed later mid-stream when connected to a channel group. */ channelId: string; /** * Channel group to connect to * Note: Only needed for fast channel switching */ channelGroupId?: string; /** * A container to attach the video view in - can be provided later with .attach() on the vindral core instance */ container?: HTMLElement; /** * An authentication token to provide to the server when connecting - only needed for channels with authentication enabled * Note: If not supplied when needed, an "Authentication Failed" error will be raised. */ authenticationToken?: string; /** * Language to use initially - can be changed during during runtime on the vindral instance * Note: Only needed when multiple languages are provided - if no language is specified, one will be automatically selected. */ language?: string; /** * TextTrack to use initially - can be changed during during runtime on the vindral instance */ textTrack?: string; /** * Sets the log level - defaults to info */ logLevel?: LogLevel; /** * Sets the minimum and initial buffer time */ minBufferTime?: number; /** * Sets the maximum buffer time allowed. The vindral instance will automatically slowly increase * the buffer time if the use experiences to much buffering with the initial buffer time. */ maxBufferTime?: number; /** * Enables or disables user bandwidth savings by capping the video resolution to the size of the video element. * * Is enabled by default. * * Note: This is automatically set to false when abrEnabled is set to false. */ sizeBasedResolutionCapEnabled?: boolean; /** * Enables or disables picture in picture support. */ pictureInPictureEnabled?: boolean; /** * Enable bursting for initial connection and channel switches. This makes time to first frame faster at the * cost of stability (more demanding due to the sudden burst of live content) * * With bursting and adaptive bit rate on, playback starts at a rendition whose bit rate is at most half the * estimated bandwidth, so the link can catch up with the burst, and adaptive bit rate then steps up. It never * starts below the lowest rendition. If the rendition it starts at still needs more than half the estimated * bandwidth (the lowest one on a slow link, or the fixed one with adaptive bit rate off), the burst is skipped. * * Is enabled by default. * */ burstEnabled?: boolean; /** * @deprecated Use `decoders` instead. * Setting `mseEnabled: false` is equivalent to `decoders: ["wasm"]`. * When both `mseEnabled` and `decoders` are provided, `decoders` takes precedence. */ mseEnabled?: boolean; /** * Enable Opus with the MediaSource API on supported browsers. * * Is enabled by default. * */ mseOpusEnabled?: boolean; /** * Keep playback running while the page is in the background. Enabled by default. * When disabled, the session disconnects while hidden and reconnects when visible. * * Browser media policies still apply; iOS Safari pauses hidden video regardless. * Call `play()` again from a user gesture or media-control action to resume. * * When enabled, hidden sessions that are muted outside Picture-in-Picture or browser-paused * are disconnected after the inactivity timeout; an explicit `pause()` disconnects at once. */ backgroundPlayEnabled?: boolean; /** * @deprecated Use `backgroundPlayEnabled` instead. * * Legacy alias kept for backwards compatibility. */ iosBackgroundPlayEnabled?: boolean; /** * Show the stream in the browser and OS media controls (notification, lock screen, toolbar) and * let play and pause from there reach the SDK. Enabled by default. * * The SDK takes over `navigator.mediaSession` for the document, so a page with its own Media * Session integration should disable this. On canvas playback paths a silent `