import * as React$1 from 'react'; import { Playback } from '@liqvid/playback'; export { Playback } from '@liqvid/playback'; import { EventEmitter } from 'events'; import StrictEventEmitter from 'strict-event-emitter-types'; import { Keymap } from '@liqvid/keymap'; export { Keymap as KeyMap, Keymap } from '@liqvid/keymap'; import * as animation from '@liqvid/utils/animation'; import { onDrag, anyHover, onClick as onClick$1 } from '@liqvid/utils/interaction'; import * as json from '@liqvid/utils/json'; import * as misc from '@liqvid/utils/misc'; import * as react from '@liqvid/utils/react'; import * as replayData from '@liqvid/utils/replay-data'; export { ReplayData } from '@liqvid/utils/replay-data'; import * as svg from '@liqvid/utils/svg'; import * as time from '@liqvid/utils/time'; import { useKeymap } from '@liqvid/keymap/react'; export { KeymapContext, useKeymap } from '@liqvid/keymap/react'; import { usePlayback, useTime } from '@liqvid/playback/react'; export { PlaybackContext, usePlayback, useTime } from '@liqvid/playback/react'; type Marker = [M, number, number]; interface ScriptEvents { markerupdate: number; } declare const Script_base: new () => StrictEventEmitter; declare class Script extends Script_base { /** The underlying {@link Playback} instance. */ playback: Playback; /** The array of markers, in the form [name, startTime, endTime]. */ markers: Marker[]; /** Index of the active marker. */ markerIndex: number; constructor(markers: readonly (readonly [M, number | string, number | string] | readonly [M, number | string])[]); /** @deprecated */ get hub(): this; /** Name of the active marker. */ get markerName(): string; /** Seek playback to the previous marker. */ back(): void; /** Advance playback to the next marker. */ forward(): void; /** * Returns the first marker with the given name. * @throws {Error} If no marker named `name` exists. */ markerByName(name: string): Marker; /** * Returns the first index of a marker named `name`. * @throws {Error} If no marker named `name` exists. */ markerNumberOf(name: string): number; /** If `start` is a string, returns the starting time of the marker with that name. Otherwise, returns `start`. */ parseStart(start: number | string): number; /** If `end` is a string, returns the ending time of the marker with that name. Otherwise, returns `end`. */ parseEnd(end: number | string): number; /** Update marker */ __updateMarker(t: number): void; } interface ThumbData { /** * Number of columns per thumbnail sheet. * @default 5 */ cols?: number; /** * Number of rows per thumbnail sheet. * @default 5 */ rows?: number; /** * Width of individual thumbnails. * @default 160 */ width?: number; /** * Height of individual thumbnails. * @default 100 */ height?: number; /** * How many seconds between thumbnails. * @default 4 */ frequency?: number; /** URL pattern for thumbnails. Must include "%s". */ path: string; /** Points of interest in the video to highlight. */ highlights?: VideoHighlight[]; } interface VideoHighlight { time: number; title: string; } declare function ScrubberBar(props: { thumbs: ThumbData; }): React$1.JSX.Element; interface PlayerEvents { canplay: void; canplaythrough: void; canvasClick: void; } interface Props$2 extends React$1.HTMLAttributes { controls?: JSX.Element | JSX.Element[]; playback?: Playback; script?: Script; thumbs?: ThumbData; } declare class Player extends React$1.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$1.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$1.JSX.Element; /** Default controls appearing on the right */ static defaultControlsRight: React$1.JSX.Element; static defaultProps: { controls: React$1.JSX.Element; style: {}; }; constructor(props: Props$2); componentDidMount(): void; private updateTree; private canvasClick; onMouseUp(e: React$1.MouseEvent): void; static allowScroll(e: React$1.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$1.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$1.JSX.Element; } interface Props$1 extends React$1.HTMLAttributes { obstructCanPlay?: boolean; obstructCanPlayThrough?: boolean; start?: number; } declare class Media extends React$1.PureComponent, Player> { protected playback: Playback; protected player: Player; protected domElement: HTMLMediaElement; /** When the media element should start playing. */ start: number; static defaultProps: { obstructCanPlay: boolean; obstructCanPlayThrough: boolean; }; static contextType: React$1.Context; constructor(props: Props$1, context: Player); componentDidMount(): void; componentWillUnmount(): void; get end(): number; pause(): void; play(): Promise; onPlay(): void; onRateChange(): void; onSeek(t: number): void; onTimeUpdate(t: number): void; onVolumeChange(): void; onDomPlay(): void; onDomPause(): void; } /** Liqvid equivalent of {@link HTMLAudioElement `