Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebRTC: Unicorns, Narwhals and The Real-Time Web

Tian Davis
February 21, 2015

WebRTC: Unicorns, Narwhals and The Real-Time Web

You probably don't know WebRTC as much as you think. I'm not surprised. WebRTC is both amazing and terrifying. No real standards exist between browser vendors. How to integrate WebRTC the right way? WebRTC is but one ingredient to a successful real-time web recipe. This talk discusses lessons learned in the trenches building a next-generation real-time network. In particular, I discuss the bad parts of WebRTC and why it is so crucial to business success. The talk further suggests how to get WebRTC solutions right and build a multidisciplinary software engineering team in the process.

To learn more, visit http://tiandavis.com/talks

Tian Davis

February 21, 2015
Tweet

More Decks by Tian Davis

Other Decks in Programming

Transcript

  1. Zendesk Voice Mayday Service Google Hangouts Handyman Service Slack &

    Screenhero Apollo by Respoke Talky by &Yet Skype for Web Snapchat
  2. getUserMedia function onMediaStream(stream) { window.stream = stream; var video =

    document.getElementById(“localVideo"); video.src = window.URL.createObjectURL(stream); video.play(); }
  3. RTCPeerConnection var io = require(“socket.io”).listen(server); ! io.on(“connection”, function (socket) {

    socket.on(“join”, function(event) {}); socket.on(“candidate”, function(event) {}); socket.on(“offer”, function(event) {}); socket.on(“answer”, function(event) {}); };
  4. RTCPeerConnection function onOffer(offer) { var rtcOffer = new RTCSessionDescription(JSON.parse(offer)); peerConnection.setRemoteDescription(rtcOffer);

    peerConnection.createAnswer( function(answer){ peerConnection.setLocalDescription(answer); socket.emit(“answer”, JSON.stringify(answer)); },
  5. RTCPeerConnection peerConnection = new RTCPeerConnection(pcConfig, pcConstraints); ! if(localStream) { peerConnection.addStream(localStream);

    } ! peerConnection.onaddstream = onAddStream; peerConnection.onicecandidate = onIceCandidate;
  6. Create RTC Send Offer Create RTC Send Answer Send/Set ICE

    Candidate Set/Send ICE Candidate Peer 1 Peer 2
  7. Zendesk Voice Mayday Service Google Hangouts Handyman Service Slack &

    Screenhero Apollo by Respoke Talky by &Yet Skype for Web Snapchat
  8. JS