WebRTC Overview

20
Communication with WebRTC Arin Sime, WebRTC.ventures

Transcript of WebRTC Overview

Page 1: WebRTC Overview

Communication with WebRTC

Arin Sime, WebRTC.ventures

Page 2: WebRTC Overview

WebRTC is an HTML5 “standard” for video communications in the browser

Look Mom! No plugins!

I know honey, it’s

like Skype for your

browser!

Page 3: WebRTC Overview

Core WebRTC Architecture

Page 4: WebRTC Overview

GetUserMedia javascript

Page 5: WebRTC Overview

Applications of WebRTC

• Video conferencing• Contact Centers• Telemedicine• Insurance claims• In-context

communications• Dating/Social Media• Gaming• P2P Data Transfer

Page 6: WebRTC Overview

Positives of WebRTC

• No plugins• Peer to Peer• Video, Audio, Data all

encrypted in transit

Page 7: WebRTC Overview

Security in WebRTC• Video/Audio/Data

encrypted in-transit• Permissions required for

Video/Audio• Under SSL, those

permissions are only required once

• The DataChannel alone does not require permissions

• Screen sharing requires a browser plugin

Page 8: WebRTC Overview

Negatives of WebRTC

• IE/Safari Not supported • Mobile browser support

is poor, need native apps

• Doesn’t scale to large conversations

Page 9: WebRTC Overview

Scaling WebRTC is hard

• Your server won’t be burdened, signaling traffic is lightweight

• But the peers and network will be burdened as a conversation grows

• Practical limit is 6-8 people

Page 10: WebRTC Overview

1st Demo – Taking a Profile Picturenavigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;

navigator.getUserMedia({'audio': false,'video': true}, function (stream) {console.log("going to display my stream...");smallVideoArea.src = URL.createObjectURL(stream);}, logError);

https://github.com/agilityfeat/getusermedia-profilepicture

Page 11: WebRTC Overview

Signaling to Connect Peers

• Signaling is done over your web server

• The transport layer is defined by you: WebSockets or Pub/Sub are most popular

• It is not encrypted or secure by default

Page 12: WebRTC Overview

Connecting Alice and Bob

Alice Bob

“Offer” “Answer”

Websockets, socket.io,

Publish/Subscribe, commercial providers,

etc

Session Description

Protocol (SDP):Video codecsResolution

Format

Page 13: WebRTC Overview

Using STUN/TURN ServersSTUNServer

Signaling Server

Get public IP

Alice’s Offer (Session Description Protocol)

Bob’s Answer SDP

Get public IP

Alice’s ICE Candidate (Internet Connectivity Establishment)

Bob’s ICE Candidate

RTCPeerConnection

Page 14: WebRTC Overview

2nd Demo – Two Party Chatnavigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;

navigator.getUserMedia({'audio': false,'video': true}, function (stream) {console.log("going to display my stream...");smallVideoArea.src = URL.createObjectURL(stream);rtcPeerConn.addStream(stream);}, logError);

https://github.com/agilityfeat/webrtc-sample-medical-app

Page 15: WebRTC Overview

The Data Channel

Page 16: WebRTC Overview

Two types of data channels

• Reliable A little slower, but guaranteed delivery and order options = { ordered: true };

• Unreliable Faster, but no guaranteed delivery or ordering options = { ordered: false };

Page 17: WebRTC Overview

Data Channel Use Cases

• Text Chat• File Transfer• Real-time data

communications for Sensors, Data Dashboards, etc

• Gaming• Content Delivery

Netwoks

Page 18: WebRTC Overview

Peer to peer file sharing

World-wide Content Delivery Network (CDN) for static content with Peer to Peer (P2P) augmentation of static content from local peers

User A

User B

User C

User D

Asia CDN

Americas CDN

P2P sharing when possibleP2P sharing

when possible

Page 19: WebRTC Overview

3rd Demo – Data Channel

sendMessage.addEventListener('click', function(ev){dataChannel.send(myMessage.value);appendChatMessage(myMessage.value, 'message-

in');myMessage.value = "";ev.preventDefault();

}, false);

https://github.com/agilityfeat/memory-webrtc-data-channel

Page 20: WebRTC Overview

Questions?

@ArinSime, [email protected], 434 996 5226