Skip to content

anantgarg/AppRTCDemo

 
 

Repository files navigation

AppRTCDemo - A WebRTC for iOS Client Demo


##About AppRTCDemo# This is a WebRTC4iOS client demo. This demo show how 2 ios clients have a real-time audio&video communication. If you have the STUN/TURN server, they can communicate in different LAN.


##Requirements#

  • Xcode 5 or higher
  • iOS 6.0 or higher
  • ARC

##About WebRTC# WebRTC is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple JavaScript APIs. The WebRTC components have been optimized to best serve this purpose.


##About WebRTC Native APIs and libjingle# To implement real time communication, web developer can use WebRTC API, but we, as native developer, can use what? Thsese are: WebRTC Native APIs and libjingle, they can enable Native APP to implement RTC(Real-time communication) function.

In fact, the official has provided us some Native Example Applications. Here is the official iOS example, but it's not good. This is a better iOS example based the official one.


##About Signaling Service# Signaling protocols and mechanisms are not defined by WebRTC standards, so you need to build it by yourself.

The demo uses XMPP to build the signaling service.It implements that with XMPPFramework.

PS: The official iOS example uses the Google App Engine Channel API to build the service.


##The Basic P2P Communication Process#

Caller Callee

1. build the signaling service and listen to the signaling message

1. build the signaling service and listen to the signaling message
... to bulid RTC connection...
2. create peerConnection

3.1 create and send offer sdp(sessionDescription);

if got new ICE Candidate, then send it to Callee

2. listen to the signaling message. Cache the remote offer sdp and ICE Candidate

3.2 create peerConnection and deal with the offer sdp and ICE Candidate
4.2 listen to the signaling message. Deal with the remote answer sdp and ICE Candidate

4.1 create and send answer sdp(sessionDescription);

if got new ICE Candidate, then send it to Caller

..successfully building RTC connection, then can start audio and video communication...
5.1 send BYE signaling message and close peerConnection 5.2 when get the BYE signaling message, then close peerConnection


中文版

Caller Callee
1. 建立信令通讯(XMPPWorker)以及监听信令
1. 建立信令通讯(XMPPWorker)以及监听信令
... 建立RTC 链接...
2. 创建 peerConnection

3.1 创建并发送 offer

若发现新的ICE Candidate,则发送给Callee

2. 监听信令。把收到的 offer 以及 ICE Candidate缓存起来

3.2 创建 peerConnection,处理缓存的 offer 以及ICE Candidate
4.2 监听信令。直接处理收到的 answer 以及 ICE Candidate

4.1 创建并发送 answer

若发现新的ICE Candidate,则发送给Caller

..RTC 链接建立完毕,开始进行音视频通讯...
5.1 发送 BYE 信令,关闭 peerConnection 5.2 收到 BYE 信令后,关闭 peerConnection



##Change Log#

1.0 - 2014/03/11

  • Initial release. Now 2 iOS client can have a real-time audio&video communication repeatedly, and if you have the STUN/TURN server, they can communicate each other in different LAN.

About

A WebRTC for iOS client demo. PS: It uses XMPP to build the signaling service.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published