🎙️ Chat app using socket.io + realtime voice chat with WebRTC
startAudioChat
. He then grants access to his microphone and inform (through socket.io) User 2 that he is ready to initiate a peer-to-peer communication. His media stream is stored in a variable.Before starting the conversation via WebRTC, we want to check 2 things :
These two points are the reason why we only store the media stream and do not already iniate the peer-to-peer communication.
Instead we wait for the receiver to accept the audio call. It then can seem counter-intuitive, but it is actually the receiver that iniates the peer-to-peer communication, since we know that user 1 want that communication and has already given access to his microphone. When user 1 receives the offer from user 2, we make use of the store media stream.
https://github.com/mornir/node-chat-app
Official Getting Started Guide
Andrew Mead Udemy Course
WebRTC and the mechanics of peer to peer networking
https://www.html5rocks.com/fr/tutorials/webrtc/basics
STUN: https://gist.github.com/zziuni/3741933 (free)
TURN: http://numb.viagenie.ca/ (free)
npm install
npm run serve
npm run build