SlideShare a Scribd company logo
Introduction to WebRTC
ART MATSAK, GRUVEO
JANUARY 2016
Imagine If…
• You could add HD video calling to your web app using simple
JavaScript APIs
• Your users could make calls right in the browser, no plugins
• Peer-to-peer
• Industry-standard end-to-end encryption for all calls
• Sending arbitrary data, too
Too good to be true?
© 2016 GRUVEO 2
Try It Right Now
1. Go to www.gruveo.com
2. Enter “test123” for the code
3. Hit “Video call”
4. Go to Gruveo on another
device or browser tab, and
do the same
5. Enjoy your conversation 
© 2016 GRUVEO 3
What Is WebRTC?
• Real-Time Communications for the Web
• A free, open project hosted at webrtc.org
• Provides RTC capabilities for browsers and
apps via simple APIs
• Idea born in the Google Chrome team in 2009
• Acquired On2 in 2010 and Global IP Solutions
(Gips) in 2011
• Gips technology open-sourced in mid-2011 to
give start to WebRTC
© 2016 GRUVEO 4
How Simple Is It?
Initialization of a WebRTC call in a nutshell:
var pc = new RTCPeerConnection();
navigator.getUserMedia({video: true}, function(stream) {
pc.addStream(stream);
pc.createOffer(function(offer) {
pc.setLocalDescription(new RTCSessionDescription(offer),
function() {
// Send the offer to a signaling server to be forwarded to the peer.
}, errorCb);
}, errorCb);
});
© 2016 GRUVEO 5
WebRTC Connection Diagram
signaling server
audio / video
STUN/TURN server
WebRTC signaling
NAT traversal
audio / video
(if relayed)
© 2016 GRUVEO 6
A Tale of Two APIs
• navigator.getUserMedia() (gUM)
• Prompts the user to use a video and/or audio device (camera,
screensharing, microphone…)
• Produces a MediaStream with one or more MediaStreamTrack’s
• RTCPeerConnection
• Represents a WebRTC peer-to-peer connection
• Handles bi-directional streaming of media as well as data
• Usually has one or more MediaStream’s attached
© 2016 GRUVEO 7
navigator.getUserMedia(): Accessing
User’s Media Devices
Example - prompt to use the camera and show its feed in a <video> element:
navigator.getUserMedia({ audio: true, video: { width: 1280, height: 720 } },
function(stream) {
var video = document.querySelector('video');
video.src = window.URL.createObjectURL(stream);
video.onloadedmetadata = function(e) {
video.play();
};
},
function(err) {
console.log("The following error occurred: " + err.name);
}
);
© 2016 GRUVEO 8
getUserMedia(): User Experience
• UX is different browser to browser
• HTTPS now required for cross-browser
compatibility!
Requires
HTTPS
Device selection
in dialog
Remembers
permissions
Chrome Yes No Yes
Firefox No Yes No
Opera No Yes HTTPS only
© 2016 GRUVEO 9
getUserMedia(): Constraints
• A MediaStreamConstraints object
• Specifies the types of media to request + any requirements for each type
• Examples:
{ audio: true, video: { width: 1280, height: 720 } }
{
audio: true,
video: { width: { min: 1024, ideal: 1280, max: 1920 },
height: { min: 776, ideal: 720, max: 1080 } }
}
{ audio: true, video: { facingMode: "user" } }
{ audio: true, video: false }
navigator.getUserMedia(constraints, successCb, errorCb)
© 2016 GRUVEO 10
getUserMedia(): Constraints – Screen
Sharing
• To enable screen sharing, user has to:
• Install an add-on for your service / domain (Chrome)
• White-list your domain in browser preferences (Firefox)
• Installation of a Chrome add-on only serves as an explicit
confirmation that the user allows screen sharing on your domain
• Then, screen sharing is as easy as passing this video constraint:
• { video: { mandatory: { chromeMediaSource: "screen" } } } // Chrome
• { video: { mediaSource: "screen" } } // Firefox
navigator.getUserMedia(constraints, successCb, errorCb)
© 2016 GRUVEO 11
getUserMedia(): Success Callback
• Called if user grants access to media device(s)
• Gets passed a MediaStream object containing one or more
MediaStreamTrack’s (audio / video)
• A MediaStream can be attached to a <video> or <audio>
element…
• ...or to an RTCPeerConnection object to be sent to the other
peer
navigator.getUserMedia(constraints, successCb, errorCb)
© 2016 GRUVEO 12
getUserMedia(): Error Callback
• Called if something went wrong, for example:
• User denied access to media devices
• Device (e.g. video camera) not found
• Attempting to call navigator.getUserMedia() on an HTTP page
(Chrome)
• Gets passed an object / string with more information about the
error
navigator.getUserMedia(constraints, successCb, errorCb)
© 2016 GRUVEO 13
RTCPeerConnection: P2P Connection
Between Clients
signaling server
audio / video
STUN/TURN server
WebRTC signaling
NAT traversal
audio / video
(if relayed)
© 2016 GRUVEO 14
RTCPeerConnection: Connection
Establishment, or “Offer-Answer Dance”
Create offer
Set description as local
Send description to callee Set description as remote
Create answer
Set description as local
Send description to callerSet description as remote
A’s session description
B’s session description
Peer A (caller) Peer B (callee)
A’s description
B’s description
© 2016 GRUVEO 15
RTCPeerConnection: Key Methods
• RTCPeerConnection(configuration, constraints) – constructor, returns a
new RTCPeerConnection object
• .addStream(mediaStream) – attaches a MediaStream as a local audio /
video source
• .createOffer(successCb, errorCb, constraints) – creates offer session
description that gets passed to successCb
• .createAnswer(successCb, errorCb, constraints) – creates answer
session description, passed to successCb
• .setLocalDescription(description, successCb, errorCb) – sets description
as local session description
• .setRemoteDescription(description, successCb, errorCb) – sets
description as remote session description
© 2016 GRUVEO 16
RTCPeerConnection: Session Description
Protocol (SDP)
• Used for negotiating session capabilities between peers
• Session description includes information about media streams,
media codecs and their parameters, and more
• Example of audio lines in a session description:
...
m=audio 54278 RTP/SAVPF 111 103 104 0 8 106 105 13 126
c=IN IP4 180.6.6.6
a=rtcp:54278 IN IP4 180.6.6.6
...
• Multi-line text format allows for mangling when necessary, e.g. to
prioritize one codec over another
© 2016 GRUVEO 17
RTCPeerConnection: Signaling
• How do peers exchange session descriptions etc. before the
P2P connection is established? – Via a signaling server!
• Signaling is intentionally left to implementation by WebRTC
• Any of these would work:
• Long polling
• WebSockets + Socket.IO
• Pigeon post, telegraph, UPS...
• Gruveo uses WebSockets + custom Node.js backend
© 2016 GRUVEO 18
Connection Diagram: Signaling
signaling server
audio / video
STUN/TURN server
WebRTC signaling
NAT traversal
audio / video
(if relayed)
© 2016 GRUVEO 19
RTCPeerConnection: ICE
• Your localhost IP is 127.0.0.1, internal IP may be 192.168.1.100 and
external IP may be 147.232.159.135
• ICE (Interactive Connectivity Establishment) allows for discovering
all those IPs to find a way for the remote peer to reach your host
• Requires STUN (Session Traversal Utilities for NAT) servers
• Think of it as WhatIsMyIP.com for WebRTC
• Good news: There are a lot of free public ones
• A list of STUN servers is passed to the RTCPeerConnection
constructor
© 2016 GRUVEO 20
RTCPeerConnection: ICE Contd.
• Applying local session description initiates ICE candidate gathering
• Think of ICE candidates as IP-port pairs whereby your host is reachable
• An ICE candidate line from a session description:
a=candidate:1853887674 1 udp 1845501695 46.2.2.2 36768 typ srflx raddr
192.168.0.197 rport 36768 generation 0
• Peers exchange ICE candidates via signaling:
pc.onicecandidate() fires
Send candidate to peer pc.addIceCandidate(candidate)
A’s ICE candidate
Peer A Peer B
ICE candidate
© 2016 GRUVEO 21
RTCPeerConnection: TURN
• What if a peer-to-peer connection cannot be established due to
blocked ports etc.?
• You’ll need a relay – WebRTC supports TURN (Traversal Using Relays
around NAT) protocol
• Things to consider when deploying TURN servers:
• Bandwidth charges (AWS is expensive! Azure is, too!)
• Minimizing latency – automatic choosing of a TURN server based on
latency or geographic distance from peers
• A list of TURN servers is also passed to the RTCPeerConnection
constructor
• TURN servers often serve as STUN, too, hence STUN/TURN server
© 2016 GRUVEO 22
Connection Diagram: STUN/TURN
signaling server
audio / video
STUN/TURN server
WebRTC signaling
NAT traversal
audio / video
(if relayed)
© 2016 GRUVEO 23
Not Only Media – WebRTC Data
Channels
• Enable exchange of arbitrary application data between peers
• Think WebSockets, but peer-to-peer
• Customizable delivery properties:
• Reliable or partially reliable delivery of sent messages
• In-order or out-of-order delivery of sent messages
• RTCDataChannel objects, created using
RTCPeerConnection.createDataChannel()
• Some exciting ideas and use cases out there – e.g. Peer5
© 2016 GRUVEO 24
The WebRTC Protocol Stack
• Peer-to-peer connection is established over UDP using ICE, STUN
and TURN
• We can live without a few lost frames; low latency is more important
• DTLS (Datagram Transport Layer Security) is used to secure all data
transfers between peers
• Unlike TLS, DTLS can be used over UDP
• Encryption is WebRTC’s mandatory feature
• SRTP (Secure Real-Time Protocol) is used to transport audio and
video streams
• SCTP (Stream Control Transport Protocol) is used to transport
application data
© 2016 GRUVEO 25
The WebRTC Protocol Stack Contd.
Network (IP)
ICE, STUN, TURN
Transport (UDP)
SRTP SCTP
Session (DTLS) – mandatory
RTCDataChannelRTCPeerConnection
© 2016 GRUVEO 26
Adapted from High Performance Browser Networking by Ilya Grigorik (O’Reilly, 2013)
WebRTC Media Codecs
• A WebRTC implementation can support any codecs for audio and video, but some
are Mandatory to Implement (MTI)
• For audio, those are Opus and G.711
• Opus is free, provides excellent quality at majority of bitrates
• G.711 is a “granddaddy” included for compatibility with legacy systems
• For video, VP8 and H.264 are MTI
• H.264 is the industry standard, hardware encoding and decoding well-supported on
mobile
• VP8 is free but with fewer hardware implementations
• Firefox supports both VP8 and H.264
• Chrome and Opera only support VP8 and now VP9, H.264 is underway
• Why does it matter?
• Software video encoding and decoding on mobile is a performance + battery life hit
© 2016 GRUVEO 27
Where Is WebRTC Supported Today?
• Chrome, Firefox and Opera on desktop
(Windows, Mac OS and Linux) + Android
• That’s right – video calling right from your
mobile browser!
• IE10, IE11 and Safari on desktop through a
plugin – Gruveo supports the Temasys one
• Microsoft Edge supports ORTC
• A standard related to WebRTC
• Interoperability with WebRTC is currently
limited (no video, other issues)
• No browser on iOS currently supports
WebRTC…
• …But you can bake WebRTC into a native app
on desktop, Android and iOS
Desktop Android iOS
Chrome ✔ ✔ ✘
Firefox ✔ ✔ ✘
Opera ✔ ✔ ✘
IE10/IE11 ✔* – –
Safari ✔* – ✘
Microsoft
Edge
✔** – –
Native apps ✔ ✔ ✔
* With a plugin
** ORTC
© 2016 GRUVEO 28
A Closer Look at Mobile
• A WebRTC web application will work in major
Android browsers out of the box
• Native is the only way on iOS. A few choices:
• Build webrtc.org code for iOS
• Not for the faint of heart but doable
• Support for h/w H.264 coding is still in the works
• OpenWebRTC from Ericsson Research
• Supports h/w H.264 coding
• Not as production ready?
• Third-party SDKs like EasyRTC, OpenTok etc.
• On Android, you can also go fully native or leverage
WebRTC in a WebView (v36+)
© 2016 GRUVEO 29
WebRTC – Real-Life Challenges
• Things change and break quickly. Some recent stuff:
• Chrome 47 broke getUserMedia() on HTTP pages in December 2015
• That same month, Firefox 43 stopped supporting an old format of
RTCPeerConnection constraints
• Things like this are everyday business in WebRTC Land
• Using a polyfill is a very good idea
• Gruveo uses a variation of adapter.js from Google
• testRTC is a promising service for monitoring your WebRTC
application for problems
© 2016 GRUVEO 30
How to Stay in the Loop
• webrtc.org – The Mothership
• www.w3.org/TR/webrtc/ – The RTCPeerConnection spec
• Google Chrome Developers channel on YouTube – Chrome’s
WebRTC team chimes in with updates here
• BlogGeek.me – All things WebRTC; trends and analysis
• webrtcHacks.com – Technical discussion around WebRTC
• www.webrtc-experiment.com – More WebRTC hacks and code
samples
© 2016 GRUVEO 31
What Will You Do with WebRTC?
The limit is only your imagination:
• Peer5 leverages data channels to provide a serverless P2P CDN
• Tellybean allows TV video calling with WebRTC
• Ziggeo does asynchronous video recording
• Talko powers powered group voice communications for teams
• Acquired by Microsoft / Skype in December 2015
• CrankWheel is one-click screen sharing for enterprises
• …And, of course, Gruveo – the world’s easiest video calls
© 2016 GRUVEO 32
Gruveo
• Agree on a code and talk
• No installs, no registration
• Works on all major platforms
• Launched in 2013, Flash-based
• Switched to WebRTC in 2014
• Got VC backing in 2015
• Exciting use cases in telehealth,
customer support, online tutoring…
© 2016 GRUVEO 33
We Are Hiring!
www.gruveo.com/jobs
Currently looking for:
• Web Developer (Frontend + Backend) – JavaScript, Node.js…
• Mobile Developer – iOS & Android
• Customer Development Specialist – Sales, Product Management
and/or Product Marketing background
© 2016 GRUVEO 34
Thank You
Questions?
Art Matsak
art@gruveo.com
© 2016 GRUVEO 35

More Related Content

What's hot

Advancing IoT Communication Security with TLS and DTLS v1.3
Advancing IoT Communication Security with TLS and DTLS v1.3Advancing IoT Communication Security with TLS and DTLS v1.3
Advancing IoT Communication Security with TLS and DTLS v1.3
Hannes Tschofenig
 
Introduction to VoIP using SIP
Introduction to VoIP using SIPIntroduction to VoIP using SIP
Introduction to VoIP using SIPKundan Singh
 
WCF
WCFWCF
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
Maarten Smeets
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
shwetank
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
Julien LaPointe
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
Naveen Kumar
 
OpenSSL
OpenSSLOpenSSL
OpenSSL
Timbal Mayank
 
MQTT Protocol: IOT Technology
MQTT Protocol: IOT TechnologyMQTT Protocol: IOT Technology
MQTT Protocol: IOT Technology
Shashank Kapoor
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
Te-Yen Liu
 
Switch configuration
Switch configurationSwitch configuration
Switch configurationMuuluu
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
Chien Cheng Wu
 
SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
Ghanshyam Patel
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
Jen Andre
 
Live Streaming Application Development
Live Streaming Application DevelopmentLive Streaming Application Development
Live Streaming Application Development
Marie Weaver
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network Analysis
Joel W. King
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of Things
Bryan Boyd
 
