modern-canvas
Version:
A JavaScript WebGL rendering engine. only the ESM.
47 lines (46 loc) • 1.65 kB
TypeScript
import { Texture2D } from './Texture2D';
export interface VideoTextureOptions {
autoLoad?: boolean;
autoPlay?: boolean;
fps?: number;
crossorigin?: boolean | string | null;
loop?: boolean;
muted?: boolean;
playsinline?: boolean;
}
export interface VideoTextureLike {
src: string;
mime: string;
}
export declare class VideoTexture extends Texture2D<HTMLVideoElement> {
autoUpdate: boolean;
fps: number;
static readonly mimeTypes: Map<string, string>;
get isReady(): boolean;
get isPlaying(): boolean;
get duration(): number;
get seeking(): boolean;
get currentTime(): number;
set currentTime(val: number);
protected _spf: number;
protected _autoPlay: boolean;
protected _sourceLoad?: Promise<this>;
protected _nextTime: number;
protected _connected: boolean;
protected _requestId?: number;
protected _resolve?: (val: this) => void;
protected _reject?: (event: ErrorEvent) => void;
constructor(source: HTMLVideoElement | (string | VideoTextureLike)[] | string, options?: VideoTextureOptions);
protected _updateProperty(key: string, value: any, oldValue: any): void;
protected _onPlayStart: () => void;
protected _onPlayStop: () => void;
protected _onCanPlay: () => void;
protected _onError: (event: ErrorEvent) => void;
/** Fired when the video is completed seeking to the current playback position. */
protected _onSeeked: () => void;
protected _setupAutoUpdate(): void;
protected _videoFrameRequestCallback: () => void;
requestUpload: () => void;
load(): Promise<this>;
destroy(): void;
}