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

WebRTC overview

WebRTC overview

WebRTC is a new milestone in the evolution of the web. This technology allows us to quickly create real-time communication applications using HTML5 and JavaScript. You can develop your own peer-to-peer video chat in just 15 minutes. WebRTC is very flexible, you can make calls to another networks that using offer/answer model, for example SIP protocol.

Georgiy Podsvetov

December 15, 2012
Tweet

Other Decks in Programming

Transcript

  1. Inbitec | Georgiy Podsvetov WebRTC is a new front in

    the long war for an open and unencumbered web Brendan Eich 2
  2. Inbitec | Georgiy Podsvetov WebRTC and HTML5 could enable the

    same transformation for real time that the original browser did for information Phil Endholm 3
  3. 11 Stream processing var localStream; var onSuccess = function(stream) {

    localStream = stream; var v = URL.createObjectURL(stream); localVideo.src = v; } 11 Inbitec | Georgiy Podsvetov
  4. Inbitec | Georgiy Podsvetov Set remote description pc.addStream(localStream); offerSD =

    new RTCSessionDescription(offer); pc.setRemoteDescription(offerSD); 14
  5. Inbitec | Georgiy Podsvetov Transfer candidates pc.onicecandidate = function(evt){ if

    (!evt.candidate) { return; } sendToTarget(evt.candidate); }; 16
  6. Inbitec | Georgiy Podsvetov Display remote stream pc.onaddstream = function(event){

    var stream = event.stream; var v = URL.createObjectURL(stream); remoteVideo.src = v; }; 17
  7. Inbitec | Georgiy Podsvetov MediaStreamTrack (Video) MediaStreamTrack (Audio) Left Channel

    Right Channel <video> PeerConnection MediaStream INPUT OUTPUT 20
  8. Inbitec | Georgiy Podsvetov 21 MediaStream • audioTracks [MediaStreamTrackList] •

    videoTracks [MediaStreamTrackList] • label [String] – unique identifier stop() – local MediaStream only
  9. Inbitec | Georgiy Podsvetov 22 MediaStreamTrack • label – unique

    identifier • kind – “audio” or “video” • enabled – true | false • readyState – LIVE | MUTED | ENDED
  10. Inbitec | Georgiy Podsvetov 24 remoteStreams: MediaStreamList 0: MediaStream label:

    "hbeExA…" readyState: 1 videoTracks: MediaStreamTrackList 0: MediaStreamTrack enabled: true kind: "video" label: "hbeExA0…" audioTracks: MediaStreamTrackList RTCPeerConnection
  11. Inbitec | Georgiy Podsvetov Remote peer create new channel pc.ondatachannel

    = function(event) { var channel = event.channel; channel.onmessage = function(event) { //… } channel.onclose = function(event) { //… } } 30
  12. Inbitec | Georgiy Podsvetov 34 JavaScript Session Establishment Protocol (JSEP)

    http://tools.ietf.org/html/draft-ietf-rtcweb-jsep-02 http:// bit.ly/UXuC37 Control the signaling plane of a multimedia session
  13. Inbitec | Georgiy Podsvetov 36 Traversal Using Relays around NAT

    (TURN) RFC5289: http://bit.ly/12cW3cd Session Traversal Utilities for NAT (STUN) RFC5766: http://bit.ly/RtbU4H
  14. Inbitec | Georgiy Podsvetov 37 Near future Standardization of audio

    / video codecs Device detection Video resolution Switch camera Media recorder Data channel API improvements