PhoneRTC演示应用程序
问题描述:
我试图让PhoneRTC演示启动并运行。 https://github.com/alongubkin/phonertc/PhoneRTC演示应用程序
我居然有一堆疑惑
首先,我的理解:1。 我们需要一个TURN服务器 2.我们需要(在回购演示/服务器)的信令服务器 3。我们需要一个cordova项目,它将使用phoneRTC项目(demo/client in repo)
启动AWS实例,分配一个动态DNS。 安装了TURN服务器并启动了它 - 但现在我对教程中提到的私有IP和公共IP部分感到困惑,因为每次重新启动实例时,我的IP都会更改。我有一个dns的名字(来自noip)将坚持下去。所以我探索如何与
我检查了源代码,并遵循故宫安装cordva等步骤,
设置TURN服务器信令服务器,我浏览到演示中/服务器源代码并在npm安装后尝试了node index.js,但发现有关未找到该模块的错误。
demo/client也是一个nodeJS项目,对吗?如果我启动并运行,那是视频聊天,对吧?
答
亚马逊提供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运行项目。
答
我演示运行起来,做下一个步骤(安卓),与离子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