Skip to content
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

Merged
merged 14 commits into from May 9, 2016

Conversation

samdutton
Copy link
Contributor

Description
A teapot is drawn on a canvas element using WebGL. A stream is captured from the canvas element using captureStream() and set as the src of a video element using URL.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.

var video = document.querySelector('video');

var stream = canvas.captureStream();
video.src = URL.createObjectURL(stream);
Copy link
Collaborator

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 =?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@samdutton
Copy link
Contributor Author

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.

@KaptenJansson
Copy link
Contributor

KaptenJansson commented May 9, 2016

I've disabled FF beta but you need to merge latest gh-pages branch for it to work.

@KaptenJansson
Copy link
Contributor

LGTM. Actually I can deal with merge + FF beta failure.

@KaptenJansson
Copy link
Contributor

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?

@samdutton
Copy link
Contributor Author

You can use the squash-commits features if you like. I'm in transit :).
On 9 May 2016 8:02 a.m., "Christoffer Jansson" notifications@github.com
wrote:

On 2nd thought though, I would want to squash all those commits,
@samdutton https://github.com/samdutton do you want to do that or
should I use the new squash commits feature in github?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#784 (comment)

@KaptenJansson KaptenJansson merged commit c3fda22 into webrtc:gh-pages May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants