captureStream() for <canvas>
Widely available
The captureStream()
method for <canvas>
elements returns a MediaStream
which includes a CanvasCaptureMediaStreamTrack
representing real-time video of the canvas image. You can use this to record the canvas, or send it elsewhere, such as another canvas or WebRTC connection.
To learn more, see
CanvasCaptureMediaStreamTrack,
CanvasCaptureMediaStreamTrack: canvas property,
CanvasCaptureMediaStreamTrack: requestFrame() method,
HTMLCanvasElement: captureStream() method at MDN.
Compatibility
- Chrome 51 Released on 2016-05-25
- Chrome Android 51 Released on 2016-06-08
- Edge 79 Released on 2020-01-15
- Firefox 43 Released on 2015-12-15
- Firefox for Android 43 Released on 2015-12-15
- Safari 11 Released on 2017-09-19
- Safari on iOS 11 Released on 2017-09-19