W3cubDocs

/DOM

CanvasCaptureMediaStream.canvas

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

© 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