【问题标题】:PhoneRTC demo applicationPhoneRTC 演示应用程序
【发布时间】:2014-12-12 04:54:34
【问题描述】:

我正在尝试启动和运行 PhoneRTC 演示。 https://github.com/alongubkin/phonertc/

其实我有很多疑惑

首先,我的理解: 1.我们需要一个TURN服务器 2. 我们需要一个信令服务器(demo/server in repo) 3. 我们需要一个使用phoneRTC项目的cordova项目(demo/client in repo)

  1. 已启动 AWS 实例,分配了动态 DNS。 安装 TURN 服务器并启动它 - 但现在我对教程中提到的私有 ip 和公共 ip 部分感到困惑,因为每次我重新启动实例时我的 ip 都会发生变化。我有一个 dns 名称(来自 noip),它会坚持下去。所以我正在探索如何设置 TURN 服务器

  2. 我查看了源代码并按照 npm install cordva 等步骤操作,

  3. 对于 Signaling 服务器,我在源代码中导航到 demo/server,并在 npm install 后尝试了 node index.js,但出现了几个关于找不到模块的错误。

  4. demo/client 也是一个 nodeJS 项目,对吧?如果我启动并运行它,那就是视频聊天,对吗?

【问题讨论】:

    标签: node.js cordova phonertc


    【解决方案1】:

    亚马逊提供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 运行项目。

    【讨论】:

    • 在同一 IP 上运行 2 台设备会导致 TURN 出现问题吗?
    • 当我从demo/client 运行cordova plugin add org.apache.cordova.device 时,我看到Current working directory is not a Cordova-based project.。我在这里错过了什么吗?演示客户端不是已经是Cordova 项目了吗?
    • @Neo 我遇到了同样的错误……你是怎么解决的?我们正在运行 Cordova 4.0 CLI
    • 我实际上遇到了同样的问题,由于时间不多了,我暂时转到了 weemo/sightcall,即使它是付费的。但我对使用 phonertc 来满足我的需求非常感兴趣。
    • @neo 我通过在cordova plugin add 之前运行一次grunt cordova 解决了这个问题
    【解决方案2】:

    我使用 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 上构建。

    【讨论】:

    • 我得到一个显示 Cordova 徽标的初始屏幕,然后是一个空白屏幕,什么也没有显示。
    • 好的,问题是因为我在浏览器上运行它。演示应用只能在电话到电话的情况下使用。
    猜你喜欢
    • 2015-05-14
    • 2015-01-21
    • 2011-05-30
    • 1970-01-01
    • 2011-08-28
    • 1970-01-01
    • 2011-11-07
    • 2013-03-30
    • 1970-01-01
    相关资源
    最近更新 更多