This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
The CanvasCaptureMediaStream.canvas
read-only property returns the HTMLCanvasElement
associated with the stream.
SyntaxEdit
var elt = stream.canvas;
ExampleEdit
// 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;
SpecificationsEdit
Specification | Status | Comment |
---|---|---|
Media Capture from DOM Elements The definition of 'HTMLCanvasElement' in that specification. |
Editor's Draft | Initial definition |
Browser compatibilityEdit
[1] Disabled by default; set the preference canvas.capturestream.enabled
to true
to activate.
See alsoEdit
HTMLCanvasElement.captureStream()
to create a stream associated to a given canvas element.
Document Tags and Contributors
Tags:
Contributors to this page:
Sebastianz,
teoli
Last updated by:
Sebastianz,