CanvasCaptureMediaStreamTrack: thuộc tính canvas

Limited availability

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

Thuộc tính chỉ đọc canvas của giao diện CanvasCaptureMediaStreamTrack trả về HTMLCanvasElement mà từ đó các khung hình đang được ghi lại.

Value

Một HTMLCanvasElement chỉ ra canvas là nguồn của các khung hình đang được ghi lại.

Example

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;

Specifications

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

Browser compatibility

See also