Web/API/CanvasCaptureMediaStreamTrack/canvas
The CanvasCaptureMediaStreamTrack
canvas
read-only property returns the HTMLCanvasElement
from which frames are being captured.
Syntax
var elt = stream.canvas;
Value
An HTMLCanvasElement
indicating the canvas which is the source of the frames being captured.
Example
// 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;
Specifications
Specification | Status | Comment |
---|---|---|
Media Capture from DOM ElementsThe definition of 'CanvasCaptureMediaStreamTrack.canvas' in that specification. | Working Draft | Initial definition |
Browser compatibility
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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
No support No |
Edge
No support No |
Firefox Full support 41 Full support 41 Disabled' From version 41: this feature is behind the |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
No support No |
Firefox Android Full support 41 Full support 41 Disabled' From version 41: this feature is behind the |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
No support No |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
See also
HTMLCanvasElement.captureStream()
to create a stream to capture a given canvas element.<canvas>
CanvasCaptureMediaStreamTrack.canvas by Mozilla Contributors is licensed under CC-BY-SA 2.5.