The Heartbleed Bug
The Heartbleed BugThe Heartbleed Bug
Access Network Evolution
Access Network Evolution Access Network Evolution
Access Network Evolution
Cisco Canada
 
PNETLab.pdf
PNETLab.pdfPNETLab.pdf
PNETLab.pdf
RigobertoZarate4
 

What's hot (20)

Advancing IoT Communication Security with TLS and DTLS v1.3
Advancing IoT Communication Security with TLS and DTLS v1.3Advancing IoT Communication Security with TLS and DTLS v1.3
Advancing IoT Communication Security with TLS and DTLS v1.3
 
Introduction to VoIP using SIP
Introduction to VoIP using SIPIntroduction to VoIP using SIP
Introduction to VoIP using SIP
 
WCF
WCFWCF
WCF
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 
Introduction to WebSockets Presentation
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
 
OpenSSL
OpenSSLOpenSSL
OpenSSL
 
MQTT Protocol: IOT Technology
MQTT Protocol: IOT TechnologyMQTT Protocol: IOT Technology
MQTT Protocol: IOT Technology
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Switch configuration
Switch configurationSwitch configuration
Switch configuration
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
 
SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
 
Live Streaming Application Development
Live Streaming Application DevelopmentLive Streaming Application Development
Live Streaming Application Development
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network Analysis
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of Things
 
