97
What is WebRTC? What can I do with it? Dan Jenkins Founder of Nimble Ape Ltd Developer at Respoke 1

What is WebRTC? What can I do with it?

Embed Size (px)

Citation preview

Page 1: What is WebRTC? What can I do with it?

What is WebRTC?What can I do with it?

Dan JenkinsFounder of Nimble Ape Ltd Developer at Respoke

1

Page 2: What is WebRTC? What can I do with it?

Who am I?

2

Page 3: What is WebRTC? What can I do with it?

/ Who am I?

Dan JenkinsNode.js Developer

Love Lego & TechnicGeneral Geek

Founder of Nimble Ape Ltd

❤️ open source

3

Page 4: What is WebRTC? What can I do with it?

/ Who am I?

github.com/danjenkins4

Page 5: What is WebRTC? What can I do with it?

/ Who am I?

@dan_jenkins5

Page 6: What is WebRTC? What can I do with it?

/ Who am I?

nimblea.pe | @nimbleapeltd6

Page 7: What is WebRTC? What can I do with it?

/

7

Who am I?

Page 8: What is WebRTC? What can I do with it?

/ Who am I?

Got into VoIP years agoVoIP is difficult

Spent the past year working on a platform called RespokeRespoke makes WebRTC easier

8

WebRTC & I

Page 9: What is WebRTC? What can I do with it?

WebRTC

9

Page 10: What is WebRTC? What can I do with it?

/ WebRTC

10

Who’s heard of WebRTC?

Page 11: What is WebRTC? What can I do with it?

/ WebRTC

Who’s developed something with WebRTC?

11

Page 12: What is WebRTC? What can I do with it?

/ WebRTC

12

Who’s used WebRTC?

Page 13: What is WebRTC? What can I do with it?

/ WebRTC

13

Talky.io

Appear.inScreenhero

Hangouts

Page 14: What is WebRTC? What can I do with it?

/ WebRTC

14

Sharefest Amazon Mayday PeerCDN

Page 15: What is WebRTC? What can I do with it?

/ WebRTC

15

Enabled on over 6.2 Billion Devices By 2018

Page 16: What is WebRTC? What can I do with it?

What is WebRTC?

16

Page 17: What is WebRTC? What can I do with it?

/ What is WebRTC?

17

Web Real Time Communication

Page 18: What is WebRTC? What can I do with it?

/ What is WebRTC?

18

Disrupt!

Page 19: What is WebRTC? What can I do with it?

/ What is WebRTC?

19

It’s a technology!

Page 20: What is WebRTC? What can I do with it?

/ What is WebRTC?

20

It’s classed as “Experimental”

Page 21: What is WebRTC? What can I do with it?

/ What is WebRTC?

21

It’s encrypted

Page 22: What is WebRTC? What can I do with it?

/ What is WebRTC?

22

Defined by W3C & IETF, just like HTTP

Page 23: What is WebRTC? What can I do with it?

/ What is WebRTC?

“WebRTC (Web Real-Time Communication) is an API definition drafted by the World Wide Web Consortium (W3C) that supports

browser-to-browser applications for voice calling, video chat, and P2P file sharing without the need of either internal or external plugins.”

23

According to wikipedia:

Page 24: What is WebRTC? What can I do with it?

OK, but what is it?

24

Page 25: What is WebRTC? What can I do with it?

/ Ok, but what is it?

25

Enables Video, Audio and Data Sharing in your browser, peer to peer, with no plugins

Page 26: What is WebRTC? What can I do with it?

/ Ok, but what is it?

26

What?! Wait! Too many words!

Page 27: What is WebRTC? What can I do with it?

/ Ok, but what is it?

27

Video

Page 28: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Video

28

A browser friendly camera…

Page 29: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Video

But you need a “plugin” for this… shhh! Don’t tell anyone… It’s for security

29

Your screen…

Page 30: What is WebRTC? What can I do with it?

/ Ok, but what is it?

30

Audio

Page 31: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Audio

31

A Mic

Page 32: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Audio

Audio APIs

32

An audio stream from an in browser source

Page 33: What is WebRTC? What can I do with it?

Data Sharing

33

Page 34: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Data Sharing

34

This can be pretty much anything…

Page 35: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Data Sharing

35

An image from canvas…

Page 36: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Data Sharing

36

A file

Page 37: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Data Sharing

37

Web-torrents

Page 38: What is WebRTC? What can I do with it?

/ Ok, but what is it? / Data Sharing

38

Anything!

