webrtc/apprtc

Name: apprtc

Owner: WebRTC

Description: The video chat demo app based on WebRTC

Created: 2015-02-03 18:10:41.0

Updated: 2018-01-19 12:00:21.0

Pushed: 2018-01-10 13:46:46.0

Homepage: https://appr.tc

Size: 4213

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

AppRTC Demo Code

Development

Detailed information on developing in the webrtc github repo can be found in the WebRTC GitHub repo developer's guide.

The development AppRTC server can be accessed by visiting http://localhost:8080.

Running AppRTC locally requires Google App Engine SDK for Python, Node.js and Grunt.

Follow the instructions on Node.js website and on Grunt website to install them.

When Node.js and Grunt are available you can install the required dependencies running npm install from the project root folder.

Before you start the AppRTC dev server and everytime you update the source code you need to recompile the App Engine package by running grunt build.

Start the AppRTC dev server from the out/app_engine directory by running the Google App Engine SDK dev server,

h to sdk>/dev_appserver.py ./out/app_engine

Then navigate to http://localhost:8080 in your browser (given it's on the same machine).

Testing

You can run all tests by running grunt.

To run only the Python tests you can call,

t runPythonTests
Deployment

Instructions were performed on Ubuntu 14.04 using Python 2.7.6 and Go 1.6.3.

  1. Clone the AppRTC repository
  2. Do all the steps in the Collider instructions then continue on step 3.
  3. Install and start a Coturn TURN server according to the instructions on the project page.
  4. Open src/app_engine/constants.py and do the following:
Collider
TURN/STUN

8. Build AppRTC using grunt build then deploy/run:

9. Open a WebRTC enabled browser and navigate to http://localhost:8080 or https://[YOUR_VERSION_ID]-dot-[YOUR_PROJECT_ID] (append ?wstls=false to the URL if you have TLS disabled on Collider for dev/testing purposes).

Advanced Topics
Enabling Local Logging

Note that logging is automatically enabled when running on Google App Engine using an implicit service account.

By default, logging to a BigQuery from the development server is disabled. Log information is presented on the console. Unless you are modifying the analytics API you will not need to enable remote logging.

Logging to BigQuery when running LOCALLY requires a secrets.json containing Service Account credentials to a Google Developer project where BigQuery is enabled. DO NOT COMMIT secrets.json TO THE REPOSITORY.

To generate a secrets.json file in the Google Developers Console for your project:

  1. Go to the project page.
  2. Under APIs & auth select Credentials.
  3. Confirm a Service Account already exists or create it by selecting Create new Client ID.
  4. Select Generate new JSON key from the Service Account area to create and download JSON credentials.
  5. Rename the downloaded file to secrets.json and place in the directory containing analytics.py.

When the Analytics class detects that AppRTC is running locally, all data is logged to analytics table in the dev dataset. You can bootstrap the dev dataset by following the instructions in the Bootstrapping/Updating BigQuery.

BigQuery

When running on App Engine the Analytics class will log to analytics table in the prod dataset for whatever project is defined in app.yaml.

Schema

bigquery/analytics_schema.json contains the fields used in the BigQuery table. New fields can be added to the schema and the table updated. However, fields cannot be renamed or removed. Caution should be taken when updating the production table as reverting schema updates is difficult.

Update the BigQuery table from the schema by running,

pdate -t prod.analytics bigquery/analytics_schema.json
Bootstrapping

Initialize the required BigQuery datasets and tables with the following,

k prod
k -t prod.analytics bigquery/analytics_schema.json

[1] ICE Server provider AppRTC by default uses an ICE server provider to get TURN servers. Previously we used a compute engine on demand service (it created TURN server instances on demand in a region near the connecting users and stored them in shared memory) and web server with a REST API described in draft-uberti-rtcweb-turn-rest-00. This has now been replaced with a Google service. It's similar from an AppRTC perspective but with a different response format.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.