SDK for adding OpenWebRTC to your iOS apps using CocoaPods
The SDK uses CocoaPods as library dependency manager. In order to set this up:
sudo gem install cocoapods
pod setup
The OpenWebRTC SDK is made up of 2 different pods:
OpenWebRTC
- Contains the pre-build framework OpenWebRTC.framework
.OpenWebRTC-SDK
- Contains helper classes for quickly developing native and hybrid apps. Example Podfile:
platform :ios, '8.0'
target 'NativeDemo' do
pod 'OpenWebRTC', '~> 0.1'
pod 'OpenWebRTC-SDK', :git => 'https://github.com/EricssonResearch/openwebrtc-ios-sdk.git'
end
or
platform :ios, '8.0'
target 'NativeDemo' do
pod 'OpenWebRTC'
pod 'OpenWebRTC-SDK', :path => '../../../openwebrtc-ios-sdk/OpenWebRTC-SDK.podspec'
end
Apps that use the OpenWebRTC iOS SDK:
The entry point class for Native app developement is OpenWebRTCNativeHandler
:
@protocol OpenWebRTCNativeHandlerDelegate <NSObject>
- (void)answerGenerated:(NSDictionary *)answer;
- (void)offerGenerated:(NSDictionary *)offer;
- (void)candidateGenerated:(NSDictionary *)candidate;
/**
* Format of sources:
* [{'name':xxx, 'source':xxx, 'mediaType':'audio' or 'video'}, {}, ...]
*/
- (void)gotLocalSources:(NSArray *)sources;
- (void)gotRemoteSource:(NSDictionary *)source;
@end
@interface OpenWebRTCNativeHandler : NSObject
@property (nonatomic, weak) id <OpenWebRTCNativeHandlerDelegate> delegate;
@property (nonatomic, strong) OpenWebRTCSettings *settings;
- (instancetype)initWithDelegate:(id <OpenWebRTCNativeHandlerDelegate>)delegate;
- (void)setSelfView:(OpenWebRTCVideoView *)selfView;
- (void)removeSelfView;
- (void)setRemoteView:(OpenWebRTCVideoView *)remoteView;
- (void)removeRemoteView;
- (void)addSTUNServerWithAddress:(NSString *)address port:(NSInteger)port;
- (void)addTURNServerWithAddress:(NSString *)address port:(NSInteger)port username:(NSString *)username password:(NSString *)password isTCP:(BOOL)isTCP;
- (void)startGetCaptureSourcesForAudio:(BOOL)audio video:(BOOL)video;
- (void)initiateCall;
- (void)terminateCall;
- (void)handleOfferReceived:(NSDictionary *)offer;
- (void)handleAnswerReceived:(NSDictionary *)answer;
- (void)handleRemoteCandidateReceived:(NSDictionary *)candidate;
- (void)setVideoCaptureSourceByName:(NSString *)name;
- (void)videoView:(OpenWebRTCVideoView *)videoView setVideoRotation:(NSInteger)degrees;
- (void)videoView:(OpenWebRTCVideoView *)videoView setMirrored:(BOOL)isMirrored;
- (NSInteger)rotationForVideoView:(OpenWebRTCVideoView *)videoView;
@end
See https://github.com/EricssonResearch/openwebrtc-ios-sdk/releases