• Stars
    star
    114
  • Rank 306,261 (Top 7 %)
  • Language
    Objective-C
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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



##100% Attention#

  • In this demo, I custom-make a signaling type XMPPMessage to transfer the signallings. Before run this demo, Please Check whether your jabber server can support this custom XMPPMessage. If your jabber server cann't support it, you should modify the custom XMPPMessage's type that your jabber server can support in the XMPPMessage+Signaling file, for example in the file, change TYPE_SIGNALING macro value signaling to chat.

  • 在该Demo中,我使用的是自定义的、类型为 signaling 的 XMPPMessage 来传递信令。**运行该Demo前,请务必检测你的jabber服务器是否支持这种自定义类型的 XMPPMessage 。**如果不支持,请把该类型的 XMPPMessage 修改为你的jabber服务器支持的类型,如 chat 类型(在XMPPMessage+Signaling文件中修改TYPE_SIGNALING的宏定义值即可)。


##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.

More Repositories

1

SnapshotKit

UIView/UIWindow/UIScrollView/UITableView/UIWebView/WKWebView Extension to easily take snapshot image of visible or full content.
Swift
133
star
2

LottieExample

lottie-iOS 应用示例
Objective-C
27
star
3

Flr

🚚 MIGRATED: This repo is deprecated now, and has been migrated to https://github.com/Fly-Mix/flr-cli
Ruby
18
star
4

DecorationViewDemo

UICollectionView-DecorationView Demo
Swift
10
star
5

r_dart_library

A core library of R class which is generated by Flr(https://github.com/Fly-Mix/flr-cli) in flutter project.
Dart
7
star
6

YKImageCropper

YKImageCropper can help you to crop the image according to the size you want.
Objective-C
4
star
7

YKPageControllerScrollView

UIViewController容器类滚动视图,支持UIViewControlle重用机制
Objective-C
2
star
8

ModalAlert

Erica Sadun's ModalAlert + Customized
Objective-C
2
star
9

NSObject-EasyCopy

a copy category for NSObject
Objective-C
2
star
10

GestureImageView

GestureImageView extendeds gesture function, can help you easily to get an imageView with Tap Event/Click Event, or LongPress Event and so on.
Objective-C
2
star
11

YKWebViewJavascriptBridge

基于 WKWebView+messageHandler+自定义协议 搭建的 WebViewJavascriptBridge
Objective-C
2
star
12

DynamicTencentOpenApi

这是一个把TencentOpenApi转换为动态库的“失败”示例
Objective-C
1
star
13

Xcodeprojfiler

Xcodeprojfiler is a CLI tooL which can help iOS developer to get the info of files which exist in the xcode project dir. For example, Xcodeprojfiler can scan the current xcode project dir and find out the files which are not included in xcworkspace.
Ruby
1
star