@evankford/video-background
Version:
Automatic background video from various sources (Youtube, MP4, vimeo) with autoplay across devices. No JS dependencies.
35 lines (34 loc) • 1.19 kB
TypeScript
import Logger from "../utils/logger";
import type { VideoBackground } from "videoBackground";
export default class VideoPlayer {
passedConfig: PlayerConfigInput;
config: PlayerConfigShape;
status: PlayerStatusShape;
props: PlayerPropsShape;
observer?: IntersectionObserver;
logger: Logger;
type: PlayerType;
callbacks: PlayerCallbacks;
iframe?: HTMLIFrameElement;
wrapper?: HTMLElement;
parent: VideoBackground;
parseParams(): void;
hasRequiredParams(config: PlayerConfigShape): boolean;
constructor(config: PlayerConfigInput);
build(): void;
unbuild(): void;
init(): void;
destroy(): void;
mergeConfig(config: PlayerConfigInput): PlayerConfigShape;
do(eventName: string): void;
on(eventName: string, callback: () => void, uniqueKey?: string | undefined): void;
playCheck(): void;
pause(): Promise<boolean>;
play(): Promise<boolean>;
mute(): Promise<void>;
unmute(): Promise<void>;
resize(): void;
buildIntersectionObserver(): void;
removeIntersectionObserver(): void;
handleIntersection(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
}