/coba-webrtc

My attempt to learn WebRTC in 2021

Primary LanguageHTML

COBA-WEBRTC

simple demo / proof of concept of working webrtc

video-sender-receiver

ABOUT

  • there is two page: sender.html and receiver.html
  • user who open sender.html will be broadcasting/streaming its media
  • user who open receiver.html will be playing the broadcasted/streamed media
  • no signalling server used, the two user must use other means of communication for signalling (recommended to be in same room and use third party chat software to send the signals)

USAGE

  • open in separate tab (one tab opens sender.html, other tab opens receiver.html)
  • go to tab sender.html, copy the offer (it should contains: {"sdp":"...", "type":"offer"})
  • go to tab receiver.html, paste the offer, then click offer
  • go to tab receiver.html, copy the answer (it should contains: {"type":"answer", "sdp": "..."})
  • go to tab sender.html, paste the answer, then click answer
  • go to tab sender.html, copy the candidate (it should contains: {"candidate":"...","sdpMid":"0","sdpMLineIndex":0})
  • go to tab receiver.html, paste the candidate, then click candidate

NOTES

TO DO

  • learn how to use and deploy STUN/TURN server (e.g.: use coturn in linux server)
  • learn fields/data exchanged in SDP

learning

RTCPeerConnection has two tasks:

  • get local media conditions, such as resolution and codec capabilities. This is the metadata used for the offer-and-answer mechanism.
  • get potential network addresses for the app's host, known as candidates.