94
WebRTC for Everyone! Lisa Larson-Kelley @lisamarienyc LearnFromLisa.com

WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC for Everyone!Lisa Larson-Kelley

!

@lisamarienyc LearnFromLisa.com

Page 2: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as
Page 3: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

Oh, CRAP.

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 4: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

What is WebRTC?

How is a WebRTC app structured?

What’s the WebRTC API

look like?

Let’s build something!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 5: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 6: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: theen moy

bit.ly/webrtc-fc14

✓ Core programming

skills

✓ HTML, CSS and

JavaScript

✓ Your preferred HTML

editor

✓Webcam and

microphone

✓ Latest build of

Chrome or

Firefox

Page 7: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Let’s Go!

Page 8: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

What is WebRTC?

How is a WebRTC app structured?

What’s the WebRTC API

look like?

Let’s build something!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 9: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 11: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Show me!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 12: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

apprtc.appspot.com

https://apprtc.appspot.com/?r=01234567

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 13: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

talky.io

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 14: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

zingaya.com

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 15: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

peer5.com

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 16: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

cubeslam.com

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 17: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

chromeexperiments.com/detail/face-substitution/

VOLUNTEER!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 18: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Where did WebRTC come from?

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 19: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

§ VOIP technologies (UDP) § XMPP/ Jabber § (The “F” word)…

Before there was WebRTC, there was…

1.0 released in 2007

1.0 released in 2010

Page 20: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Video Conferencing for Everyone!

FAIL

Page 21: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Open Source is good.

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 22: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Where did WebRTC come from?

Page 23: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

IETF RTC WEB WG

W3C WebRTC WG

Where did WebRTC come from?

Page 24: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Google acquires the keys to the kingdom...

And opens the gates!bit.ly/webrtc-fc14 !

@lisamarienyc !#webrtc!

Page 25: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

A(nother) codec war

VS.

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 26: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

A(nother) codec war

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 27: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

A(nother) codec war

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 28: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC support across browsers

DESKTOP

MOBILE

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 29: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC support across browsers

http://isWebRTCReadyYet.com

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 30: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Getting Firefox and Chrome talking

adapter.js

Page 31: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Peace, and hope for standards

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 32: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The potential of WebRTC

1 billion +

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 33: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 34: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The Service Approach to Deploying WebRTC Apps

STUN TURN

Page 35: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The DIY Approach to Deploying WebRTC Apps

STUN TURN

Page 36: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

§PSTN Frameworks - Phono - Open source JavaScript phone API: - sipML5 - Open source JavaScript SIP client - FreeSWITCH - scalable open source cross-platform telephony platform

§ PeerJS § SimpleWebRTC § easyRTC § webRTC.io

§ RTC.io (node toolbox)

JavaScript Frameworks

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 37: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

§WebRTC services and platforms - Tokbox.com Open Tok platform - Vidyo.com - rtc.io - Xirsys.com hosted server infrastructure

§ Instant free video conferencing - apprtc.appspot.com - AddLive.com - Vline.com - Vsee.com (free and premium)

Some ready-to-use services

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 38: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

What is WebRTC?

How is a WebRTC app structured?

What’s the WebRTC API

look like?

Let’s build something!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 39: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Architecture of a WebRTC application

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 40: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Architecture of a WebRTC app

webpage [HTML / JS]

webpage [HTML / JS]

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 41: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC app, with signaling

webpage [HTML / JS]

signaling server

[HTTP or Websockets]

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 42: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC app, with signaling

webpage [HTML / JS]

signaling server

[HTTP or Websockets]

webpage [HTML / JS]

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 43: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

WebRTC app, with signaling

webpage [HTML / JS]

signaling server

[HTTP or Websockets]

webpage [HTML / JS]

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 44: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

signaling server

[HTTP or Websockets]

browser Y

browser Z

browser X

Multi-peer Topology: Full Mesh

Page 45: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The full WebRTC environment

Web Servers

PSTN Gateway

Jingle Client

Tablet

Mobile Phone

Phone

PSTN

Laptop PC

SIP Client

Other Servers

Source: WebRTC: APIs and RTCWEB Protocols of the HTML5 Real-Time Web

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 46: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Servers. Wait... servers?!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 47: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Why do we need servers with WebRTC?

I was promised peer-to-peer!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 48: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Why do we need servers with WebRTC?I was promised peer-to-peer!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 49: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

ICE STUN

TURN

Introducing STUN, TURN and ICE

Page 50: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

192.168.0.3 225.35.6.2.188

192.168.0.3 = 225.35.6.2.188

192.168.0.4 = 225.35.6.2.189

192.168.0.5 = 225.35.6.2.190

192.168.0.6 = 225.35.6.2.191

Respond to 192.168.0.3

Establishing Peer Connections: An Overview

Page 51: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

“Hey, what’s my external IP address?”

“My IP address is 41.19.4.1.255”

STUNYour external IP Address is

225.35.6.2.188

“My IP address is 225.35.6.2.188

Peer-to-Peer Connection

How STUN servers work

Page 52: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Peer-to-Peer Connection

How STUN servers work (sometimes…)

Page 53: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

How TURN works

TURN

Jane’s data Jane’s data

John’s dataJohn’s data

Page 54: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Interactive Connectivity Establishment (ICE)

STUN TURN

ICE

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 55: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

225.35.6.2.188

987.65.4.3.210

192.168.0.3

225.35.6.2.188

123.45.6.7.890

192.168.0.111

441.19.4.1.255

987.65.4.3.210

Local IP

External IP

Relay address

ICE Candidates

How ICE works

Page 56: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

But Wait...

Signalingbit.ly/webrtc-fc14 !

