import { default as mpegts } from 'mpegts.js';
export interface PlayerConfig {
    type: "flv";
    isLive: boolean;
    hasAudio: boolean;
    hasVideo: boolean;
    url: string;
}
export interface PlayerOptions {
    enableWorker?: boolean;
    enableStashBuffer?: boolean;
    autoCleanupSourceBuffer?: boolean;
    lazyLoadMaxDuration?: number;
    deferLoadAfterSourceOpen?: boolean;
}
export declare enum PlayerEvents {
    ERROR = "error",
    LOADING_COMPLETE = "loading_complete",
    RECOVERED_EARLY_EOF = "recovered_early_eof",
    MEDIA_INFO = "media_info",
    METADATA_ARRIVED = "metadata_arrived",
    SCRIPTDATA_ARRIVED = "scriptdata_arrived",
    STATISTICS_INFO = "statistics_info"
}
export declare enum PlayerErrorTypes {
    NETWORK_ERROR = "NetworkError",
    MEDIA_ERROR = "MediaError",
    OTHER_ERROR = "OtherError"
}
/**
 * 统一的播放器接口
 * 自动选择硬解码（mpegts.js）或软解码（EasyPlayer / libde265）
 */
export declare class H265Player {
    private config;
    private options;
    private videoElement;
    private hardwarePlayer;
    private softwareDecoder;
    private useSoftDecode;
    private eventHandlers;
    private mediaErrorCount;
    private readonly MAX_MEDIA_ERROR_COUNT;
    private canvasElement;
    private originalVideoPlay;
    private originalVideoPause;
    private originalPausedDescriptor;
    constructor(config: PlayerConfig, options?: PlayerOptions);
    /**
     * 检查浏览器是否支持 H265 硬解。
     *
     * 目前强制返回 false，是为了在绝大部分环境中直接走软解逻辑（EasyPlayer / libde265），
     * 若未来需要支持浏览器原生 H265，可放开下面的能力探测分支。
     */
    private checkHardwareSupport;
    private initHardwarePlayer;
    private initSoftwareDecoder;
    private dispatchVideoPlayState;
    /**
     * 从硬解播放器切换到软解：加载对应软解脚本，销毁 mpegts 播放器，再用 EasyPlayer/libde265 接管播放。
     */
    private switchToSoftDecode;
    attachMediaElement(videoElement: HTMLVideoElement): void;
    load(): Promise<void>;
    play(): Promise<void>;
    pause(): void;
    unload(): void;
    destroy(): void;
    on(event: string, handler: (...args: unknown[]) => void): void;
    off(event: string, handler: (...args: unknown[]) => void): void;
    private emit;
    isUsingSoftDecode(): boolean;
}
export declare function createPlayer(config: PlayerConfig, options?: PlayerOptions): H265Player;
export declare function getFeatureList(): mpegts.FeatureList;
export declare const Events: typeof PlayerEvents;
export declare const ErrorTypes: typeof PlayerErrorTypes;
