Cocoapods (add to Podfile):
pod "WebRTC"
Carthage (add to Cartfile):
github "Anakros/WebRTC-iOS"
Manual: just download framework from the latest release and copy it to your project
You can only use the binary release, because the whole WebRTC repository is ~12Gb of disk space
Cocoapods (will install specified unstable version or any higher version):
pod "WebRTC", ">= 14093.0.0-master"
Carthage (there is no way to auto-update to the latest unstable version at the current moment, so you should specify corresponding version tag):
github "Anakros/WebRTC-iOS" "14093.0.0-master"
import WebRTC
let device = UIDevice.string(for: UIDevice.deviceType())
print(device)
print(RTCInitializeSSL())
@import WebRTC;
NSString *device = [UIDevice stringForDeviceType:[UIDevice deviceType]];
NSLog(@"%@", device);
NSLog(@"%d", RTCInitializeSSL());
Bitcode isn't supported in the upstream for now. So you should disable it in the project build settings.
Built from https://chromium.googlesource.com/external/webrtc/
using webrtc/build/ios/build_ios_libs.sh
script.
Following patches applied:
Hardware H264 support enabled
diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi
index 36a2dae..1332809 100644
--- a/webrtc/build/common.gypi
+++ b/webrtc/build/common.gypi
@@ -155,7 +155,7 @@
# Enable this to use HW H.264 encoder/decoder on iOS/Mac PeerConnections.
# Enabling this may break interop with Android clients that support H264.
- 'use_objc_h264%': 0,
+ 'use_objc_h264%': 1,
# Enable this to prevent extern symbols from being hidden on iOS builds.
# The chromium settings we inherit hide symbols by default on Release
Provide default implementation for WebRTC metrics
diff --git a/webrtc/system_wrappers/system_wrappers.gyp b/webrtc/system_wrappers/system_wrappers.gyp
index ea8fdb6..4ff2bab 100644
--- a/webrtc/system_wrappers/system_wrappers.gyp
+++ b/webrtc/system_wrappers/system_wrappers.gyp
@@ -44,6 +44,7 @@
'include/timestamp_extrapolator.h',
'include/trace.h',
'include/utf_util_win.h',
+ 'include/metrics_default.h',
'source/aligned_malloc.cc',
'source/atomic32_win.cc',
'source/clock.cc',
@@ -76,6 +77,7 @@
'source/trace_posix.h',
'source/trace_win.cc',
'source/trace_win.h',
+ 'source/metrics_default.cc',
],
'conditions': [
['enable_data_logging==1', {