The Heartbleed Bug
The Heartbleed BugThe Heartbleed Bug
The Heartbleed Bug
 
Access Network Evolution
Access Network Evolution Access Network Evolution
Access Network Evolution
 
PNETLab.pdf
PNETLab.pdfPNETLab.pdf
PNETLab.pdf
 

Viewers also liked

WebRTC in the Real World
WebRTC in the Real WorldWebRTC in the Real World
WebRTC in the Real World
Tsahi Levent-levi
 
Server-side WebRTC Infrastructure
Server-side WebRTC InfrastructureServer-side WebRTC Infrastructure
Server-side WebRTC Infrastructure
Dialogic Inc.
 
Python, WebRTC and You
Python, WebRTC and YouPython, WebRTC and You
Python, WebRTC and You
Saúl Ibarra Corretgé
 
Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
Tsahi Levent-levi
 
WebRTC Hacks: Lessons Learned
WebRTC Hacks: Lessons LearnedWebRTC Hacks: Lessons Learned
WebRTC Hacks: Lessons Learned
Chad Hart
 
WebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google FranceWebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google France
Arnaud BUDKIEWICZ
 
WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)
Victor Pascual Ávila
 
WebRTC for Mobile - Challenges and Solutions
WebRTC for Mobile - Challenges and SolutionsWebRTC for Mobile - Challenges and Solutions
WebRTC for Mobile - Challenges and Solutions
Amir Zmora
 
Software Agents for Internet of Things - at AINL 2014
Software Agents for Internet of Things - at AINL 2014Software Agents for Internet of Things - at AINL 2014
Software Agents for Internet of Things - at AINL 2014
Anton Kolonin
 
An Introduction to WebRTC
An Introduction to WebRTCAn Introduction to WebRTC
An Introduction to WebRTC
MinJae Kang
 
Software agents
Software agentsSoftware agents
Software agents
Aryan Rathore
 
Conception et développement d’un système d’alerte et notification d’une tou...
Conception et développement  d’un système d’alerte et notification  d’une tou...Conception et développement  d’un système d’alerte et notification  d’une tou...
Conception et développement d’un système d’alerte et notification d’une tou...
Bilel Khaled ☁
 
modèle de scoring pour la clientèle
modèle de scoring pour la clientèle modèle de scoring pour la clientèle
modèle de scoring pour la clientèle Oulaya CHOUAY
 
Credit scoring, l'octroi des cartes bancaires
Credit scoring, l'octroi des cartes bancairesCredit scoring, l'octroi des cartes bancaires
Credit scoring, l'octroi des cartes bancairesMarwen Allaguy
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascript
Michele Di Salvatore
 
A Practical Guide to WebRTC
A Practical Guide to WebRTCA Practical Guide to WebRTC
A Practical Guide to WebRTC
vline
 
