16
ORTC Node.js Prototype Walkthrough Vancouver, 11/3/2013 Adalberto Foresti Principal Program Manager

ORTC Node.js Prototype Walkthrough

  • Upload
    nelson

  • View
    96

  • Download
    0

Embed Size (px)

DESCRIPTION

ORTC Node.js Prototype Walkthrough. Vancouver, 11/3/2013 Adalberto Foresti Principal Program Manager. Key Messages, Call to Action. The spec is implementable in the real world > Dev experience is already feeding back into the document - PowerPoint PPT Presentation

Citation preview

Page 1: ORTC Node.js  Prototype Walkthrough

ORTC Node.js Prototype WalkthroughVancouver, 11/3/2013

Adalberto ForestiPrincipal Program Manager

Page 2: ORTC Node.js  Prototype Walkthrough

Key Messages, Call to Action• The spec is implementable in the real

world> Dev experience is already feeding back into the

document• The resulting JavaScript is simple and

understandable by ordinary web developers

> And that is, without tons of JS library code to hide the difficult stuff• Try the code out! Join the effort in the CG

and github!> Node.js code will be contributed under permissive OSS

license in the next days

Page 3: ORTC Node.js  Prototype Walkthrough

RTCConnection Implementation RTCConnection.js• Exposes RTCConnection interface from

ORTC spec• Manages streams, • Implements event handlers for ICE

candidates, connection, and streams

Page 4: ORTC Node.js  Prototype Walkthrough

RTCConnection usegatewayclient-ortc-p2p.js• Loads plugin• Instantiates RTCConnection• Initializes and manages ICE

> collects local information and keeps track of candidates from the other peer• Collects streams via getUserMedia and sends

them to peer• Receives streams from peer; plays them on

page• See “Simple Peer-to-peer Example” (section 9.1)

Page 5: ORTC Node.js  Prototype Walkthrough

RTCTrack implementation RTCTrack.js• Exposes RTCTrack interface from ORTC

spec• Defines source, kind, msrc (R/O), msid,

codecs, attributes, rtpExtHeaders (R/W)• Implements start, stop, getDescription,

and remove methods

Page 6: ORTC Node.js  Prototype Walkthrough

getUserMediagetUserMedia.js• Exposes getUserMedia interface from w3c spec

> Business logic is implemented within the plugin• Get handles to Media devices for audio and

video streaming• Handles error condition if device access is

deniedMediaStream.js• Exposes MediaStream and MediaStreamTrack

interfaces

Page 7: ORTC Node.js  Prototype Walkthrough

ICEtransport.js• Wraps plugin logic for creation and management of

secure (real time) portsgather.js• Keeps looping for new candidates as network

conditions might changechecker.js• Verifies the viability of candidates found by the

gatherer by attempting to connect

Page 8: ORTC Node.js  Prototype Walkthrough

ICE (2)transportbuilder.js• Starts the gatherer to collect ICE

candidates and manages the listnetworkinterfacetransportbuilder.js• If multiple network interfaces are available,

maintains one candidate per interface and handles failover

Page 9: ORTC Node.js  Prototype Walkthrough

What’s next?• Add Support for DMTF• Catch up with Spec updates• General code cleanup • More comments in the source! • Additional documentation• What about the Client?• Support for Windows 8.1• Chrome/OSX Build

• What about an Open Source Client?

Page 10: ORTC Node.js  Prototype Walkthrough

Resources• http://www.w3.org/community/orca/ (ORTC home

base)

• https://rawgithub.com/robin-raymond/ortc/master/ortc.html (spec)

• https://github.com/openpeer/ortc (source code)

• http://html5labs.com (drop point for the client plugin)

Page 11: ORTC Node.js  Prototype Walkthrough

Q&A

Page 12: ORTC Node.js  Prototype Walkthrough

Backup

Page 13: ORTC Node.js  Prototype Walkthrough

Bill of MaterialsFolder Server_demo node_modules\ORTC node_modules\ICE.js

Purpose node server, client UI streaming and signaling

ICE

Files crc.jsgatewayclient-ortc.htmlgatewayclient-ortc-p2p.jsgatewayclient-ortc.jsindex.htmlips.jssignallingchannel.jsstun.js

dictionaries.jsgetUserMedia.jsMediaStream.jsortc.jsRTCConnection.jsRTCDMTFHandler.jsRTCSocket.jsRTCTrack.js

candidateevent.jschecker.jsgather.jsindex.jsnetworkinterfacetransportbuilder.jsparalleltransportbuilder.jsreflexive.jstransport.jstransportbuilder.js

Page 14: ORTC Node.js  Prototype Walkthrough

The Node ServerGateway-p2p.js• Creates HTTP Handler (httpHandler), then starts

listening for messages (ioSocket.on) and handling them (handleMessage)

> Each client has its own dedicated web socket• Maintains registry of “rooms” (host + guest

pairs) and communicates state changes to peers (ready, start call, stop)

> If one of the peers’ socket is disconnected, sends stop to the other

Page 15: ORTC Node.js  Prototype Walkthrough

HTML pagesIndex.html• Starting point for creation of new sessions• Can terminate all sessions by posting a

/reset command to the servergatewayclient-ortc.html• Host page for Video control where all the

action takes place• Can act as either host or guest

Page 16: ORTC Node.js  Prototype Walkthrough

Gateway Client Scriptssignalingchannel.js• Contains client side websocket code• Creates connection, registers w/server,

listens for eventsgatewayclient-p2p.js• Initializes Client configuration • Handles UI events