CanvasCaptureMediaStreamTrack canvas read-only property returns the HTMLCanvasElement from which frames are being captured.

句法

var elt = stream.canvas;
					

An HTMLCanvasElement indicating the canvas which is the source of the frames being captured.

范例

// Find the canvas element to capture
var canvasElt = document.getElementsByTagName("canvas")[0];
// Get the stream
var stream = canvasElt.captureStream(25); // 25 FPS
// Do things to the stream
...
// Obtain the canvas associated with the stream
var canvas = stream.canvas;
					

规范

规范 状态 注释
Media Capture from DOM Elements
The definition of 'CanvasCaptureMediaStreamTrack.canvas' in that specification.
工作草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
canvas Chrome 不支持 No Edge 不支持 No Firefox 41 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 41 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改:
  1. CanvasCaptureMediaStreamTrack
  2. 特性
    1. canvas
  3. 方法
    1. requestFrame()