WebRTC Basic

yahone chow
2 min readSep 13, 2021

Simplest demo by using basic methods and events in the WebRTC

Prepare

  • one pc ( with camera and mic ) and one mobile devices(or any Mobile-UA client)
  • solid network

concepts

ICE

Interactive Connectivity Establishment (ICE) is a technique used in computer networking to find ways for two computers to talk to each other as directly as possible in peer-to-peer networking.

— WIKIPEDIA

Namely, it’s a protocol can help you connect to another client.

Peer

similarly with the word peer in the Peer to Peer download. it could be a client ˜ or a browser page or a Native-App.

Signaling server

before your peer transfers data through STUN/TURN server, you need to tell others your existing, signaling server can help.

STUN/TURN server

A STUN client can send messages to the STUN server to get the information about public IP and ports, and retrieve that information.

https://temasys.io/ice-and-webrtc-what-is-this-sorcery-we-explain/

the communication between two client’s may complicated: ip, DNS, transport protocol and so forth. STUN/TURN are most direct way to handle connection between peers, i.e. public ip and port.

Streams

Streams are exactly content what you want been transferred. It could be a media caught from UserMedia API or playable video and so forth.

Events

these are base lifecycle of the rtc-peer connect to other peers.

more clearly

comprehension

Imagine that the whole process of the WebRTC just like you ask your friend to get your crush’s number so you can call her.

In most situation you are always hidden in you chair

If you screw it up, you are negotiationneeded, so you can start your new life.

--

--