deploying webrtc successfully – a web developer perspective

39
COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. D1-2 Deploying WebRTC Successfully – Web Developer Perspective Chad Hart

Upload: dialogic-inc

Post on 02-Jul-2015

861 views

Category:

Technology


1 download

DESCRIPTION

Get the developer perspective on WebRTC from Chad Hart in his latest presentation from WebRTC Expo V

TRANSCRIPT

Page 1: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED.

D1-2 Deploying WebRTC Successfully –

Web Developer Perspective

Chad Hart

Page 2: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 2

Agenda

Before you start

Front-end

Back-end

End-to-End

Page 3: Deploying WebRTC successfully – A web developer perspective

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

Page 4: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 4

Plug-ins for your web admin

Page 5: Deploying WebRTC successfully – A web developer perspective

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

Page 6: Deploying WebRTC successfully – A web developer perspective

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

Page 7: Deploying WebRTC successfully – A web developer perspective

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

Page 8: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 8

Building WebRTC from scratch – 2 options

Official Build by Google Ericsson Lab’s OpenWebRTC

Page 9: Deploying WebRTC successfully – A web developer perspective

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

Page 10: Deploying WebRTC successfully – A web developer perspective

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

Page 11: Deploying WebRTC successfully – A web developer perspective

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

Page 12: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 12

http://upliketoast.blogspot.com/2011/01/search-results-vintage-women-boxing.html

Page 13: Deploying WebRTC successfully – A web developer perspective

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

Page 14: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 14

Hybrid apps for WebRTC

Page 15: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 15

Front-end considerations

Page 16: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 16

Design for telephony people

Page 17: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 17

getUserMedia browser permissions

Page 18: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 18

Remind your users to share their media

Page 19: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 19

Use HTTPS to cache permissions in Chrome

Page 20: Deploying WebRTC successfully – A web developer perspective

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

Page 21: Deploying WebRTC successfully – A web developer perspective

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/

Page 22: Deploying WebRTC successfully – A web developer perspective

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.

Page 23: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 23

Telephony people: use responsive web design!

Page 24: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 24

Page 25: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 25

Remember aspect ratiosDon’t overstretch a low resolution image

Page 26: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 26

Mobile rotation matters

Page 27: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 27

Mobile rotation matters

Manage empty space

Manage empty space

Page 28: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 28Be careful when using the HTML5 canvas to zoom

Page 29: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 29

Back-end Considerations

Page 30: Deploying WebRTC successfully – A web developer perspective

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

Page 31: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 31

What do you care more about?

Page 32: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 32

Bandwidth is not always ubiquitous or free

Client-side Server-side

Page 33: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 33

CPU & processing power is expensive

Client view Provider View

Page 34: Deploying WebRTC successfully – A web developer perspective

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

Page 35: Deploying WebRTC successfully – A web developer perspective

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

Page 36: Deploying WebRTC successfully – A web developer perspective

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/

Page 37: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 37

Web & telephony test tactics

Page 38: Deploying WebRTC successfully – A web developer perspective

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

Page 39: Deploying WebRTC successfully – A web developer perspective

COMPANY CONFIDENTIAL © COPYRIGHT 2014 DIALOGIC INC. ALL RIGHTS RESERVED. 39

How does Amazon’s WebRTC network work?