Page 39: What is WebRTC? What can I do with it?

Peer to Peer

39

Page 40: What is WebRTC? What can I do with it?

/ Peer to Peer

40

2 peers

Page 41: What is WebRTC? What can I do with it?

/ Peer to Peer

41

3 peers

Page 42: What is WebRTC? What can I do with it?

/ Peer to Peer

42

*n peers

Page 43: What is WebRTC? What can I do with it?

/ Peer to Peer

43

Peers don’t have to be browsers!

Page 44: What is WebRTC? What can I do with it?

/ Peer to Peer

44

But we’ve had peer to peer technology before,

what’s different?

Page 45: What is WebRTC? What can I do with it?

/ Peer to Peer

Direct in your modern browser/app!

45

No plugins!

Page 46: What is WebRTC? What can I do with it?

Awesome! So it’s easy to implement?

46

Page 47: What is WebRTC? What can I do with it?

/ Awesome!

It’s primarily a web technologyaimed at web developers

47

Page 48: What is WebRTC? What can I do with it?

/ Awesome!

But unfortunately it’s not simple to implement

48

Page 49: What is WebRTC? What can I do with it?

/ Awesome!

You’ll need a signalling server

49

Page 50: What is WebRTC? What can I do with it?

/ Awesome! / Signalling

And signalling isn’t a standard

50

Page 51: What is WebRTC? What can I do with it?

/ Awesome! / Signalling

It might not be very real time though…

51

You could use carrier pigeons!

Page 52: What is WebRTC? What can I do with it?

/ Awesome! / Signalling

But seriously, there are open source ones…

52

Page 53: What is WebRTC? What can I do with it?

/ Awesome! / Signalling

And many providers!

53

Page 54: What is WebRTC? What can I do with it?

/ Awesome!

They’re evolving all the time… and they’re all different…

54

Browser APIs

Page 55: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

There’s a few to choose from…

55

Adapter.js

Page 56: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

They normalise the browsers

56

Page 57: What is WebRTC? What can I do with it?

/var RTCPeerConnection = null; var getUserMedia = null; var attachMediaStream = null; var reattachMediaStream = null; var webrtcDetectedBrowser = null;

