3 ms·
What does record from a canvas mean in this context? Is that html canvas? If so, how are they filling it with local screen content?
by aloer 7y ago
What does record from a canvas mean in this context? Is that html canvas? If so, how are they filling it with local screen content?
- supermatt 7y agoHTML canvas, yes. They use a webgl context (but you can also do similar with a 2d context) containing a video texture (from the mediastream - video/webcam/screencap/etc). You can find a number of examples by searching "getUserMedia" and "canvas" - for example: https://webrtc.github.io/samples/src/content/getusermedia/canvas/ https://webrtc.github.io/samples/src/content/getusermedia/ca... edit: apologies, here they read the pixel data from the video element, but the principle is the same. One reason for using a canvas intermediary (or even multiple) is to provide multiple sizes, or perform some processing, such as background removal, for example.
- jeremija 7y agoI believe it is the HTML canvas. It is very simple to capture a video frame using canvas - see this commented out code: https://github.com/jeremija/peer-calls/blob/6b865a78bbb4e64e981212b0a0e741741f8f9196/src/client/components/Input.tsx#L61-L72 https://github.com/jeremija/peer-calls/blob/6b865a78bbb4e64e...