WebRTC Session Establishment
WebRTC Session EstablishmentWebRTC Session Establishment
WebRTC Session Establishment
jdbaran
 
WebRTC and Telehealth
WebRTC and TelehealthWebRTC and Telehealth
WebRTC and Telehealth
Arin Sime
 
Software agents
Software agentsSoftware agents
Software agents
rajsandhu1989
 

Viewers also liked (20)

WebRTC
WebRTCWebRTC
WebRTC
 
WebRTC in the Real World
WebRTC in the Real WorldWebRTC in the Real World
WebRTC in the Real World
 
Server-side WebRTC Infrastructure
Server-side WebRTC InfrastructureServer-side WebRTC Infrastructure
Server-side WebRTC Infrastructure
 
Python, WebRTC and You
Python, WebRTC and YouPython, WebRTC and You
Python, WebRTC and You
 
Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
 
WebRTC Hacks: Lessons Learned
WebRTC Hacks: Lessons LearnedWebRTC Hacks: Lessons Learned
WebRTC Hacks: Lessons Learned
 
WebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google FranceWebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google France
 
WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)
 
WebRTC for Mobile - Challenges and Solutions
WebRTC for Mobile - Challenges and SolutionsWebRTC for Mobile - Challenges and Solutions
WebRTC for Mobile - Challenges and Solutions
 
Software Agents for Internet of Things - at AINL 2014
Software Agents for Internet of Things - at AINL 2014Software Agents for Internet of Things - at AINL 2014
Software Agents for Internet of Things - at AINL 2014
 
An Introduction to WebRTC
An Introduction to WebRTCAn Introduction to WebRTC
An Introduction to WebRTC
 
Software agents
Software agentsSoftware agents
Software agents
 
Conception et développement d’un système d’alerte et notification d’une tou...
Conception et développement  d’un système d’alerte et notification  d’une tou...Conception et développement  d’un système d’alerte et notification  d’une tou...
Conception et développement d’un système d’alerte et notification d’une tou...
 
modèle de scoring pour la clientèle
modèle de scoring pour la clientèle modèle de scoring pour la clientèle
modèle de scoring pour la clientèle
 
Credit scoring, l'octroi des cartes bancaires
Credit scoring, l'octroi des cartes bancairesCredit scoring, l'octroi des cartes bancaires
Credit scoring, l'octroi des cartes bancaires
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascript
 
A Practical Guide to WebRTC
A Practical Guide to WebRTCA Practical Guide to WebRTC
A Practical Guide to WebRTC
 
WebRTC Session Establishment
WebRTC Session EstablishmentWebRTC Session Establishment
WebRTC Session Establishment
 
WebRTC and Telehealth
WebRTC and TelehealthWebRTC and Telehealth
WebRTC and Telehealth
 
Software agents
Software agentsSoftware agents
Software agents
 

Similar to Introduction to WebRTC

WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
srinivasa teja
 
Getting Started with WebRTC
Getting Started with WebRTCGetting Started with WebRTC
Getting Started with WebRTC
Chad Hart
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
Giacomo Vacca
 
WebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the WebWebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the Web
Vũ Nguyễn
 
SkyViewer: An in-browser solution to fast video calling
SkyViewer: An in-browser solution to fast video callingSkyViewer: An in-browser solution to fast video calling
SkyViewer: An in-browser solution to fast video calling
Kaivalya Shah
 
WebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computationWebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computation
JooinK
 
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
Oliver N
 
Real Time Communication with WebRTC
Real Time Communication with WebRTCReal Time Communication with WebRTC
Real Time Communication with WebRTC
Suresh Balla
 
WebRTC - Is it ready? 2013
WebRTC - Is it ready? 2013WebRTC - Is it ready? 2013
WebRTC - Is it ready? 2013
Hank Huang
 
DevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSocketsDevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSockets
Crocodile WebRTC SDK and Cloud Signalling Network
 
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
Amir Zmora
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in Asterisk
Moises Silva
 
JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013
JooinK
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
Crocodile WebRTC SDK and Cloud Signalling Network
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
antonry
 
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTCKamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Crocodile WebRTC SDK and Cloud Signalling Network
 
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web WorldAsterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Crocodile WebRTC SDK and Cloud Signalling Network
 
WebRTC
WebRTCWebRTC
WebRTC
allanh0526
 
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
Amir Zmora
 

Similar to Introduction to WebRTC (20)

WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Getting Started with WebRTC
Getting Started with WebRTCGetting Started with WebRTC
Getting Started with WebRTC
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
 
WebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the WebWebRTC - Brings Real-Time to the Web
WebRTC - Brings Real-Time to the Web
 
WebRCT
WebRCTWebRCT
WebRCT
 
SkyViewer: An in-browser solution to fast video calling
SkyViewer: An in-browser solution to fast video callingSkyViewer: An in-browser solution to fast video calling
SkyViewer: An in-browser solution to fast video calling
 
WebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computationWebRTC ... GWT & in-browser computation
WebRTC ... GWT & in-browser computation
 
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012WebRTC: Bring real-time to the web - Barcamp Saigon 2012
WebRTC: Bring real-time to the web - Barcamp Saigon 2012
 
Real Time Communication with WebRTC
Real Time Communication with WebRTCReal Time Communication with WebRTC
Real Time Communication with WebRTC
 
WebRTC - Is it ready? 2013
WebRTC - Is it ready? 2013WebRTC - Is it ready? 2013
WebRTC - Is it ready? 2013
 
DevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSocketsDevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSockets
 
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
WebRTC Standards & Implementation Q&A - WebRTC Standards Feature Complete 
No...
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in Asterisk
 
JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013JooinK - DevFest Piemonte 2013
JooinK - DevFest Piemonte 2013
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
 
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTCKamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
 
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web WorldAsterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
 
WebRTC
WebRTCWebRTC
WebRTC
 
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
 

Recently uploaded

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 

Recently uploaded (20)

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 

Introduction to WebRTC

  • 1. Introduction to WebRTC ART MATSAK, GRUVEO JANUARY 2016
  • 2. Imagine If… • You could add HD video calling to your web app using simple JavaScript APIs • Your users could make calls right in the browser, no plugins • Peer-to-peer • Industry-standard end-to-end encryption for all calls • Sending arbitrary data, too Too good to be true? © 2016 GRUVEO 2
  • 3. Try It Right Now 1. Go to www.gruveo.com 2. Enter “test123” for the code 3. Hit “Video call” 4. Go to Gruveo on another device or browser tab, and do the same 5. Enjoy your conversation  © 2016 GRUVEO 3
  • 4. What Is WebRTC? • Real-Time Communications for the Web • A free, open project hosted at webrtc.org • Provides RTC capabilities for browsers and apps via simple APIs • Idea born in the Google Chrome team in 2009 • Acquired On2 in 2010 and Global IP Solutions (Gips) in 2011 • Gips technology open-sourced in mid-2011 to give start to WebRTC © 2016 GRUVEO 4
  • 5. How Simple Is It? Initialization of a WebRTC call in a nutshell: var pc = new RTCPeerConnection(); navigator.getUserMedia({video: true}, function(stream) { pc.addStream(stream); pc.createOffer(function(offer) { pc.setLocalDescription(new RTCSessionDescription(offer), function() { // Send the offer to a signaling server to be forwarded to the peer. }, errorCb); }, errorCb); }); © 2016 GRUVEO 5
  • 6. WebRTC Connection Diagram signaling server audio / video STUN/TURN server WebRTC signaling NAT traversal audio / video (if relayed) © 2016 GRUVEO 6
  • 7. A Tale of Two APIs • navigator.getUserMedia() (gUM) • Prompts the user to use a video and/or audio device (camera, screensharing, microphone…) • Produces a MediaStream with one or more MediaStreamTrack’s • RTCPeerConnection • Represents a WebRTC peer-to-peer connection • Handles bi-directional streaming of media as well as data • Usually has one or more MediaStream’s attached © 2016 GRUVEO 7
  • 8. navigator.getUserMedia(): Accessing User’s Media Devices Example - prompt to use the camera and show its feed in a <video> element: navigator.getUserMedia({ audio: true, video: { width: 1280, height: 720 } }, function(stream) { var video = document.querySelector('video'); video.src = window.URL.createObjectURL(stream); video.onloadedmetadata = function(e) { video.play(); }; }, function(err) { console.log("The following error occurred: " + err.name); } ); © 2016 GRUVEO 8
  • 9. getUserMedia(): User Experience • UX is different browser to browser • HTTPS now required for cross-browser compatibility! Requires HTTPS Device selection in dialog Remembers permissions Chrome Yes No Yes Firefox No Yes No Opera No Yes HTTPS only © 2016 GRUVEO 9
  • 10. getUserMedia(): Constraints • A MediaStreamConstraints object • Specifies the types of media to request + any requirements for each type • Examples: { audio: true, video: { width: 1280, height: 720 } } { audio: true, video: { width: { min: 1024, ideal: 1280, max: 1920 }, height: { min: 776, ideal: 720, max: 1080 } } } { audio: true, video: { facingMode: "user" } } { audio: true, video: false } navigator.getUserMedia(constraints, successCb, errorCb) © 2016 GRUVEO 10
  • 11. getUserMedia(): Constraints – Screen Sharing • To enable screen sharing, user has to: • Install an add-on for your service / domain (Chrome) • White-list your domain in browser preferences (Firefox) • Installation of a Chrome add-on only serves as an explicit confirmation that the user allows screen sharing on your domain • Then, screen sharing is as easy as passing this video constraint: • { video: { mandatory: { chromeMediaSource: "screen" } } } // Chrome • { video: { mediaSource: "screen" } } // Firefox navigator.getUserMedia(constraints, successCb, errorCb) © 2016 GRUVEO 11
  • 12. getUserMedia(): Success Callback • Called if user grants access to media device(s) • Gets passed a MediaStream object containing one or more MediaStreamTrack’s (audio / video) • A MediaStream can be attached to a <video> or <audio> element… • ...or to an RTCPeerConnection object to be sent to the other peer navigator.getUserMedia(constraints, successCb, errorCb) © 2016 GRUVEO 12
  • 13. getUserMedia(): Error Callback • Called if something went wrong, for example: • User denied access to media devices • Device (e.g. video camera) not found • Attempting to call navigator.getUserMedia() on an HTTP page (Chrome) • Gets passed an object / string with more information about the error navigator.getUserMedia(constraints, successCb, errorCb) © 2016 GRUVEO 13
  • 14. RTCPeerConnection: P2P Connection Between Clients signaling server audio / video STUN/TURN server WebRTC signaling NAT traversal audio / video (if relayed) © 2016 GRUVEO 14
  • 15. RTCPeerConnection: Connection Establishment, or “Offer-Answer Dance” Create offer Set description as local Send description to callee Set description as remote Create answer Set description as local Send description to callerSet description as remote A’s session description B’s session description Peer A (caller) Peer B (callee) A’s description B’s description © 2016 GRUVEO 15
  • 16. RTCPeerConnection: Key Methods • RTCPeerConnection(configuration, constraints) – constructor, returns a new RTCPeerConnection object • .addStream(mediaStream) – attaches a MediaStream as a local audio / video source • .createOffer(successCb, errorCb, constraints) – creates offer session description that gets passed to successCb • .createAnswer(successCb, errorCb, constraints) – creates answer session description, passed to successCb • .setLocalDescription(description, successCb, errorCb) – sets description as local session description • .setRemoteDescription(description, successCb, errorCb) – sets description as remote session description © 2016 GRUVEO 16
  • 17. RTCPeerConnection: Session Description Protocol (SDP) • Used for negotiating session capabilities between peers • Session description includes information about media streams, media codecs and their parameters, and more • Example of audio lines in a session description: ... m=audio 54278 RTP/SAVPF 111 103 104 0 8 106 105 13 126 c=IN IP4 180.6.6.6 a=rtcp:54278 IN IP4 180.6.6.6 ... • Multi-line text format allows for mangling when necessary, e.g. to prioritize one codec over another © 2016 GRUVEO 17
  • 18. RTCPeerConnection: Signaling • How do peers exchange session descriptions etc. before the P2P connection is established? – Via a signaling server! • Signaling is intentionally left to implementation by WebRTC • Any of these would work: • Long polling • WebSockets + Socket.IO • Pigeon post, telegraph, UPS... • Gruveo uses WebSockets + custom Node.js backend © 2016 GRUVEO 18
  • 19. Connection Diagram: Signaling signaling server audio / video STUN/TURN server WebRTC signaling NAT traversal audio / video (if relayed) © 2016 GRUVEO 19
  • 20. RTCPeerConnection: ICE • Your localhost IP is 127.0.0.1, internal IP may be 192.168.1.100 and external IP may be 147.232.159.135 • ICE (Interactive Connectivity Establishment) allows for discovering all those IPs to find a way for the remote peer to reach your host • Requires STUN (Session Traversal Utilities for NAT) servers • Think of it as WhatIsMyIP.com for WebRTC • Good news: There are a lot of free public ones • A list of STUN servers is passed to the RTCPeerConnection constructor © 2016 GRUVEO 20
  • 21. RTCPeerConnection: ICE Contd. • Applying local session description initiates ICE candidate gathering • Think of ICE candidates as IP-port pairs whereby your host is reachable • An ICE candidate line from a session description: a=candidate:1853887674 1 udp 1845501695 46.2.2.2 36768 typ srflx raddr 192.168.0.197 rport 36768 generation 0 • Peers exchange ICE candidates via signaling: pc.onicecandidate() fires Send candidate to peer pc.addIceCandidate(candidate) A’s ICE candidate Peer A Peer B ICE candidate © 2016 GRUVEO 21
  • 22. RTCPeerConnection: TURN • What if a peer-to-peer connection cannot be established due to blocked ports etc.? • You’ll need a relay – WebRTC supports TURN (Traversal Using Relays around NAT) protocol • Things to consider when deploying TURN servers: • Bandwidth charges (AWS is expensive! Azure is, too!) • Minimizing latency – automatic choosing of a TURN server based on latency or geographic distance from peers • A list of TURN servers is also passed to the RTCPeerConnection constructor • TURN servers often serve as STUN, too, hence STUN/TURN server © 2016 GRUVEO 22
  • 23. Connection Diagram: STUN/TURN signaling server audio / video STUN/TURN server WebRTC signaling NAT traversal audio / video (if relayed) © 2016 GRUVEO 23
  • 24. Not Only Media – WebRTC Data Channels • Enable exchange of arbitrary application data between peers • Think WebSockets, but peer-to-peer • Customizable delivery properties: • Reliable or partially reliable delivery of sent messages • In-order or out-of-order delivery of sent messages • RTCDataChannel objects, created using RTCPeerConnection.createDataChannel() • Some exciting ideas and use cases out there – e.g. Peer5 © 2016 GRUVEO 24
  • 25. The WebRTC Protocol Stack • Peer-to-peer connection is established over UDP using ICE, STUN and TURN • We can live without a few lost frames; low latency is more important • DTLS (Datagram Transport Layer Security) is used to secure all data transfers between peers • Unlike TLS, DTLS can be used over UDP • Encryption is WebRTC’s mandatory feature • SRTP (Secure Real-Time Protocol) is used to transport audio and video streams • SCTP (Stream Control Transport Protocol) is used to transport application data © 2016 GRUVEO 25
  • 26. The WebRTC Protocol Stack Contd. Network (IP) ICE, STUN, TURN Transport (UDP) SRTP SCTP Session (DTLS) – mandatory RTCDataChannelRTCPeerConnection © 2016 GRUVEO 26 Adapted from High Performance Browser Networking by Ilya Grigorik (O’Reilly, 2013)
  • 27. WebRTC Media Codecs • A WebRTC implementation can support any codecs for audio and video, but some are Mandatory to Implement (MTI) • For audio, those are Opus and G.711 • Opus is free, provides excellent quality at majority of bitrates • G.711 is a “granddaddy” included for compatibility with legacy systems • For video, VP8 and H.264 are MTI • H.264 is the industry standard, hardware encoding and decoding well-supported on mobile • VP8 is free but with fewer hardware implementations • Firefox supports both VP8 and H.264 • Chrome and Opera only support VP8 and now VP9, H.264 is underway • Why does it matter? • Software video encoding and decoding on mobile is a performance + battery life hit © 2016 GRUVEO 27
  • 28. Where Is WebRTC Supported Today? • Chrome, Firefox and Opera on desktop (Windows, Mac OS and Linux) + Android • That’s right – video calling right from your mobile browser! • IE10, IE11 and Safari on desktop through a plugin – Gruveo supports the Temasys one • Microsoft Edge supports ORTC • A standard related to WebRTC • Interoperability with WebRTC is currently limited (no video, other issues) • No browser on iOS currently supports WebRTC… • …But you can bake WebRTC into a native app on desktop, Android and iOS Desktop Android iOS Chrome ✔ ✔ ✘ Firefox ✔ ✔ ✘ Opera ✔ ✔ ✘ IE10/IE11 ✔* – – Safari ✔* – ✘ Microsoft Edge ✔** – – Native apps ✔ ✔ ✔ * With a plugin ** ORTC © 2016 GRUVEO 28
  • 29. A Closer Look at Mobile • A WebRTC web application will work in major Android browsers out of the box • Native is the only way on iOS. A few choices: • Build webrtc.org code for iOS • Not for the faint of heart but doable • Support for h/w H.264 coding is still in the works • OpenWebRTC from Ericsson Research • Supports h/w H.264 coding • Not as production ready? • Third-party SDKs like EasyRTC, OpenTok etc. • On Android, you can also go fully native or leverage WebRTC in a WebView (v36+) © 2016 GRUVEO 29
  • 30. WebRTC – Real-Life Challenges • Things change and break quickly. Some recent stuff: • Chrome 47 broke getUserMedia() on HTTP pages in December 2015 • That same month, Firefox 43 stopped supporting an old format of RTCPeerConnection constraints • Things like this are everyday business in WebRTC Land • Using a polyfill is a very good idea • Gruveo uses a variation of adapter.js from Google • testRTC is a promising service for monitoring your WebRTC application for problems © 2016 GRUVEO 30
  • 31. How to Stay in the Loop • webrtc.org – The Mothership • www.w3.org/TR/webrtc/ – The RTCPeerConnection spec • Google Chrome Developers channel on YouTube – Chrome’s WebRTC team chimes in with updates here • BlogGeek.me – All things WebRTC; trends and analysis • webrtcHacks.com – Technical discussion around WebRTC • www.webrtc-experiment.com – More WebRTC hacks and code samples © 2016 GRUVEO 31
  • 32. What Will You Do with WebRTC? The limit is only your imagination: • Peer5 leverages data channels to provide a serverless P2P CDN • Tellybean allows TV video calling with WebRTC • Ziggeo does asynchronous video recording • Talko powers powered group voice communications for teams • Acquired by Microsoft / Skype in December 2015 • CrankWheel is one-click screen sharing for enterprises • …And, of course, Gruveo – the world’s easiest video calls © 2016 GRUVEO 32
  • 33. Gruveo • Agree on a code and talk • No installs, no registration • Works on all major platforms • Launched in 2013, Flash-based • Switched to WebRTC in 2014 • Got VC backing in 2015 • Exciting use cases in telehealth, customer support, online tutoring… © 2016 GRUVEO 33
  • 34. We Are Hiring! www.gruveo.com/jobs Currently looking for: • Web Developer (Frontend + Backend) – JavaScript, Node.js… • Mobile Developer – iOS & Android • Customer Development Specialist – Sales, Product Management and/or Product Marketing background © 2016 GRUVEO 34