Closed B-R-Bender closed 6 years ago
No Node.js WebRTC implementations support MediaStreams, so you can't use video/audio with Node.js, only data channels.
You could launch a headless browser though. https://github.com/GoogleChrome/puppeteer
Or you could record the audio/video and upload it to the server as a file: https://github.com/muaz-khan/RecordRTC
Thanks, @RationalCoding Your suggestion is to instatiate headless chrome on server for each connection, and use it as a peer for client browser, am I right?
What if I send media stream data via peer.send()?
One headless Chrome instance with multiple peers in it.
You could send video data over the datachannel, but where would you get it? Node doesn't have getUserMedia or any way to construct media streams, so you'd have to manually create webm streams with the right format for MediaSource. Probably a lot more trouble than it's worth.
If you want to only receive video/audio on the Node side and not send, you can use media-record-stream and media-source-stream with the data channels (search npm).
Hi!
I've run into an issue with creating simple peer on node server. I'm trying to implemet WerRTC video/audio streaming between clients browser and node server (server as peer). When I'm getting offer from client I'm creating a peer. As I suppose. I can pass stream only in SimplePeer constructor.
So when I'm trying to do this I'v got an error:
self._pc.addStream is not a function
in debugger it looks like this: debug screanshot
Could you please help me with this? Any suggestions, workarounds?
Thank you!