interface mep_bilibili_playerVars { startSeconds?: number; endSeconds?: number; autoplay?: number; displayComment?: number; fastLoad?: number; play_control_wrap?: number; } interface mep_bilibili_content { videoId: string; width: number; height: number; playerVars: mep_bilibili_playerVars; overwrite?: boolean; displayComment?: number; play_control_wrap?: number; startSeconds?: number; endSeconds?: number; } interface BilibiliApiResponse { code: number; data?: { title: string; duration: number; pic?: string; }; image_base64?: string | null; } interface BilibiliPlayerState { getPlayerState: string; currentTime?: number; dulation?: number; volumeValue?: number; getTitle?: string; } interface BilibiliQuery { bvid: string; t?: number; autoplay: 0 | 1; danmaku: 0 | 1; } /** * Class representing a Bilibili player. * @class * @classdesc This class provides methods to control a Bilibili player and handle errors. * @property {boolean} localStorageCheck - A flag indicating whether the local storage is accessible. * @property {boolean} mep_extension_bilibili - A flag indicating whether the extension is installed. * @property {string} api_endpoint - The API endpoint for the player. * @property {string} no_extention_error - The error message to display when the extension is not installed. * @property {string} player_base_url - The base URL for the player. * @property {Object} bilibili_api_cache - The cache for the Bilibili API. * @property {string} cors_proxy - The CORS proxy for the player. * @constructor * @param {HTMLElement|String} replacing_element - The element to replace with the player or the ID of the element to replace with the player. * @param {Object} content - The content to display in the player. * @param {Function} player_set_event_function - The function to set the player event. */ declare class mep_bilibili { #private; player: HTMLIFrameElement | HTMLElement; play_control_wrap: boolean; front_error_code: number | undefined; loading: boolean; before_mute_volume: number; content_width: number; content_height: number; videoid: string; original_replacing_element: HTMLElement; player_set_event: ((player: HTMLIFrameElement) => void) | undefined; seek_time: number; seek_time_used: boolean; noextention_count_stop: number; state: BilibiliPlayerState; apicache: Record; no_extention_pause: boolean; startSeconds: number; innerStartSeconds: number; autoplay_flag: boolean; displayCommentMode: boolean; fastload: boolean; no_extention_estimate_stop: boolean; play_start_time: number; play_start_count_interval: number | undefined; endSeconds: number; end_point_observe: number | undefined; custom_state: number | undefined; estimate_time: number | undefined; start_event_count: number; end_event_count: number; static error_description: { 0: string; 1: string; 2: string; 3: string; 4: string; }; static localStorageCheck: boolean | null; static mep_extension_bilibili: boolean; static api_endpoint: string; static no_extention_error: string; static player_base_url: string; static bilibili_api_cache: Record; static cors_proxy: string; static currentTime_delay: number; static bilibili_api_promise: Record void)[]; rej: ((reason?: any) => void)[]; }>; constructor(replacing_element: HTMLElement | string, content: mep_bilibili_content, player_set_event_function?: (player: HTMLIFrameElement) => void); /** * Loads the video player with the specified content in cue mode. * @param {Object} content - The content to display in the player. */ cueVideoById(content: Partial): void; /** * Loads the video player with the specified content in play mode. * @param {Object} content - The content to display in the player. */ loadVideoById(content: Partial): void; /** * Returns the current time of the video. * @returns {Promise} - The current time of the video. */ getCurrentTime(): number; /** * Plays the video. If the Bilibili extension is not installed, loads the video with the specified parameters. * If the extension is installed, sends a message to the extension to play the video. */ playVideo(): void; /** * Pauses the video playback. If the Bilibili extension is not detected, it replaces the player with an image and stops the play start count interval. * @function */ pauseVideo(): void; /** * Seeks to the specified time in the video. * @async * @param {number} seektime - The time to seek to, in seconds. */ seekTo(seektime: number): Promise; /** * Calculates the real duration of the video based on the start and end seconds. * @async * @function * @returns {Promise} The real duration of the video. */ getRealDulation(): Promise; /** * Get the duration of the video. * @async * @returns {Promise} The duration of the video in seconds. */ getDuration(): Promise; /** * Gets the title of the video. * @returns {Promise} The title of the video. */ getTitle(): Promise; /** * Returns the current state of the player. * @async * @returns {number} The state of the player. Possible values are: * 0 - Player is not ready or cache is not available. * 1 - Player is ready and not playing. * 2 - Player is playing. * 3 - Player is paused. * 4 - Player was ended. */ getPlayerState(): Promise; /** * Sets the volume of the Bilibili player. * When not install extention, this function will not work. * @param {number} volume - The volume level to set, between 0 and 100. */ setVolume(volume: number): void; /** * Gets the current volume of the Bilibili player. * When not install extention, this function will not work. * @returns {number} The current volume value. */ getVolume(): number | undefined; /** * Checks if the player is currently muted. * When not install extention, this function will not work. * @returns {boolean} True if the player is muted, false otherwise. */ isMuted(): boolean | undefined; /** * Mutes the player by setting the volume to 0. * When not install extention, this function will not work. * @function * @returns {void} */ mute(): void; /** * Unmutes the player by setting the volume to the previous volume. * When not install extention, this function will not work. * @function * @returns {void} */ unMute(): void; /** * Sends a message to the player's content window to display or hide comments. * When not install extention, this function will not work. * @param {string} mode - The visibility mode of the comments. Possible values are "visible" or "hidden". * @returns {void} */ displayComment(mode: string): void; } //# sourceMappingURL=bilibili.d.ts.map