You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h1><ahref="//webrtc.github.io/samples/" title="WebRTC samples homepage">WebRTC samples</a><span>Stream from a canvas to a video element</span></h1>
37
+
38
+
<canvas></canvas>
39
+
40
+
<videoautoplay></video>
41
+
42
+
<p>Click and drag on the canvas (on the left) to move the teapot.</p>
43
+
44
+
<p>This demo requires Firefox 43 or above, Chrome 51 or above, or Chrome 50 with <strong>Experimental Web Platform features</strong> enabled.</p>
45
+
46
+
<p>The teapot is drawn on the canvas element using WebGL. A stream is captured from the canvas element using its <code>captureStream()</code> method and set as the <code>src</code> of the video element using <code>URL.createObjectURL()</code>.</p>
47
+
48
+
<p>The <code>canvas</code>, <code>video</code>, and <code>stream</code> objects are in global scope, so you can inspect them from the browser console.</p>
49
+
50
+
<p>For more demos and information about <code>captureStream()</code>, see <ahref="https://docs.google.com/document/d/1JmWfOtUP6ZqsYJ--U8y0OtHkBt-VyjX4N-JqIjb1t78" title="Implementation overview doc">Media Capture from Canvas Implementation</a>.</p>
51
+
52
+
<ahref="https://github.com/webrtc/samples/tree/gh-pages/src/content/capture/canvas-video" title="View source for this page on GitHub" id="viewSource">View source on GitHub</a>
0 commit comments