Home

Awesome

rtc

This is a package that will provide you a "one-stop shop" for building WebRTC applications. It aggregates together a variety of packages (primarily from the rtc.io suite) to deliver a single package for building a WebRTC application.

NPM

Build Status unstable bitHound Score Gitter chat

Getting Started

Probably the easiest way to get started with RTC is to take it for a testdrive using jsbin. This demo uses the minified JS file (and associated sourcemaps for debugging) from:

//cdn.jsdelivr.net/rtc/latest/rtc.min.js

If you wish to use a specific version, then you can replace latest with the version number (from 3.0.1 onwards):

//cdn.jsdelivr.net/rtc/3.2.3/rtc.min.js

Package Managers FTW!

I'd recommend using a package manager if you aren't already and here are the relevant instructions for installing RTC from a number of popular options:

Basic Usage

Establish a connection and render local and remote video feeds.

<html>
<head>
<title>rtc.io simple conferencing</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">
<link rel="stylesheet" href="layout.css">
</head>
<body onload="RTC()" class="pure-g">
    <div class="pure-u-1-5">
        <div id="l-video"></div>
    </div>
    <div class="pure-u-4-5" id="r-video"></div>
<script src="https://cdn.jsdelivr.net/rtc/latest/rtc.min.js"></script>
</body>
</html>

In this example, the default configuration options are used for configuration, which are displayed below for informational purposes:

// a default configuration that is used by the rtc package
module.exports = {
  // simple constraints for defaults
  constraints: {
    video: true,
    audio: true
  },

  // use the public switchboard for signalling
  signaller: 'https://switchboard.rtc.io',

  // no room is defined by default
  // rtc-quickconnect will autogenerate using a location.hash
  room: undefined,

  // specify ice servers or a generator function to create ice servers
  ice: [],

  // any data channels that we want to create for the conference
  // by default a chat channel is created, but other channels can be added also
  // additionally options can be supplied to customize the data channel config
  // see: <http://w3c.github.io/webrtc-pc/#idl-def-RTCDataChannelInit>
  channels: {
    chat: true
  },

  // the selector that will be used to identify the localvideo container
  localContainer: '#l-video',

  // the selector that will be used to identify the remotevideo container
  remoteContainer: '#r-video',

  // should we atempt to load any plugins?
  plugins: [],

  // common options overrides that are used across rtc.io packages
  options: {}
};

Diving Deeper

If there is a specific application that you are looking to build with rtc.io feel free to open an issue and outline a few of your requirements (video, audio, data, etc) and we can give you some advice. In most cases, the following is a good rule of thumb for working our where you should jump in with rtc.io packages.

Other Simple Demos / Tutorials

License(s)

Apache 2.0

Copyright 2014-2015 National ICT Australia Limited (NICTA)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.