Introduction
At this point, we know:
- Why WebRTC exists
- How NAT works
- Why STUn/TURN works
- What MediaStreams are
- What RTCPeerConnection is
However, one enormous mystery still remains.
When you see code like:
const pc = new RTCPeerConnection();nothing happens.
No call starts.
No audio flows.
No video appears.
Why?
Because creating a PeerConnection is like buying a phone.
Owning a phone does not automatically create a conversation.
Something else must happen.
You must:
- Find the other person.
- Exchange information.
- Agree on communication parameters.
- Establish connectivity.
- Start Communication
This entire process is called:
Connection Establishment
The Biggest Misconception in WebRTC
Ask a beginner:
How does Alice connect to Bob?
Common answer:
Alice creates RTCPeerConnection
Bob creates RTCPeerConnection
DoneUnfortunately:
Nothing worksWhy?
Because Alice and Bob are strangers.
Consider two laptops.
Alice Laptop
Bob LaptopQuestions immediately arise:
Where is Bob?
What codecs does Bob support?
What IP address should I use?
Can bob receive video?
Can bob receive audio?
What encryption method should we use?The browsers don't know.
There information must be exchanged.
This information exchange is called: Signaling
Understanding Signaling
Before media can flow, peers must communicate.
But here's the paradox.
We need communication before communication exists.
How is that possible?
The answer:
Use another communication channel first.
Analogy: Phone Calls
Imagine Alice wants to call Bob.
Before the conversation begins:
Alice needs:
Bob's Phone NumberWithout it:
No Call PossibleSimilarly, WebRTC peers need a way to exchange connection information.
What Is signaling?
Signaling is:
The proces of exchanging connection metadata before media communication begins.
Notice something important.
Signaling is NOT media transport.
It does not carry:
Audio
VideoInstead it carries:
Connection InformationWhat Information Must Be Exchanged?
Let's think like engineers.
What does Alice need to know?
Capability Information
Example:
Alice supports
Leave a comment
Your email address will not be published. Required fields are marked *
