/** * MoviPlayer - Main public API for the streaming video library */ import type { PlayerConfig, SourceConfig, Track, PlayerState, PlayerEventMap, MediaInfo, VideoTrack, AudioTrack, SubtitleTrack } from "../types"; import { EventEmitter } from "../events/EventEmitter"; import { type SourceAdapter } from "../source"; import { TrackManager } from "./TrackManager"; import { LogLevel } from "../utils/Logger"; import { type VRView } from "../render/CanvasRenderer"; export declare class MoviPlayer extends EventEmitter { private static readonly _isMobileDevice; private config; private source; private cache; private demuxer; private nativeAudioEl; private _nativeAudioObjectUrl; private _nativeAudioLogicalUrl; private _nativeAudioAutoplayBlocked; private _audioTracks; private _activeAudioLang; private _subtitleTracks; private _activeSubtitleLang; private _externalSubCues; private _externalSubTimer; trackManager: TrackManager; private clock; private stateManager; private mediaInfo; private fileSize; private lastBufferedTime; /** * Enable/disable seek-bar scrub previews on an already-constructed player. * Lets the `thumb` attribute be toggled at runtime (or applied after `src`, * whose callback creates the player first) without recreating the player. * The thumbnail pipeline stays lazy — it only spins up on the first hover. */ setPreviewsEnabled(enabled: boolean): void; private previewsAllowed; /** Proxy a stream wrapper's events + mirror its TrackManager onto the player. */ private wireStreamWrapper; private videoDecoder; private audioDecoder; private subtitleDecoder; private videoRenderer; private prefetchedSubtitleStream; private prefetchInFlight; private coverArt; private streamWrapper; private thumbnailBindings; private thumbnailSource; private thumbnailRenderer; private thumbnailHDREnabled; private isPreviewGenerating; private audioRenderer; private previewInitPromise; private previewInitAttempts; private previewInitGaveUp; private disableAudio; private _audioOnly; private muted; private wasPlayingBeforeRebuffer; private _stallStartTime; private _bufferingEntryTime; private _playStartTime; private _primingAudio; private _decoderStuckSince; private _lastDesyncSeekTime; private animationFrameId; private backgroundIntervalId; private backgroundWorker; private isBackgrounded; private wakeLock; private seekingToKeyframe; private seekingToKeyframeStartTime; private static readonly KEYFRAME_SEEK_TIMEOUT; private seekCraSeen; private static readonly SEEK_IDR_WAIT_MS; private videoChainBrokenUntilKeyframe; private static readonly PREBUFFER_AUDIO_SECONDS; private static readonly PREBUFFER_VIDEO_FRAMES; private static readonly PREBUFFER_MAX_WALL_MS; private static readonly PREBUFFER_MAX_PACKETS; private seekTargetTime; private waitingForVideoSync; private pendingAudioPackets; private pendingPrebufferPackets; private justSeeked; private seekTime; private startTime; private seekKeyframeOffset; private static readonly POST_SEEK_THROTTLE_MS; private pauseBufferTimerId; private static readonly PAUSE_BUFFER_INTERVAL_MS; private static readonly PAUSE_BUFFER_MAX_PACKETS; private static readonly PAUSE_BUFFER_AUDIO_SECONDS; private static readonly PAUSE_BUFFER_VIDEO_FRAMES; constructor(config: PlayerConfig); /** * Load the media file */ load(sourceConfig?: SourceConfig): Promise; /** * Create source adapter from config */ private createSource; /** * Configure decoders for active tracks */ private configureDecoders; /** * Pre-read a small amount of media before reporting "ready" and stash the * packets for the normal demux loop to consume. On short videos the demux * burst can drain the file faster than the HTTP source delivers bytes, * tripping the stall detector the moment play() starts; reading ahead * gives the source layer more time to buffer bytes. * * We deliberately do NOT decode here — the video decoder's onFrame * callback drops frames whenever state !== "playing", and the audio * renderer starts AudioContext playback the moment samples arrive. Both * break if we decode during prebuffer. */ /** * Native-audio-only playback (split-source data saver): audio-only mode AND a * separate