deploying webrtc successfully – a web developer perspective
DESCRIPTION
Get the developer perspective on WebRTC from Chad Hart in his latest presentation from WebRTC Expo VTRANSCRIPT
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED.
D1-2 Deploying WebRTC Successfully –
Web Developer Perspective
Chad Hart
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 2
Agenda
Before you start
Front-end
Back-end
End-to-End
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 3
Many ways to work with WebRTC
Level of effort
Low-level source
Frameworks, Tools, and
SDKsCloud API’s
Amount of control
Website Plug-ins & widgets
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 4
Plug-ins for your web admin
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 5
WebRTC plug-ins – super simple
Advantages Disadvantages
Only works on your website/CMS
Limited functionality
Limited control
Does not have your branding
Easy for a web-admin to use
Often integrated with your CMS
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 6
Consuming WebRTC API’s from the cloud
SignalingAuthentication
Push Notifications
SIP Gateway
Transcoding
STUN
TURN Servers
Low Latency
Elasticity
Recording
Geographic redundancy
Bandwidth
Service monitoring
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 7
WebRTC Cloud-API’s – easy but inflexible
Advantages Disadvantages
Usually most expensive
Vendor longevity risk
Vendor dependency
Feature evolution risk – may not always have what you need
Platform lock-in on advanced features
Designing to control costs
Rapid setup
Often very easy prototyping
Good platforms have most of you need
Often easy to swap with other Cloud-API vendors for basic calling
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 8
Building WebRTC from scratch – 2 options
Official Build by Google Ericsson Lab’s OpenWebRTC
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 9
Building from scratch is not for the faint of heart
Advantages Disadvantages
Steep learning curve
Big on-going commitment to maintain
Standards not done & codebase continually in flux
Project was not designed for your application
Abiding by license terms
Full control
Many application-specific optimization opportunities
Native mobile support
Ability to incorporate select components
Active community support
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 10
Happy medium - develop with tools
Open Source
Commercial
Server-side libraries
JavaScript libraries
Mobile SDK’s
Cross-platform frameworks
Infrastructure elements
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 11
Building with tools – many, many options
Advantages Disadvantages
Figuring out which option is best
Interworking various toolsets
Inconsistent feature evolution
Potential platform lock-in
Many options to choose from
Ability to choose best-of-breed components
Optimized selections based on application needs & team skills
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 12
http://upliketoast.blogspot.com/2011/01/search-results-vintage-women-boxing.html
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 13
Web vs. native – not an easy debate
Web arguments
Less expensive to develop
Most users per development hour
WebRTC inside web views will happen soon (on Android at least)
You need a website anyway
Native arguments
iOS support
iOS support
Better push notifications for improved battery life
Better camera controls
You need a native mobile app anyway
http://upliketoast.blogspot.com/2011/01/search-results-vintage-women-boxing.html
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 14
Hybrid apps for WebRTC
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 15
Front-end considerations
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 16
Design for telephony people
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 17
getUserMedia browser permissions
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 18
Remind your users to share their media
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 19
Use HTTPS to cache permissions in Chrome
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 20
Use a polyfill to adjust for browser differences
Almost all cloud API vendors include some polyfill
Use the official Chrome/webrtc adapter.js
Will get worse, but community will adapt
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
Browser differences are a manageable fact of life
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 21
Chrome Extensions for notifications & screen share
Building a Chrome extension is not that difficult: http://webrtchacks.com/chrome-extension/
Use webrtc-experiment’s generic one to start: https://www.webrtc-experiment.com/getScreenId/
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 22
Mobile considerations - bandwidth & battery
Video resolution
Video framerate
Number of streams
Audio quality
HTML canvas processing
vs.
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 23
Telephony people: use responsive web design!
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 24
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 25
Remember aspect ratiosDon’t overstretch a low resolution image
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 26
Mobile rotation matters
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 27
Mobile rotation matters
Manage empty space
Manage empty space
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 28Be careful when using the HTML5 canvas to zoom
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 29
Back-end Considerations
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 30
Deploying STUN & TURN servers
Almost every WebRTC deployment should have a TURN server
Included with most cloud-API providers
Plenty of quasi-public STUN server available for prototyping
The open source ones are very goodrfc-5766-turn-server
Coturn
Can be integrated with other network infrastructure
Media server + co-resident
STUN/TURN server
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 31
What do you care more about?
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 32
Bandwidth is not always ubiquitous or free
Client-side Server-side
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 33
CPU & processing power is expensive
Client view Provider View
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 34
Server-side media processing use cases
Multi-party conferencing InterworkingTranscoding
Stream processing Person-to-machineRecording
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 35
Networking: Points of presence & latency
Inherent VoIP latency: 100-150 ms
÷ 2 for one-way
AWS round-trip latencies
Transcoding latency:0-200 ms
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 36
What about Signaling?
Image source: Flickr user Tuomo Tammenpää – http://www.flickr.com/photos/misuser/5846728262/
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 37
Web & telephony test tactics
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 38
Legend
Web-Centric security model
Web server
IMS Network
SIP
WebMGFirewall
AP
I Man
ager
API Calls
H2S Server
Identity Server
App Server
App Server
WSS server
STUN/ TURN
Internal REST APIs
Existing Web Infrastructure
New WebRTCElements
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 39
How does Amazon’s WebRTC network work?