ortc node.js prototype walkthrough

Post on 25-Feb-2016

84 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

TRANSCRIPT

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

Adalberto ForestiPrincipal Program Manager

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

RTCConnection Implementation RTCConnection.js• Exposes RTCConnection interface from

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

candidates, connection, and streams

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)

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

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

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

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

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?

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)

Q&A

Backup

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

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

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

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

top related