TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
HTMLVideoElement missing requestVideoFrameCallback
Possibly the spec is too early for inclusion. For others with the same issue, here are the types I came up with:
interface VideoFrameMetadata {
presentationTime: DOMHighResTimeStamp;
expectedDisplayTime: DOMHighResTimeStamp;
width: number;
height: number;
mediaTime: number;
presentedFrames: number;
processingDuration?: number;
captureTime?: DOMHighResTimeStamp;
receiveTime?: DOMHighResTimeStamp;
rtpTimestamp?: number;
};
type VideoFrameRequestCallbackId = number;
interface HTMLVideoElement extends HTMLMediaElement {
requestVideoFrameCallback(callback: (now: DOMHighResTimeStamp, metadata: VideoFrameMetadata) => any): VideoFrameRequestCallbackId;
cancelVideoFrameCallback(handle: VideoFrameRequestCallbackId): void;
}
I'm kinda new to this, would there be a way for me to override the interface in my own type definition file for the time being?
@PindaPixel you should just be able to copy-paste the above definitions in your own file - possibly wrapping it all in declare global { ... }