/** * Channel */ export interface Channel { /** * Channel ID for the channel */ channelId: string; /** * Display name */ name: string; /** * Indicates whether there is an incoming source feed for the channel */ isLive: boolean; /** * URLs to fetch thumbnail from */ thumbnailUrls: string[]; /** * Urls for timeshift if available */ timeshiftUrls?: string[]; } declare const tags: unique symbol; type Tagged = BaseType & { [tags]: { [K in Tag]: void; }; }; type AudioCodec = "aac" | "opus" | "mp3"; type VideoCodec = "h264" | "av1"; type WebCodecsHardwareAccelerationPreference = "no-preference" | "prefer-hardware" | "prefer-software"; interface ClientOverrides { maxVideoBitRate?: number; minBufferTime?: number; maxBufferTime?: number; burstEnabled?: boolean; sizeBasedResolutionCapEnabled?: boolean; separateVideoSocketEnabled?: boolean; webcodecsHardwareAcceleration?: WebCodecsHardwareAccelerationPreference; offscreenCanvasEnabled?: boolean; videoCodecs?: string[]; } type Namespace = Tagged, "Namespace">; interface TrackObject { namespace?: Namespace; name: string; format: string; label?: string; renderGroup?: number; altGroup?: number; initData?: string; initTrack?: string; depends?: Array; temporalId?: number; spatialId?: number; codec?: string; mimeType?: string; framerate?: [ number, number ]; bitrate?: number; width?: number; height?: number; samplerate?: number; channelConfig?: string; displayWidth?: number; displayHeight?: number; language?: string; ["com.vindral.variant_uid"]?: string; ["com.vindral.drm"]?: string; } interface CatalogRoot { version: number; streamingFormat?: number; streamingFormatVersion?: string; } interface TracksCatalog extends CatalogRoot { namespace: Namespace; tracks: Array; } interface RenditionProps { id: number; /** */ bitRate: number; /** */ codecString?: string; /** */ language?: string; /** */ meta?: Record; } interface VideoRenditionProps { /** */ codec: VideoCodec; /** */ frameRate: [ number, number ]; /** */ width: number; /** */ height: number; } interface AudioRenditionProps { /** */ codec: AudioCodec; /** */ channels: number; /** */ sampleRate: number; } interface TextRenditionProps { codec: "webvtt"; kind: "subtitles" | "captions"; label?: string; } type VideoRendition = VideoRenditionProps & RenditionProps; type AudioRendition = AudioRenditionProps & RenditionProps; type TextRendition = TextRenditionProps & RenditionProps; type Rendition = VideoRendition | AudioRendition | TextRendition; interface Telemetry { url: string; probability?: number; includeErrors?: boolean; includeEvents?: boolean; includeStats?: boolean; maxRetries?: number; maxErrorReports?: number; interval?: number; } interface ChannelWithCatalog extends Channel { catalog: TracksCatalog; renditions: Rendition[]; overrides?: ClientOverrides; } interface ChannelWithRenditions extends Channel { renditions: Rendition[]; overrides?: ClientOverrides; } interface ServerCertificateHash { algorithm: string; value: string; } interface Edge { moqUrl?: string; moqWsUrl: string; serverCertificateHashes?: ServerCertificateHash[]; } interface MoQConnectInfo { logsUrl?: string; statsUrl?: string; telemetry?: Telemetry; channels: ChannelWithCatalog[]; edges: Edge[]; timeshift: { urls: string[]; duration: string; }; } interface VindralConnectInfo { logsUrl?: string; statsUrl?: string; telemetry?: Telemetry; channels: ChannelWithRenditions[]; edges: string[]; } export type ConnectInfo = VindralConnectInfo | MoQConnectInfo; /** * ApiClientOptions */ export interface ApiClientOptions { /** * String representing the URL to the public CDN API. */ publicEndpoint: string; /** * Function that should return a string containing a signed authentication token. */ tokenFactory?: AuthorizationTokenFactory; } /** * Represents what authorization that will be requested. */ export interface AuthorizationContext { /** * The channelGroupId that might need authorization. */ channelGroupId?: string; /** * The channelId that might need authorization. */ channelId?: string; } interface ConnectOptions { channelGroupId?: string; channelId: string; } /** * AuthorizationTokenFactory */ export type AuthorizationTokenFactory = (context: AuthorizationContext) => string | undefined; /** * Convenience class to call the public available endpoints of the Vindral Live CDN. */ export declare class ApiClient { private baseUrl; private tokenFactory?; constructor(options: ApiClientOptions); /** * @ignore * Returns everything needed to setup the connection of Vindral instance. */ connect(options: ConnectOptions): Promise; /** * Fetches information regarding a single channel. * * @param channelId the channel to fetch * @returns a [[Channel]] containing information about the requested channel. */ getChannel(channelId: string): Promise; /** * Fetches channels within a channel group * * Note: The returned list includes inactive channels - check isLive to filter out only active channels * * @param channelGroupId the channel group to fetch channels from * @returns an array of [[Channel]] that belong to the channel group */ getChannels(channelGroupId: string): Promise; private getHeaders; private getAuthToken; private toChannels; private toChannel; } export {};