我演示運行起來,做下一個步驟(安卓),與離子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上。
在相同的ip上運行2個設備是否會導致TURN問題? – sbaaaang 2014-10-19 08:45:48
當我從'demo/client'運行'cordova plugin add org.apache.cordova.device'時,我看到'當前工作目錄不是基於Cordova的項目.'。我在這裏錯過了什麼嗎?演示客戶端不是已經是Cordova項目嗎? – Neo 2014-11-03 07:13:45
@Neo我遇到了同樣的錯誤...你是如何解決的?我們正在運行科爾多瓦4.0 CLI – 2014-11-06 08:39:29