UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

47 lines (46 loc) 1.69 kB
import { BaseProvider, PlayerStates } from '../core/esl-media-provider'; import PlayerVars = YT.PlayerVars; import type { MediaProviderConfig, ProviderObservedParams } from '../core/esl-media-provider'; /** * Youtube API provider for {@link ESLMedia} * @author Alexey Stsefanovich (ala'n), Yuliya Adamskaya */ export declare class YouTubeProvider extends BaseProvider { static readonly providerName: string; static readonly idRegexp: RegExp; static readonly providerRegexp: RegExp; protected _el: HTMLDivElement | HTMLIFrameElement; protected _api: YT.Player; protected _lastPlayerState: PlayerStates; static parseUrl(url: string): Partial<MediaProviderConfig> | null; private static _coreApiPromise; protected static getCoreApi(): Promise<void>; protected static mapOptions(cfg: MediaProviderConfig): PlayerVars; protected static buildIframe(sm: MediaProviderConfig): HTMLDivElement | HTMLIFrameElement; bind(): void; /** Init YT.Player on target element */ protected onCoreApiReady(): Promise<any>; /** Post YT.Player init actions */ protected onPlayerReady(): void; unbind(): void; private _onStateChange; protected onConfigChange(param: ProviderObservedParams, value: boolean): void; focus(): void; get state(): PlayerStates; get duration(): number; get currentTime(): number; get defaultAspectRatio(): number; seekTo(pos: number): void; play(): void; pause(): void; stop(): void; } declare global { interface YT extends Promise<void> { Player: YT.Player; } interface Window { YT?: YT; onYouTubeIframeAPIReady?: () => void; } }