Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stream a canvas element in WebRtc?

I was searching about WebRtc and I found this great project on GitHub:

https://github.com/mexx91/basicVideoRTC

The communication between 2 cameras works great using node.js.

It's possible to before stream a getuserMedia modify it in a canvas element and so stream this object?

Thanks

like image 727
pierophp Avatar asked Jan 31 '14 15:01

pierophp


1 Answers

It seems currently this is not possible in a cross-browser compatible fashion.

But it may be in the future, you can take a glimpse at the HTMLCanvasElement.captureStream interface as implemented by recent Firefox browsers, see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream .

It allows you to capture the content of a canvas to a stream that can be send wia WebRTC to your peer then.

like image 124
dronus Avatar answered Sep 18 '22 15:09

dronus