@lisamarienyc !#webrtc!

Page 57: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Hello, Signaling

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 58: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Signaling options

§HTTP POST §Google’s Channel API §XHR polling §Server-Sent Events §XMPP (Jabber) over WebSockets §SIP over WebSockets §JavaScript SIP Libraries (JsSIP, SIP-JS, SIPML5...) §WebSockets/JSON §Jingle (used by GoogleTalk) §Signalmaster (open source signaling server)

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 59: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Server-to-browser

Page 60: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Server-to-server

Page 61: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 62: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

GEEK JOKE BREAK

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 63: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

“I’d tell you a UDP joke…

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 64: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

“I’d tell you a UDP joke… but you probably wouldn’t get it.”

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 65: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

What is WebRTC?

How is a WebRTC app structured?

What’s the WebRTC API

look like?

Let’s build something!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 66: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Ladies and Gentlemen, The WebRTC APIs:

MediaStreamRTCPeerConnection

RTCDataChannel

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 67: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

MediaStream (getUserMedia)

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 68: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The MediaStream API

getUserMedia()

MediaElement

RTCPeerConnection

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 69: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

A MediaStream object

EVENTS .end .addtrack .endtrack

MediaStream

MediaStreamTrackchannel channel

ATTRIBUTES .id

STATES .readyState

EVENTS started ended muted unmuted overconstrained

ATTRIBUTES .id

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 70: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

http://localhost:8888/webrtc/fluent-demos/fc-webrtc-mediastream.html

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 71: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

RTCPeerConnection

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 72: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

RTCPeerConnection, under the hoodvia www.WebRTC.org

Overall architecture diagram from www.WebRTC.org

Page 73: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Set up signalling channel

Initiating a peer connection

Get local media

Set up peer connection

Attach media to

connection

Exchange session

descriptions

mediaStream API

RTCPeerConnection API

Overall architecture diagram from www.WebRTC.org

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 74: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

http://webrtchacks.com/sdp-anatomy/

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 75: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Instantiating a RTCPeerConnection object

myPeerConnection = new webkitRTCPeerConnection(config, constraints);

myPeerConnection = new webkitRTCPeerConnection(null);

var config = {"iceServers":[{"url":"stun:stun.1.google.com:19302"}, {"url":"stun:stun1.1.google.com:19302"}, {"url":"turn:198.76.543.2", "credential":"YourPasswordHere"}]};

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 76: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

localhost:8888/webrtc/fluent-demos/fc-webrtc-rtcpeerconnection.html

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 77: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

RTCDataChannel

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 78: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

<DATA>

RTCDataChannel

• Fast and efficient sharing of data • Great for:

• Multiplayer games • Text chat • Remote applications • File transfer

• Same API as WebSockets (basically) • Supports strings as well as some JS binary types such as Blob, ArrayBuffer

and ArrayBufferView • Datagram Transport Layer Security (DTLS) • Congestion control • Uses Stream Control Transmission Protocol (SCTP)

<DATA>

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 79: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

sharefest.me

File Sharing

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 80: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Distributed Content Delivery

peercdn.com

peer5.com

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 81: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

RTCDataChannel API

var datachannel = myPeerConnection.createDataChannel(label);

http://simpl.info/rtcdatachannel/

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 82: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Real-world deployment, for now...

WebSockets

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 83: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Real-world deployment, for now...

RTCDataChannel WebSockets

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 84: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Real-world deployment, for now...

RTCDataChannel

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 85: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

photo: nuvision action image - Spartan Race

What is WebRTC?

How is a WebRTC app structured?

What’s the WebRTC API

look like?

Let’s build something!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 86: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Ok, now for a functional app!

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 87: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

SimpleWebRTC

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 88: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Want to learn more?

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 89: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Resources § http://www.html5rocks.com/en/tutorials/webrtc/basics/ § Simplest possible getUserMedia demo: http://simpl.info/gum § RTCPeerConnection 'on one page', i.e. without signalling:

http://simpl.info/pc § Simplest possible RTCDataChannel example:

http://simpl.info/dc § With RTCPeerConnection: http://simpl.info/screencapture § GetUserMedia Constraints:

http://simpl.info/getusermedia/constraints § WebRTC video chat: apprtc.appspot.com (with source code) § webrtc-experiment.com - Muaz Khan § Codelab using Socket.IO for signaling:

http://bitbucket.org/webrtc/codelab § Capturing audio and video in HTML5:

http://html5rocks.com/en/tutorials/getusermedia/intro § APIs and RTCWEB Protocols of the HTML5 Real-Time Web,

Alan Johnston and Daniel Burnett. http://webrtcbook.com

http://bit.ly/lisa-rtc

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 90: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

“WebRTC is a new front in the long war for an open and unencumbered web.”

– Brendan Eich, Mozilla CTO and inventor of JavaScript

Page 91: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

The Potential of WebRTC

6.2 billion by 2018

Financial ServicesHealthcare Insurance

Page 92: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

“What’s the biggest barrier to WebRTC adoption?”

Source: WebRTC World Outlook 2014 Survey

Page 93: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

bit.ly/webrtc-fc14 !@lisamarienyc !

#webrtc!

Page 94: WebRTC for Everyone! - LearnFromLisa.comlearnfromlisa.com/.../Fluent2014_LisaLarsonKelley_WebRTC.pdf ·  · 2016-05-03• Supports strings as well as some JS binary types such as

Welcome to the new frontier of real-time communication on the web!

@lisamarienyc | LearnFromLisa.com bit.ly/learnwebrtc bit.ly/webrtc-fc14 !

@lisamarienyc !#webrtc!