Web/API/CanvasCaptureMediaStreamTrack/canvas

From Get docs


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

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

canvas

Experimental'

Chrome

No support No

Edge

No support No

Firefox Full support 41

Disabled'

Full support 41

Disabled'

Disabled' From version 41: this feature is behind the canvas.capturestream.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

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

Disabled'

Full support 41

Disabled'

Disabled' From version 41: this feature is behind the canvas.capturestream.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

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