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.
var elt = stream.canvas;
// 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;
Specification | Status | Comment |
---|---|---|
Media Capture from DOM Elements The definition of 'HTMLCanvasElement' in that specification. | Editor's Draft | Initial definition |
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.
HTMLCanvasElement.captureStream()
to create a stream associated to a given canvas element.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStream/canvas