UNPKG

@atmtfy/video-background

Version:

Automatic background video from various sources (Youtube, MP4, vimeo) with autoplay across devices. No JS dependencies.

44 lines (43 loc) 1.18 kB
declare type StateShape = { muted: boolean; paused: boolean; }; declare type IconConfigNotRequired = { can?: VideoCan; wrapper: HTMLElement; onMuteUnmute?: (() => void) | false; onPausePlay?: (() => void) | false; initialState?: StateShape; }; declare type IconConfig = { can?: { unmute: boolean; pause: boolean; }; wrapper: HTMLElement; onMuteUnmute: (() => void) | false; onPausePlay: (() => void) | false; initialState?: StateShape; }; export default class Icons { config: IconConfig; parent: HTMLElement; wrapper: HTMLElement; state: StateShape; muteUnmute?: HTMLButtonElement; muteUnmuteIcon?: HTMLImageElement; pausePlay?: HTMLButtonElement; pausePlayIcon?: HTMLImageElement; toggleMute: (() => void) | false; togglePause: (() => void) | false; constructor(config: IconConfigNotRequired); setupWrapper(): void; init(): void; updateState(prop: 'muted' | 'paused', val: boolean): void; handleStateChange(): void; syncMuteState(): void; syncPauseState(): void; handleMuteUnmuteClick(): void; handlePausePlay(): void; } export {};