Building A Self-Hosted WebRTC Project Rod Apeldoorn EasyRTC Server Lead Priologic Software Inc. rod.apeldoorn@priologic.com Slides will be available at: http://easyrtc.com/cloudexpo/
A Little About Priologic Priologic Software Inc. incorporated in BC in 2003 Located in Victoria, British Columbia, 2 hour flight from SFO Team of 20+ people in custom software development services and WebRTC Product development Agile software development teams for Cisco with expertise in Web technologies, Mobile apps, Jabber, WebEx Social and WebRTC Product team for WebRTC since late 2012
What is WebRTC? (in a single slide) Features of WebRTC Access to user s camera & mic. getusermedia Peer to Peer communications RTCPeerConnection Data channels RTCDataChannel Plugin free Combines with other new technologies HTML 5, WebGL, Web Audio WebRTC Client Support: Google Chrome Browser Windows, OSX, Linux, Android Mozilla Firefox Windows, OSX, Linux, Android Media Servers SIP Servers / Gateways Programming API s JavaScript, C++, Java, Objective C
Why EasyRTC? WebRTC lacks (by design) a signaling specification No peer to peer solutions were available (Nov 2012) We thought WebRTC was really cool and wanted to work with it
Tenants of EasyRTC: General web developers should be able to use it Cross browser issues should be hidden when possible Signaling should include common application logic Server can be local (not just cloud based) I ll wait for booing to end before explaining Applications can be tailored for existing architecture
EasyRTC Architecture EMBED: Architecture graphic
EasyRTC Client Features Hides browser compatibility problems (when possible) Convenience methods Listing of peers Peer to peer messaging Peer to server messaging Selecting media stream Error handling File Transfer Interface Data channel with websocket fallback Drag and drop handler EasyRTC.easyApp Single method for handling common video chats
EasyRTC Server Features Easy to install Write server code in JavaScript Cross platform: Windows, Linux, OSX Embedded (Raspberry Pi) Installable to Cloud Amazon Web Services / Linode etc.. Simple WebRTC applications work out of the box Manage: Applications Rooms Authentication Sessions Connections Event driven for easier coding
Provided Demos Instant Messaging Simple Video + Audio HD Video Screen sharing (Chrome) Multi party chat Data Channels File sharing
What is Node.js? (in a single slide) Software platform Built using Google V8 JavaScript Engine Non-blocking I/O Fast, lightweight, efficient Excellent module system Large number of freely available modules Highly popular Sponsored by Joyent Inc.
LIVE - Node.js Example Live example of building a quick web server
LIVE - NPM Node Package Manager Live Building from previous example, show NPM and how to install EasyRTC
LIVE Code EasyRTC Simple Video Chat Live After EasyRTC is installed, code a simple video chat
JavaScript Callbacks Allows asynchronous calls non-blocking Used by EasyRTC First parameter often of type Error Nesting leads to callback hell settimeout( function(){ console.warn("three seconds later"); }, 3000 ); var sayfive = function(){ console.warn("five seconds Later"); }; settimeout(sayfive, 5000); console.warn("this shows first");
Async Waterfall Helps avoid callback hell Runs each function in series Results are given to next function If error occurs, it skips to the end Useful for application logic involving service requests or database calls async = require("async"); async.waterfall([ function(asynccallback){ asynccallback(null, "dog"); }, function(pet, asynccallback){ console.log("you have a " + pet); asynccallback(new Error("No Pets Allowed")); }, function(asynccallback) { console.log("will not be shown"); }], function(err){ if (err) { } ); } console.log("error: " + err.message);
Async Each Iterates through an array Delivers array value to function Functions are run in parallel Waits until all are complete before continuing Useful for concurrently sending commands to multiple connections async = require("async"); async.each( ["a","b","c"], } ); function(letter, asynccallback) { console.log("received letter " + letter); asynccallback(null); }, function(err) { if (err) { throw err; } else { } console.log("all letters received");
LIVE EasyRTC Security App Live Code a new example consisting of an EasyRTC Security App
EasyRTC Server Configuration Server level options easyrtc.setoption(); Application level appobj.setoption(); Room level roomobj.setoption();
Use Case: tawk.com Based on EasyRTC Database connectivity Email Real time monitoring Logging Load balancer + SSL TURN server Embed in your own site EMBED: Tawk video
Possible WebRTC Applications Current Focus General chat Video conferencing SIP Integration Unified Communications Call centers Future Possibilities Gaming Distributed file transfer Embedded applications Control systems Always on recording Collaboration software Website Live Support Integration with TV s
Future EasyRTC Clients IOS Android Media Server Embedded EMBED: IOS Video
Thanks for your time! Questions? Links To Know: http://easyrtc.com Look for Us In The Showroom! Booth #120 Slides: http://easyrtc.com/cloudexpo/ Demo Site: http://demo.easyrtc.com/ GitHub Site: https://github.com/priologic/easyrtc Discussion Group: https://groups.google.com/forum/#!forum/easyrtc Turn Server: https://code.google.com/p/rfc5766-turn-server/