CanvasCaptureMediaStreamTrack: canvas-Eigenschaft

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die schreibgeschützte canvas-Eigenschaft der CanvasCaptureMediaStreamTrack-Schnittstelle gibt das HTMLCanvasElement zurück, von dem die Frames erfasst werden.

Wert

Ein HTMLCanvasElement, das die Quelle der erfassten Frames angibt.

Beispiel

js
// Find the canvas element to capture
const canvasElt = document.querySelector("canvas");

// Get the stream
const stream = canvasElt.captureStream(25); // 25 FPS

// Do things to the stream
// …

// Obtain the canvas associated with the stream
const canvas = stream.canvas;

Spezifikationen

Specification
Media Capture from DOM Elements
# dom-canvascapturemediastreamtrack-canvas

Browser-Kompatibilität

Siehe auch