/** * Available track types for media streams. */ export type TrackType = 'TEXT' | 'AUDIO' | 'VIDEO'; export type ITrackInfo = ITrackVideoInfo | ITrackAudioInfo | ITrackTextInfo; /** * Interface representing stream track information. */ export interface ITrack { /** * Type of the track, e.g., "VIDEO", "AUDIO", "TEXT". */ trackType: T; /** * MIME type of the track, e.g., "video/mp4", "audio/mp3", "text/vtt". */ mimeType: string; /** * Unique identifier for the track group. * This is used to group tracks of the same type (e.g., multiple audio tracks). */ groupId: string; /** * Unique identifier for the track. */ trackIndex: number; /** * If the track is selected for playback. */ selected: boolean; /** * Selected language of subtitles or captions. */ language: string | null; /** * If the track is supported by the device. */ supported: boolean; } export interface ITrackVideoInfo extends ITrack<'VIDEO'> { videoSize: { width: number; height: number; }; } export interface ITrackAudioInfo extends ITrack<'AUDIO'> { /** * Number of audio channels. */ channelCount: number; } export interface ITrackTextInfo extends ITrack<'TEXT'> { /** * Selected subtitles or captions. */ selection: string[]; }