我启动并运行了演示,使用 ionic CLI 执行后续步骤(Android):
# 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-ionic 和 phonertc-gitclone 目录。目前我只能在 2 台 Android 设备之间进行测试。目前声音很糟糕,但视频很棒。现在正在尝试在 IOS 上构建。