the web can be do that better: hacking with html5 video, rtc and shared web workers - betta

124
The Web Can Do That Better! Hacking with HTML5 Video, RTC and Shared Web Workers Cristiano Betta CodeMotion Rome, 2014

Upload: codemotion

Post on 12-May-2015

237 views

Category:

Technology


0 download

DESCRIPTION

Slides from Cristiano Betta talk @ codemotion roma 2014

TRANSCRIPT

Page 1: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

The Web Can Do That Better! Hacking with HTML5 Video, RTC

and Shared Web Workers

Cristiano Betta CodeMotion Rome, 2014

Page 2: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta

Page 3: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Page 4: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Event organiser

Page 5: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Event organiser

Serial entrepreneur

Page 6: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Event organiser

Serial entrepreneur

50% Italian

Page 7: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Event organiser

Serial entrepreneur

50% Italian

100% Ferrari Lover

Page 8: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Cristiano Betta CodeMotion Rome, 2014

Cristiano Betta @cbetta Developer Advocate @ PayPal

Event organiser

Serial entrepreneur

50% Italian

100% Ferrari Lover

0% Ferrari owner

Page 9: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 10: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 11: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 12: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 13: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 14: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

15s

Page 15: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 16: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 17: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 18: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 19: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 20: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Complicated setup

Page 21: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Complicated setup

Network sensitive

Page 22: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Complicated setup

Network sensitive

Data lock-in

Page 23: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 24: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 25: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 26: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 27: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 28: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

28s

Page 29: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

We Can Do This Better

Page 30: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

The Web Can Do This Better

Page 31: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 32: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 33: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 34: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 35: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 36: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 37: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 38: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

RTCPeerConnection

Page 39: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

RTCPeerConnectionPeer-to-Peer Data API

Page 40: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

RTCPeerConnectionPeer-to-Peer Data APIPeer-to-Peer DTMF

Page 41: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Peer-to-Server?

Page 42: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

WebSockets?

Page 43: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

WebSockets?

Page 44: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 45: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 46: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 47: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 48: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 49: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

webrtc-experiment.com

Page 50: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

RecordRTC.js github.com/muaz-khan/WebRTC-Experiment/

tree/master/RecordRTC

Page 51: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

RecordRTC is a server-less JavaScript library can be used to record WebRTC audio/

video media streams. It supports cross-browser audio/video recording

Page 52: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

Page 53: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

Page 54: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

<canvas>

Page 55: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

<canvas> <audio>

Page 56: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

<canvas> <audio>

video blob

Page 57: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

stream

<canvas> <audio>

video blob audio blob

Page 58: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 59: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

video blob audio blob

Page 60: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

gif blob

Page 61: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 62: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 63: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 64: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 65: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 66: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

+

Page 67: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

+

Page 68: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 69: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

13mb for 30s!

Page 70: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

30-90 seconds to upload 30 seconds of video

Page 71: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 72: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 73: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

bgrins.github.io/videoconverter.js !

webrtc-experiment.com/ffmpeg/merging-wav-and-webm-into-mp4.html

Page 74: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Background Uploads

Page 75: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 76: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

HTML Web Workers

Page 77: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers

Page 78: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Shared Web Workers

Page 79: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Page 80: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Separate Threads

Page 81: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Separate Threads

Alive when referenced

Page 82: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Separate Threads

Alive when referenced

Reference lost on navigation

Page 83: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Separate Threads

Alive when referenced

Reference lost on navigation

Separate references

Page 84: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers Shared Web Workers

Separate Threads

Alive when referenced

Reference lost on navigation

Separate references Shared references

Page 85: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Web Workers

Page 86: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 87: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 88: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 89: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 90: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 91: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Shared Web Workers

Page 92: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 93: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 94: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 95: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 96: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 97: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 98: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 99: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

/recorder

Page 100: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

background-upload.js

Page 101: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

background-upload.js

Page 102: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

github.com/broofa/node-uuid

stackoverflow.com/questions/13870853

Page 103: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

/server

Page 104: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 105: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 106: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Was it worth it?

Page 107: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 108: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 109: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Chrome Only (for now)

Page 110: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Client side conversion

Page 111: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Firefox Nightly now has MediaStreamRecorder API

Page 112: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

www.w3.org/TR/mediastream-recording

Page 113: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Streaming vs Uploading

Page 114: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

Real background uploads

Page 115: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

It’s live!

Page 116: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 117: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

battlehack.orgIstanbul, Berlin, Warsaw,

London, Moscow

Page 118: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 119: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 120: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta

@cbetta slideshare.net/paypal

Page 121: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 122: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 123: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta
Page 124: The web can be do that better: Hacking with HTML5 Video, RTC and Shared Web Workers - Betta