2014-10-16 101 views
3

我試圖讓PhoneRTC演示啓動並運行。 https://github.com/alongubkin/phonertc/PhoneRTC演示應用程序

我居然有一堆疑惑

首先,我的理解:1。 我們需要一個TURN服務器 2.我們需要(在回購演示/服務器)的信令服務器 3。我們需要一個cordova項目,它將使用phoneRTC項目(demo/client in repo)

  1. 啓動AWS實例,分配一個動態DNS。 安裝了TURN服務器並啓動了它 - 但現在我對教程中提到的私有IP和公共IP部分感到困惑,因爲每次重新啓動實例時,我的IP都會更改。我有一個dns的名字(來自noip)將堅持下去。所以我探索如何與

  2. 我檢查了源代碼,並遵循故宮安裝cordva等步驟,

  3. 設置TURN服務器信令服務器,我瀏覽到演示中/服務器源代碼並在npm安裝後嘗試了node index.js,但發現有關未找到該模塊的錯誤。

  4. demo/client也是一個nodeJS項目,對嗎?如果我啓動並運行,那是視頻聊天,對吧?

回答

4

亞馬遜提供Elastic IPs它允許您爲您的EC2主機制作永久IP地址。

下面是運行從頭開始演示所需的全部命令:

# install global dependencies 
npm install -g cordova bower grunt-cli 

# clone phonertc 
git clone https://github.com/alongubkin/phonertc.git 

# build client 
cd demo/client 
npm install 
bower install 

cordova plugin add org.apache.cordova.device 
cordova plugin add org.apache.cordova.console 
cordova plugin add https://github.com/alongubkin/phonertc.git 

# follow the instructions for iOS after running this command 
cordova platform add ios android 

# before running the next command, make sure to 
# change your server details in demo/client/app/scripts/signaling.js 
# and in demo/client/app/scripts/CallCtrl.js 
grunt build --force 

# build server 
cd ../server 
npm install 

運行服務器:

cd demo/server 
node index.js 

要在Android上運行的客戶端:

cordova run android 

在iOS上運行客戶端運行:

cordova build ios 

並在真正的iOS設備上從Xcode運行項目。

+0

在相同的ip上運行2個設備是否會導致TURN問題? – sbaaaang 2014-10-19 08:45:48

+4

當我從'demo/client'運行'cordova plugin add org.apache.cordova.device'時,我看到'當前工作目錄不是基於Cordova的項目.'。我在這裏錯過了什麼嗎?演示客戶端不是已經是Cordova項目嗎? – Neo 2014-11-03 07:13:45

+0

@Neo我遇到了同樣的錯誤...你是如何解決的?我們正在運行科爾多瓦4.0 CLI – 2014-11-06 08:39:29

4

我演示運行起來,做下一個步驟(安卓),與離子CLI:

# install global dependencies 
npm install -g cordova bower grunt-cli 

# Get a GIT clone, needed for copying files 
git clone https://github.com/alongubkin/phonertc.git 

# start new ionic project 
ionic create phonertc-ionic 
cd phonertc 

# Copy files from GIT clone to your ionic project 
cp -R phonertc-gitclone\demo\client\* phonertc-ionic\ 

# install dependencies 
npm install 
bower install 

# install plugins 
cordova plugin add org.apache.cordova.device 
cordova plugin add org.apache.cordova.console 
cordova plugin add https://github.com/alongubkin/phonertc.git 

# add android platform 
cordova platform add android 

# install/running signaling server 
cd phonertc-gitclone/demo/server 
npm install 
node index.js 

# setting up turn server (not sure if needed) 
# I installed it on a VirtualBox Ubuntu server, also see: 
# https://github.com/alongubkin/phonertc/wiki/Installation 
# Next ports should be open to your Ubuntu TURN server: 
# TCP 443 
# TCP 3478-3479 
# TCP 32355-65535 
# UDP 3478-3479 
# UDP 32355-65535 
sudo apt-get install rfc5766-turn-server 
# Edit /etc/turnserver.conf and change: 
listening-ip=<internal IP VirtualBox Ubuntu> 
relay-ip=<internal IP VirtualBox Ubuntu> 
external-ip=<internal IP VirtualBox Ubuntu> 
min-port=32355 
max-port=65535 
realm=<your domain> 
# Also uncomment 
lt-cred-mech 
fingerprint 
# Edit /etc/turnuserdb.conf and at the end, add: 
username:password 
# Start TURN server 
sudo /etc/init.d/rfc5766-turn-server start 

# before running the next command, make sure to 
# change your server details in demo/client/app/scripts/signaling.js 
# and in demo/client/app/scripts/CallCtrl.js 
cd phonertc-ionic/ 
grunt build --force 

# Copy files from phonertc-ionic app dir to www dir 
cp -R phonertc-ionic/app/* phonertc-ionic/www/ 

# Build and run to android 
ionic run android 

注:

填充phonertc離子和phonertc-gitclone迪爾斯與你。 此時我只能測試2個Android設備。目前聲音很糟糕,但視頻很棒。 試圖建立在IOS上。

+0

感謝您的指示,@Mark。幫了很多。 – Dhiraj 2014-11-08 19:20:23

+0

我得到一個啓動畫面,顯示Cordova徽標,然後是一個空白的屏幕,什麼也沒有顯示。 – Dois 2015-05-27 01:31:36

+0

好,所以問題是因爲我在瀏覽器上運行它。演示應用程序將只能使用手機進行通話。 – Dois 2015-05-27 06:21:10