function trace(text) { // This function is used for logging. if (text[text.length - 1] == '\n') { text = text.substring(0, text.length - 1); } console.log((performance.now() / 1000).toFixed(3) + ": " + text); }

if (navigator.mozGetUserMedia) { console.log("This appears to be Firefox");

webrtcDetectedBrowser = "firefox";

// The RTCPeerConnection object. RTCPeerConnection = mozRTCPeerConnection;

// The RTCSessionDescription object. RTCSessionDescription = mozRTCSessionDescription;

// The RTCIceCandidate object. RTCIceCandidate = mozRTCIceCandidate;

// Get UserMedia (only difference is the prefix). // Code from Adam Barth. getUserMedia = navigator.mozGetUserMedia.bind(navigator);

// Attach a media stream to an element. attachMediaStream = function(element, stream) { console.log("Attaching media stream"); element.mozSrcObject = stream; element.play(); };

reattachMediaStream = function(to, from) { console.log("Reattaching media stream"); to.mozSrcObject = from.mozSrcObject; to.play(); };

Awesome! / Browser APIs

Google has one

57

Page 58: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

Plus many others…

58

Page 59: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

getUserMediaRTCPeerConnection

RTCDataChannel59

Page 60: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

Used to ask your user whether the website can use your media, among other things

60

getUserMedia

Page 61: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

Handles the underlying technology

to stream media between 2 peers

61

RTCPeerConnection

Page 62: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

Transfer arbitrary data between peers.This is what’s really exciting about WebRTC.It makes WebRTC use cases expand infinitely

62

RTCDataChannel

Page 63: What is WebRTC? What can I do with it?

/ Awesome! / Browser APIs

63

(1) getUserMedia(2) send offer

(3) receive Offer(4) getUserMedia(5) send answer(5) receive answer

(6) media starts streaming

A Simple Diagram…

Page 64: What is WebRTC? What can I do with it?

But what about firewalls?

64

Page 65: What is WebRTC? What can I do with it?

/ Firewalls

Built in mechanisms to help

65

Page 66: What is WebRTC? What can I do with it?

/ Firewalls

A method to go off to a server and get your IP as seen by the world

66

STUN

Page 67: What is WebRTC? What can I do with it?

/ Firewalls

A server to relay your media through, if a peer to peer connection can’t be established

Generally, you need to run one (or more) of these yourself to get good quality

67

TURN

Page 68: What is WebRTC? What can I do with it?

OK, I get it…Where can I use it?

68

Page 69: What is WebRTC? What can I do with it?

/ Where can I use it?

69

Page 70: What is WebRTC? What can I do with it?

/ Where can I use it?

70

Page 71: What is WebRTC? What can I do with it?

/ Where can I use it?

PeerConnection API ✔ ✔ ✔ ✔ ✗ ✗ ✔ORTC API ✗ ✗ ✗ ✗ ✗ ✗getUserMedia ✔ ✔ ✔ ✔ ✗ ✔simulcast ✔ ✗ ✗ ✗ ✗ ✗mediaConstraints ✗ ✗ ✗TURN support ✔ ✔ ✔ ✔ ✗ ✗ ✔MediaStream API ✔ ✔ ✗ ✗ ✔WebAudio Integration ✔ ✔ ✔ ✔ ✗ ✗ ✔dataChannels ✔ ✔ ✔ ✔ ✗ ✗ ✔Screen Sharing ✗ ✗ ✗ ✗Stream re-broadcasting ✗ ✗ ✗ ✗ ✗Multiple Streams ✔ ✔ ✗ ✗ ✗ ✗ ✔Solid Interop ✗ ✗Echo cancellation ✔ ✔ ✗ ✗

It’s complicated

71

Page 72: What is WebRTC? What can I do with it?

/ Where can I use it?

With a plugin…

72

LOL…

Page 73: What is WebRTC? What can I do with it?

What can I do with it?

73

Page 74: What is WebRTC? What can I do with it?

/ What can I do with it?

Easy answer,use your imagination

74

Page 75: What is WebRTC? What can I do with it?

/ What can I do with it?

Customer Support

75

Page 76: What is WebRTC? What can I do with it?

/ What can I do with it?

Enable easier remote working in Contact Centres

76

Page 77: What is WebRTC? What can I do with it?

/ What can I do with it?

Peer to Peer data transfers in games

77

Page 78: What is WebRTC? What can I do with it?

/ What can I do with it?

Sales

78

Look at products in real time

Page 79: What is WebRTC? What can I do with it?

/ What can I do with it?

And many, many more, you just need imagination

79

Page 80: What is WebRTC? What can I do with it?

/ What can I do with it?

None of these ideas are newBut they’re being enabled by the open standard

They’ve also got a higher possibility of success as it’s now cheaper to run the service

80

Page 81: What is WebRTC? What can I do with it?

Security Concerns?

81

Page 82: What is WebRTC? What can I do with it?

/ Security Concerns?

Of course there are!

82

Page 83: What is WebRTC? What can I do with it?

/

https://www.browserleaks.com/webrtc

Security Concerns?

You can obtain a user’s real IP using WebRTC technology

83

Page 84: What is WebRTC? What can I do with it?

/ Security Concerns?

Without the user ever knowing

84

You can transfer ∞ data

Page 85: What is WebRTC? What can I do with it?

Things I haven’t even talked about…

85

Page 86: What is WebRTC? What can I do with it?

/ Not talked about

ICE Candidates

86

Page 87: What is WebRTC? What can I do with it?

/ Not talked about

Including Mesh, SFUs and MCUs

87

Network layouts

Page 88: What is WebRTC? What can I do with it?

/ Not talked about

Encryption

88

Page 89: What is WebRTC? What can I do with it?

/ Not talked about

using canvas for example

89

Playing with the streams in your browser

Page 90: What is WebRTC? What can I do with it?

/ Not talked about / Canvas

90

Page 91: What is WebRTC? What can I do with it?

/ Not talked about

91

CodecsOpus, G.711, G.722, iLBC, and iSAC

VP8 and H264

Page 92: What is WebRTC? What can I do with it?

/ Not talked about

And probably a whole lot more…

92

Page 93: What is WebRTC? What can I do with it?

/ Not talked about

It’s a complex topic

93

Page 94: What is WebRTC? What can I do with it?

/ Not talked about

But it’s not as complicated as VoIPEveryone can get into it

94

Page 95: What is WebRTC? What can I do with it?

Want to get started with WebRTC without having to

deal with signalling and browser differences?

95

Page 96: What is WebRTC? What can I do with it?

/ Getting started

96

Check out Respoke, it’s free!www.respoke.io

Page 97: What is WebRTC? What can I do with it?

Thanks!Dan Jenkins

@dan_jenkins

97