what is

WebRTC

?

capture

capture

audio

capture

video

peer-to-peer

peer-to-peer

audio

peer-to-peer

video

peer-to-peer

data

plugin-free video calls

developers

no infrastructure needed *

users

no plugins

no third-party app accounts

A brief

history

of WebRTC

© Sony Pictures

10/2011

first draft of the spec

© Sony Pictures

02/2014

cross-browser
data transfers

© Sony Pictures

07/2014

Hangouts
uses (kind of) WebRTC
on Chrome 36+

© Sony Pictures

audio / video

conferencing

customer support

© Amazon

one-to-one

video calls

browser

to

browser

browser

to

phone

require "sinatra"
require "twilio-ruby"

get "/" do
  capability = Twilio::Util::Capability.new ENV["ACCOUNT_SID"], ENV["ACCOUNT_TOKEN"]
  capability.allow_client_outgoing ENV["APP_SID"]
  capability.allow_client_incoming "MEETJSSUMMIT2014"
  token = capability.generate
  erb :index, locals: {token: token}
end

post "/voice" do
  content_type "text/xml"

  "<Response>
    <Dial callerId=\"#{ENV['CALLER_PHONE_NUMBER']}\">
      <Number>#{params[:PhoneNumber]}</Number>
    </Dial>
  </Response>"
end

Twilio.Device.setup("<%= token %>", {debug: true});

function call() {
    var params = {"PhoneNumber": $("#number").val()};
    Twilio.Device.connect(params);
}

function hangup() {
    Twilio.Device.disconnectAll();
}

function anykey() {
    var conn = Twilio.Device.activeConnection();
    if (conn) conn.sendDigits("1");
}

browser

to

phone

phone

to

browser

image processing

motion detection

object tracking

face detection

augmented reality

audio processing

WebAudio API

can use and create

WebRTC media streams

measure volume

change pitch of your voice

mix and broadcast music

screensharing

live streaming

games

live streaming

presentations

data

low-latency networking

multiplayer games

file sharing

CDN augmentation

how does

WebRTC

work?

SDP Session Description Protocol

ICE Interactive Connectivity Establishment

STUN Session Traversal Utilities for NAT

TURN Traversal Using Relay NAT

RTP Real-time Transport Protocol

SCTP Stream Control Transmission Protocol

// Stir in the WebRTC object
var webrtc = new SimpleWebRTC({
  localVideoEl: 'localVideo',
  remoteVideosEl: 'remotesVideos',
  autoRequestMedia: true
});

// Join when ready
webrtc.on('readyToCall', function () {
  webrtc.joinRoom('your awesome room name');
});

// Send data
webrtc.sendDirectlyToAll('data channel name', 'label', message);

// Receive data
webrtc.on('channelMessage', function (peer, channelName, data) {
  // Handle message
  // data.type    -> label
  // data.payload -> message
});

browser support

1,700,000,000

devices by the end of 2014

© Sony Pictures

© Sony Pictures

thank you!

© Sony Pictures