This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The CanvasCaptureMediaStream.canvas
read-only property returns the HTMLCanvasElement
associated with the stream.
Syntax
var elt = stream.canvas;
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 Elements The definition of 'HTMLCanvasElement' in that specification. |
Editor's Draft | Initial definition |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | No support | 41 (41)[1] | No support | No support | No support |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | No support | 41.0 (41)[1] | No support | No support | No support |
[1] Disabled by default; set the preference canvas.capturestream.enabled
to true
to activate.
See also
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,