import * as React from "react"; import { EventEmitter } from "events"; import type StrictEventEmitter from "strict-event-emitter-types"; import { Keymap } from "@liqvid/keymap"; import { Playback } from "./playback"; import { Script } from "./script"; import type { ThumbData } from "./controls/ScrubberBar"; interface PlayerEvents { canplay: void; canplaythrough: void; canvasClick: void; } interface Props extends React.HTMLAttributes { controls?: JSX.Element | JSX.Element[]; playback?: Playback; script?: Script; thumbs?: ThumbData; } export declare class Player extends React.PureComponent { /** * Liqvid analogue of the [`canplay`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplay_event) event. * This can be used to wait for Audio or Video files to load. You can also use {@link obstruct} to add custom loaders. */ canPlay: Promise; /** * Liqvid analogue of the [`canplaythrough`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplaythrough_event) event. * This can be used to wait for Audio or Video files to load. You can also use {@link obstruct} to add custom loaders. */ canPlayThrough: Promise; /** The {@link HTMLDivElement `
`} where content is attached (separate from controls). */ canvas: HTMLDivElement; /** Whether keyboard controls are currently being handled. */ captureKeys: boolean; hub: StrictEventEmitter; /** {@link Keymap} attached to the player */ keymap: Keymap; /** {@link Playback} attached to the player */ playback: Playback; /** {@link Script} attached to the player */ script: Script; buffers: Map; private __canPlayTasks; private __canPlayThroughTasks; private dag; /** {@link React.Context} used to access ambient Player */ static Context: React.Context; /** * Symbol to access the {@link Player} instance attached to a DOM element * * `player.canvas.parentElement[Player.symbol] === player` */ static symbol: symbol; /** Default controls appearing on the left */ static defaultControlsLeft: React.JSX.Element; /** Default controls appearing on the right */ static defaultControlsRight: React.JSX.Element; static defaultProps: { controls: React.JSX.Element; style: {}; }; constructor(props: Props); componentDidMount(): void; private updateTree; private canvasClick; onMouseUp(e: React.MouseEvent): void; static allowScroll(e: React.TouchEvent | TouchEvent): void; /** * Prevent canvas clicks from pausing the video. * @param e Click event on video canvas * @deprecated Use data-affords="click" instead */ static preventCanvasClick(e: MouseEvent | React.MouseEvent): void; /** Suspends keyboard controls so that components can receive keyboard input. */ suspendKeyCapture(): void; /** Resumes keyboard controls. */ resumeKeyCapture(): void; /** @deprecated */ ready(): void; /** * Reparse a section of the document for `during()` and `from()` * @param node Element to reparse */ reparseTree(node: HTMLElement | SVGElement): void; registerBuffer(elt: HTMLMediaElement): void; unregisterBuffer(elt: HTMLMediaElement): void; updateBuffer(elt: HTMLMediaElement, buffers: [number, number][]): void; /** * Obstruct {@link canPlay} or {@link canPlayThrough} events * @param event Which event type to obstruct * @param task Promise to append */ obstruct(event: "canplay" | "canplaythrough", task: Promise): void; render(): React.JSX.Element; } export {};