New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added canvas captureStream() to video element demo #784
Conversation
var video = document.querySelector('video'); | ||
|
||
var stream = canvas.captureStream(); | ||
video.src = URL.createObjectURL(stream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you just use srcObject =?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh! Force of habit. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh! Force of habit. Fixed.
On 8 May 2016 8:14 a.m., "Philipp Hancke" notifications@github.com wrote:
In src/content/capture/canvas-video/js/main.js
#784 (comment):+*
+* Use of this source code is governed by a BSD-style license
+* that can be found in the LICENSE file in the root of the source
+* tree.
+*/
+
+'use strict';
+
+// Call main() in demo.js
+main();
+
+var canvas = document.querySelector('canvas');
+var video = document.querySelector('video');
+
+var stream = canvas.captureStream();
+video.src = URL.createObjectURL(stream);can't you just use srcObject =?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/webrtc/samples/pull/784/files/a2024b1d3a40942f19311b34d7d1626ecfeaaf7e#r62427985
I added a .eslintignore file to avoid third_party/*.js files from being checked by eslint. Travis is now failing here — can't quite see what's going wrong. |
I've disabled FF beta but you need to merge latest gh-pages branch for it to work. |
LGTM. Actually I can deal with merge + FF beta failure. |
On 2nd thought though, I would want to squash all those commits, @samdutton do you want to do that or should I use the new squash commits feature in github? |
You can use the squash-commits features if you like. I'm in transit :).
|
Description
A teapot is drawn on a canvas element using WebGL. A stream is captured from the canvas element using
captureStream()
and set as thesrc
of a video element usingURL.createObjectURL()
.Adapted from https://cdn.rawgit.com/uysalere/js-demos/master/canvascapture3.html.
Live on GitHub pages at http://samdutton.github.io/webrtc/src/content/capture/canvas-video/.
Purpose
First of several canvas and video
captureStream()
demos.