How to Build a WebRTC Mobile App with Free SDKs? — Ant Media Server

What is WebRTC?

How does WebRTC work?

  • WebRTC sends data directly across browsers — it is called “P2P”.
  • It can send audio, video, or data in real-time.
  • It needs to use NAT traversal mechanisms for browsers to reach each other.
  • P2P needs to be gone through a relay server (TURN).
  • With WebRTC you need to think about signaling and media. They are different from each other.
  • One of the main features of the tech is that it allows peer-to-peer (browser-to-browser) communication with little intervention from a server, which is usually used only for signaling.
  • It’s possible to hold video calls with multiple participants using peer-to-peer communication. A media server helps reduce the number of streams a client needs to send, usually to one, and can even reduce the number of streams a client needs to receive.
  • Servers you’ll need in a WebRTC product:
  • Signaling server
  • STUN/TURN servers
  • Media servers (It is up to your use case)

Benefits of WebRTC for mobile apps

Device and platform independence

Supported by every operating system and browser, WebRTC can be implemented as an open web standard with simple JavaScript APIs. When developing a mobile application on Android and iOS, the common application flow is followed.

Secure video and voice calling

Some usage areas need more security than others. For example, video conferencing applications have become an essential component of a secure business communication platform, messaging, and voice tools. That’s why it’s so important that WebRTC has permanent audio and video encryption.


With the success of your application (I hope) the number of users will increase. An increasing number of users can negatively affect the user experience of your application. However, with WebRTC, you can scale the growing number of users and offer a unique experience.

Real-time engagement/Ultra-low latency

With WebRTC, you can increase the engagement of your application and offer real-time interaction with 0.5 seconds latency. In this way, users get a unique experience while using your app.

WebRTC mobile app and web service examples

WebRTC is used in hundreds of thousands of applications. Some of the most well-known

Google Meet

Facebook Messenger


Native WebRTC mobile app development

A WebRTC mobile application will usually go through a common application flow. Accessing the media devices, opening peer connections, discovering peers, and starting streaming.

How to build a WebRTC iOS App

Ant Media’s WebRTC iOS SDK lets you build your own iOS application that can publish and play WebRTC broadcasts with just a few lines of code.
In WebRTC iOS doc, we’re going to cover the following topics.

  • Run the Sample WebRTC iOS app
  • Publish Stream from your iPhone
  • Play Stream on your iPhone
  • P2P Communication with your iPhone
  • Develop a WebRTC iOS app
  • How to Publish
  • How to Play
  • How to use DataChannel

How to build a WebRTC Android App

You can use WebRTC facilities in the Android Platform with the help of Ant Media Server’s Native WebRTC Android SDK. In this WebRTC Android doc, features of WebRTC Android SDK will be presented with a sample Android project which comes bundled with the SDK.

  • Provides peer-to-peer WebRTC communication between Android devices and browsers by usingAnt Media serveras a signaling server.
  • Could publish WebRTC stream which could be played by other Android devices and browsers (mobile or desktop).
  • Could play WebRTC stream which is published by other Android devices and browsers (mobile or desktop).
  • Could join conference room that is created in Ant Media Server.

Common mistakes in building a WebRTC mobile app

Consider and test browser updates

WebRTC is still under development. That’s why you need to be aware of the latest updates and developments. Unfortunately, just following WebRTC is not enough. At the same time, you need to follow the updates of the browsers. It will be good for you to constantly test your application in different browsers.

Test your own mobile app updates

One of the most remarkable features of WebRTC is that it is supported by almost every platform. However, this means that you have to consider a lot more details during development. Your application running in one browser may fail in another browser, or your application running on iOS may run problematic on Android. That’s why you should test your app on as many platforms as possible after each update.

Test on multiple devices and networks

Different devices and networks can also cause problems. You cannot be sure on which devices and on what network your application will be used. That’s why you should run your tests on different devices and networks.

Ant Media’s SDKs for WebRTC Mobile apps



Ant Media Server, open source software, supports publishing live streams with WebRTC and RTMP. It supports HLS(HTTP Live Streaming) and MP4 as well.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ant Media Server

Ant Media Server

Ant Media Server, open source software, supports publishing live streams with WebRTC and RTMP. It supports HLS(HTTP Live Streaming) and MP4 as well.