Search code examples
node.jsvideo-streamingchatlive-streaming

Building a chat application, NodeJS and Express - what should I use for media streaming?


I've previously built chat servers using NodeJS (i.e. central chat server with clients, no p2p), with Electron, or just good old Express. I'd like to re-use as much of my old code as possible. Thus, the only missing piece of the puzzle for me is what to use to enable both public and private video/audio streaming. File sending isn't necessary.

Is there anything out there I can 'easily' drop in to this model? I'm aware of Kurento and a few similar offerings but these feel like overkill for how I'm hoping to work.

update: Given a few suggestions about WebRTC, which I'm open to, but plans for this app include automated moderation/content filtering of any video broadcasts and text. So I assume such a solution would need to either treat the server as a 'hardcoded' peer somehow so that it's fairly safe to assume it will see a copy of anything sent over the public chat network. Of course, for private communications this need not be the case. On the flip side, worst case, operating in a spoke topology is fine too.


Solution

  • You can start with a WebRTC samples https://webrtc.github.io/samples/

    WebRTC is kind of standard now for audio/video calls. It's all work p2p with no server interaction. The only one thing you need to build is a signaling protocol to connect 2 users. For this you can use/extend your nodejs app chat.