WebRTC samples Stream from canvas to video element

Click and drag on the canvas (on the left) to move the teapot.

This demo requires Firefox 47 or Chrome 52 (or later).

The teapot is drawn on the canvas element using WebGL. A stream is captured from the canvas element using its captureStream() method and set as the srcObject of the video element.

The canvas, video, and stream variables are in global scope, so you can inspect them from the browser console.

For more demos and information about captureStream(), see Media Capture from Canvas Implementation.

View source on GitHub