Amit Shekhar Profile picture
May 14 β€’ 16 tweets β€’ 4 min read
How does the Voice And Video Call Work?

This tweet is all about how the voice and video call works on a high level.

Continued in this thread 🧡 [Follow the thread below] πŸ‘‡

#AndroidDev #Kotlin #Android #Developer
Both voice and video calls depend on how we stream media between the two clients who are connected to each other. So, there must be something that can do the work of media streaming from one client to another client.

For media streaming, we need to know about WebRTC.
WebRTC is a free, open project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
But there are many other things that we need to do as WebRTC is not enough for complete implementation.

Other things are:

- Signaling
- STUN Server
- TURN Server
What is Signaling?

In order to set up a call between two clients, both the clients must conform to each other by sending key data, messages, and metadata about the media. Over signaling, we do these things.

We can use WebSocket for the purpose of signaling.
Signaling is just used to know that these two clients want to connect to each other for the call.
Peer to Peer Connection

After signaling, we need to connect both the client peer to peer. And for connecting, we must have the public IP address of both the clients.

So, in order to get the public IP address, we use the STUN Server.
STUN Server is used to get the public IP address.

Why need a public IP address?

A Public IP Address is an IP address that is globally unique across the Internet. Only one device may be in possession of a public IP address.
A Private IP Address is an IP address that is not globally unique and may exist simultaneously on many different devices. A private IP address is never directly connected to the Internet.
The NAT(Network Address Translation) provides the local IP address of the device which can’t be used publicly to connect peer to peer. And for WebRTC, we need to have a public IP address. STUN Server provides that.
If everything is fine, we get the public IP addresses of both the clients, and then, we connect both the clients through WebRTC to start the call. WebRTC handles all the media streaming.
The real-world connectivity is not ideal.

In case, we are not able to get the public IP address of both the clients. Then we can’t connect peer to peer. In that case, we need the TURN Server.
TURN Server is used to connect both the clients if peer-to-peer fails by acting as a mediator. Basically, it takes the data from one client and sends it to another client. So, its job is to relay the media.

This way, the two clients start talking to each other.
The other small data which are not related to media like a client cuts the call, any setting changes, messages and etc are sent over the signaling process.

The following question arises.

Why WebRTC can’t do signaling?
Answer: To avoid redundancy and to maximize compatibility with established technologies, the signaling methods and protocols are not specified by the WebRTC Standards.

WebRTC is optimized for media.
So, this way the voice and video call works.

That's it for now.

Happy Learning :)

Show your love by sharing this tweet with your fellow developers.

Follow @amitiitbhu for learning and sharing.

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Amit Shekhar

Amit Shekhar Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @amitiitbhu

May 13
What is Feature Engineering for Machine Learning?

A thread 🧡

#MachineLearning
Feature engineering is the process of using domain knowledge of the data to create features that make machine learning algorithms work.
If feature engineering is done correctly, it increases the predictive power of machine learning algorithms by creating features from raw data that help facilitate the machine learning process.
Read 15 tweets
Apr 13
Why an Android App lags?

A thread 🧡

I will start with the following statement:

Garbage Collector: The TAX on Android App Performance

#AndroidDev
The main reason for the low-performance Android App is that it runs GC very frequently.

Simple in one line: The time for which GC is running the actual app is not running.
When the app runs, it allocates many objects on the basis of your code, and when the objects are no longer referred to, the system call GC when there is memory pressure to deallocate those objects, so if the object allocation and deallocation are occurring on regular basis.
Read 10 tweets
Aug 21, 2021
How does Voice And Video Call Works?

This tweet is all about how the voice and video call works on a high level.

Continued in this thread πŸ‘‡ [Follow the thread below]

#AndroidDev #Kotlin #Android #Developer
Both voice and video calls depend on how we stream media between the two clients which are connected to each other. So, there must be something that can do the work of media streaming from one client to another client.

For media streaming, we need to know about WebRTC.
WebRTC is a free, open project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Read 16 tweets
Aug 20, 2021
Android App Release Checklist For The Production Launch

Continued in this thread πŸ‘‡ [Follow the thread below]

#AndroidDev #Kotlin #Android #Developer
Add analytics to your Android application.
Turn off logging and debugging.
Read 21 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(