import { AnyString } from '../../utils/types'; import StreamProtocol from '../Stream/StreamProtocol'; export type DrmScheme = 'CommonPSSH' | 'ClearKey' | 'Widevine' | 'PlayReady' | AnyString; export interface IOptions { /** @deprecated */ '4k'?: boolean; /** * Prepare stream or video in background. * @default false */ background?: boolean; /** * Initial volume value of the stream. * @default 100 */ volume?: number; } /** * Available options for stream function `play()`. */ export interface IStreamOptions extends IOptions { /** * Protocol that the stream is using. * * Note: Not all protocols are supported by all devices. * * Allowed values are: HLS, RTP, HTTP, UDP, RTMP, RTSP */ protocol?: keyof typeof StreamProtocol | string; /** * Automatically reconnect stream when it disconnects. * @default false */ autoReconnect?: boolean; /** * Interval in milliseconds between reconnect attempts. * @default 30000 */ autoReconnectInterval?: number; /** * Enable low-latency mode for stream playback. * @default false */ lowLatency?: boolean; } /** * Available options for stream function `prepare()`. */ export interface IStreamPrepareOptions extends IStreamOptions { /** * Track selection for subtitles, audio, and video. */ trackSelection?: { /** Maximum number of audio channels to play */ maxAudioChannelCount?: number; /** Minimum video size to play */ minVideoSize?: { width: number; height: number; }; /** Maximum video size to play */ maxVideoSize?: { width: number; height: number; }; /** Preferred audio languages to play */ preferredAudioLanguages?: string[]; /** Preferred text languages to play */ preferredTextLanguages?: string[]; }; /** * DRM (Digital Rights Management) options for the stream. */ drm?: { scheme: DrmScheme; /** * URI to the license server. */ licenseUri: string; /** * Additional headers to include in the license request. */ licenseRequestHeaders: { [key: string]: string; }; }; }