/** * TrackManager - Manages multi-track selection and switching */ import type { Track, VideoTrack, AudioTrack, SubtitleTrack } from '../types'; import { EventEmitter } from '../events/EventEmitter'; interface TrackManagerEvents { videoTrackChange: VideoTrack | null; audioTrackChange: AudioTrack | null; subtitleTrackChange: SubtitleTrack | null; tracksChange: Track[]; } export declare class TrackManager extends EventEmitter { private tracks; private activeVideoTrack; private activeAudioTrack; private activeSubtitleTrack; /** * Set available tracks */ setTracks(tracks: Track[]): void; /** * Get all tracks */ getTracks(): Track[]; /** * Identify cover-art / attached-picture video streams (ID3v2 APIC, * FLAC PICTURE, MP4 covr, Matroska attachment) so they're excluded * from the playable video list and surfaced separately for artwork. * * Detection is a pure-JS heuristic: a still-image codec (mjpeg / png / * jpeg) reporting frameRate 0 (a single cached picture, not a motion * stream). We can't use a WASM-side disposition flag — adding the * is_attached_pic field to the StreamInfo struct shifts the WASM * memory layout and trips a latent FFmpeg audio overflow into a * production OOB (see project memory "Album Art Crashes WASM"), so the * whole album-art path stays JS-only. Real video is essentially never * mjpeg/png-with-zero-fps, so the heuristic is safe in practice. */ private isLikelyCoverArt; /** * Get video tracks. Excludes embedded cover-art streams (ID3v2 APIC, * FLAC PICTURE, etc.) — those are exposed separately via * getAttachedPicTracks() so the player doesn't try to feed a one-frame * PNG into the video decoder and stall on a never-arriving second frame. */ getVideoTracks(): VideoTrack[]; /** * Cover-art / attached-picture tracks (audio file embedded artwork). * Empty for the usual video-with-audio case. */ getAttachedPicTracks(): VideoTrack[]; /** * Get audio tracks */ getAudioTracks(): AudioTrack[]; /** * Get subtitle tracks */ getSubtitleTracks(): SubtitleTrack[]; /** * Get active video track */ getActiveVideoTrack(): VideoTrack | null; /** * Get active audio track */ getActiveAudioTrack(): AudioTrack | null; /** * Get active subtitle track */ getActiveSubtitleTrack(): SubtitleTrack | null; /** * Select video track */ selectVideoTrack(trackId: number): boolean; /** * Select audio track */ selectAudioTrack(trackId: number): boolean; /** * Select subtitle track (null to disable) */ selectSubtitleTrack(trackId: number | null): boolean; /** * Check if packet belongs to an active track */ isActiveStream(streamIndex: number): boolean; /** * Get track by ID */ getTrackById(trackId: number): Track | undefined; /** * Clear all tracks */ clear(): void; } export {}; //# sourceMappingURL=TrackManager.d.ts.map