type ServiceType = 'youtube' | 'niconico' | 'bilibili' | 'soundcloud'; interface ApiPromiseData { res: Array<(value: any) => void>; rej: Array<(reason?: any) => void>; } interface PlaylistItem { service: ServiceType; videoId: string; call_array: any[]; call_index: number; startSeconds?: number; endSeconds?: number; subService?: ServiceType; subVideoId?: string; [key: string]: any; } type ServiceStatusMap = Record; type ServiceApiCache = Record>; type ServiceApiPromise = Record>; type ServiceBooleanMap = Record; type ServiceUrlMap = Record; type IframeApiClassMap = Record; declare var multi_embed_player_set_variable: any; declare var YT: any; /** * Fetches the iframe API for a given service and video ID. * @param {string} service - The name of the service. * @param {string} videoid - The ID of the video. * @param {boolean} use_cors - Whether to use CORS. * @param {boolean} image_proxy - The image proxy. * @param {boolean} GDPR_access_accept - Whether GDPR access is accepted. * @param {boolean} failed_send_error - Whether to send an error if the request fails. * @param {HTMLElement} failed_send_error_target - The target to send the error to. * @returns {Promise} */ declare const multi_embed_player_fetch_iframe_api: (service: ServiceType, videoid: string, use_cors: boolean, image_proxy: boolean, GDPR_access_accept: boolean, failed_send_error?: boolean, failed_send_error_target?: HTMLElement | null) => Promise; /** * Resets all values in multi_embed_player.GDPR_accepted to false and removes the corresponding item from localStorage. */ declare const multi_embed_player_GDPR_accepted_all_back_down: () => void; /** * A custom HTML element for embedding multiple video services in a single player. * @extends HTMLElement */ declare class multi_embed_player extends HTMLElement { #private; videoid: string | null; follow_GDPR: boolean; service: ServiceType | null; image_url: string | null; picture_tag: HTMLPictureElement | null; player: any; playlist: PlaylistItem[]; autoplay: boolean; error_not_declare: boolean; previousData: PlaylistItem | null; startSeconds: number; endSeconds: number; static script_origin: string; static iframe_api_endpoint: string; static mep_status_load_api: ServiceStatusMap; static mep_load_api_promise: Record<'youtube' | 'niconico' | 'bilibili' | 'soundcloud', (() => void)[]>; static api_cache: ServiceApiCache; static api_promise: ServiceApiPromise; static GDPR_accept_promise: Record<'youtube' | 'niconico' | 'bilibili' | 'soundcloud', (() => void)[]>; static iframe_api_class: IframeApiClassMap; static GDPR_accepted: ServiceBooleanMap; static possible_direct_access_services: ServiceType[]; static cors_proxy: string; static tearms_policy_service: ServiceUrlMap; static follow_GDPR: boolean; constructor(); connectedCallback(): Promise; /** * Loads a video by its ID and sets the autoplay and subtitle options. * @async * @param {Object} data - The data object containing the video ID, service, start time, and end time. * @param {boolean} [autoplay=true] - Whether or not to autoplay the video. * @param {boolean} [sub=false] - Whether or not to load a subtitle. deprecated * @returns {Promise} */ loadVideoById(data: any, autoplay?: boolean, sub?: boolean): Promise; /** * Plays the video. */ playVideo(): void; /** * Pauses the video. */ pauseVideo(): void; /** * Stops the video. * @deprecated */ stopVideo(): void; /** * Returns the current time of the video. * @returns {Promise} - A promise that resolves with the current time of the video. promise only bilibili */ getCurrentTime(): Promise; /** * Seeks to a given time in the video. * @param {number} seconds - if service is bilibili, return promise */ seekTo(seconds: number): Promise; /** * Mutes the video. */ mute(): void; /** * Unmutes the video. */ unMute(): void; /** * Returns whether the video is muted. * @returns {boolean} - Whether the video is muted.if service is bilibili, return promise */ isMuted(): boolean | Promise; /** * Set the volume of the player. * @param {number} volume - The volume level to set. */ setVolume(volume: number): void; /** * Returns the current volume of the player. * @returns {number} The current volume of the player. */ getVolume(): number; /** * Returns the duration of the current video. * @returns {number} The duration of the current video in seconds. */ getDuration(): number; /** * Returns the real duration of the video based on the start and end seconds. * @returns {number} The real duration of the video. */ getRealDulation(): number; /** * Returns the relative current time by subtracting the start time from the current time. * @returns {Promise} The relative current time. */ getRelativeCurrentTime(): Promise; /** * Calculates the percentage of the current time relative to the total duration of the media. * @returns {number} The percentage of the current time. */ getPercentOfCurremtTime(): Promise; /** * Seeks to a relative position in the video based on the current time. * @param {number} seconds - The number of seconds to seek relative to the current time. */ relativeSeekTo_ct(seconds: number): Promise; /** * Start seeking from the given seconds plus the startSeconds. * @param {number} seconds - The seconds to seek from. */ relativeSeekTo_ss(seconds: number): void; /** * Returns the current state of the player. * @returns {number} The player state: * -1 -> not set video mainly before embed * 0 -> not played only thumnail * 1 -> onload * 2 -> playing * 3 -> pause * 4 -> video ended */ getPlayerState(): number; /** * Loads the YouTube API asynchronously and returns a Promise that resolves when the API is ready. * If the API is already loaded, the Promise resolves immediately. * If the API is currently being loaded, the Promise will resolve when the API is ready. * @returns {Promise} A Promise that resolves when the YouTube API is ready. */ youtube_api_loader(): Promise; /** * Loads the API for the specified service and returns a promise that resolves when the API is loaded. * @async * @param {string} service - The name of the service whose API needs to be loaded. * @returns {Promise} A promise that resolves when the API is loaded. */ iframe_api_loader(service: string): Promise; /** * Loads a script asynchronously and returns a promise that resolves when the script is loaded successfully or rejects when there is an error. * @param {string} src - The URL of the script to be loaded. * @returns {Promise} - A promise that resolves when the script is loaded successfully or rejects when there is an error. */ mep_promise_script_loader(src: string): Promise; } declare class mep_playitem { service: ServiceType; videoid: string; call_array: PlaylistItem[]; startSeconds: number | undefined; endSeconds: number | undefined; subService: ServiceType | undefined; subVideoid: string | undefined; constructor(service: any, videoid: any); toData(): PlaylistItem; } declare class mep_parallel { data: mep_parallel_inner[]; constructor(); parse(): void; } declare class mep_parallel_inner { service: ServiceType; videoid: string; constructor(service: any, videoid: any); } declare const multi_embed_player_save_GDPR_status: () => void; declare const multi_embed_player_GDPR_reviever: (service: ServiceType) => void; declare const multi_embed_player_css: HTMLStyleElement; // ES Modules support export { multi_embed_player, ServiceType, PlaylistItem, mep_playitem, mep_parallel, mep_parallel_inner, multi_embed_player_fetch_iframe_api, multi_embed_player_save_GDPR_status, multi_embed_player_GDPR_reviever, multi_embed_player_GDPR_accepted_all_back_down, multi_embed_player_css }; export as namespace MultiEmbedPlayer; //# sourceMappingURL=multi_embed_player.d.ts.map