how to build multi-user video chatting web app using webRTC, node.js and socket.io

拟墨画扇 提交于 2020-05-10 06:18:22

问题


im trying to make a web app that supports multi-user video chatting. ive read an article about webrtc on "getting started with webrtc" (http://www.html5rocks.com/en/tutorials/webrtc/basics/) and done some demo on codelab. but i still dont really know how to make it a 3-way conferencing call.i dont really know a lot about node.js and socket.io. just started learning them because im trying to build this video web app.

so my question is which part of webrtc or socket.io determines that more than 2 users can join the call? or any resource that you guys get direct me to?

thanks in advance.


回答1:


I would say that there are two separate things here. WebRTC needs signaling to setup the peer-to-peer communication between two nodes. I think you are on the right track when using Node.js and Socket.js for this.

But it is not WebRTC (or socket.io) that decides if a third part can join the meeting, it is you that decides this. And this is the other part of the signaling that have little to do with WebRTC.

This meens that you implement functionality like setting up meetingroom, discover available meetingrooms, joining meetingrooms etc. When the three part meeting is up and running, each node will have two peer connections, one to each of the other nodes.




回答2:


WebRTC is peer-to-peer protocol(browser-to-browser) without server,So you must know about my browser i must know about your browser means(your browser codec,public ip,port,etc) then only we can able to communicate,so we are using signalling(socket.io:web socket two way communication protocol send some information about my browser ,and receive some information about you browser ,with nodeJS server then peer connection will establish)

Three user communication is also possible in WebRTC using mesh network,see you send some information to me (browser information) at a same time you send this same information to other peer,when i receive some information about your i will send some information about me to you and other peer,the same thing will happen in other peer also.

Here some detail about mesh network http://en.wikipedia.org/wiki/Mesh_networking




回答3:


For N users, you need to use a media streamer like Kurento (http://www.kurento.org/)

Then you can build your own multi users webrtc solution such as: https://webrtc-chat.com/ (built on top of Kurento)




回答4:


I looked at those protocols as well, not sure what node.js and sockets.io can do yet, but I think its a big mistake whatever they are doing, because all you need to do is create one place where multiple users will put their webcam images and then everybody could access the place separately to view all conversations. This has to be quick though because not a problem with video but if signal is slow then its not going to be understandable. I would try something else. I am wondering why they could not solve such an easy concept of multi-conferencing.

I have created a parody of multi-chat on my website, I cannot show you right now, but basically I save frames every 5 seconds of video and then store them (overwrite) the image saved in central folder. When somebody logs in they see all the webcams online (done with PHP). I don't know if this helps but it works and it is similar.



来源:https://stackoverflow.com/questions/21688549/how-to-build-multi-user-video-chatting-web-app-using-webrtc-node-js-and-socket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!