WebRTC for android ios開發官方指南

The WebRTC  native code package  can be found at:
Prerequisite 
Install depot_tools
manage checkouts and code reviews.  
The depot_tools package includes  gclient gcl git-cl repo , and others.
  1. Confirm git and python are installed. git 2.2.1+ recommended. python 2.7+ recommended.
  1. Fetch depot_tools: 
$  git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  1. Add depot_tools to your PATH:
$  export PATH=`pwd`/depot_tools:"$PATH"
  • Yes, you want to put depot_tools ahead of everything else, otherwise gcl will refer to the GNU Common Lisp compiler.

Example Applications
src/webrtc/examples  and  src/talk/examples :
1,Peerconnection :consist of two applications using the  WebRTC Native APIs : peerconnection_server and peerconnection_client   (not currently supported on Mac/Android)
2,Call App
Target name  call  (currently disabled).
establishes a call using libjingle.
Call uses xmpp (as opposed to SDP used by WebRTC) to allow you to login using your gmail account and make audio/video calls with your gmail friends.
3, relayserver
Can be used with the call application above.
4, stunserver
5,turnserver

安裝好java
Android
fetch --nohooks webrtc_android 約 16 GB, gclient sync
編譯:進入src目錄
gn gen out/Debug --args='target_os=" android" target_cpu="arm"'
ninja -C out/Debug
AppRTCMobile is an Android application using WebRTC Native APIs via JNI (JNI wrapper is documented  here ).
For instructions on how to build and run, see  webrtc/examples/androidapp/README .
能夠生成android studio工程:詳見官網

iOS
A macOS machine is required for iOS development.
fetch --nohooks webrtc_ios gclient sync
gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64"'
ninja -C out/ios_64 target 
To see a list of available targets, run  gn ls out/<output folder> .
能夠生成xcode工程
It’s easiest to deploy to a device using Xcode. Other command line tools exist as well, e.g.  ios-deploy .
Using WebRTC in your app
ninja -C out/ios rtc_sdk_framework_objc
本人已經在美國服務器上將android和ios的代碼所有下載並同步了。而後打包放在了百度雲上,你們只須要繼續gn gen和ninja就能夠了,android和ios我都只運行到gclient sync!
android打包後有12G,由於裏面含有android sdk和ndk.ios大約有6G.
首次同步時間是2017.07.05,你們能夠根據指南更新: https://webrtc.org/native-code/development/ 的updating the code章節!
對應的docker鏡像以下:
參考:
相關文章
相關標籤/搜索