gwt videocall: power-up your mobile & web app with webrtc

30
GWT videocall: power-up your mobile & web app with WebRTC Francesca Tosi Alberto Mancini [email protected] [email protected]

Upload: gwtcon

Post on 08-Jul-2015

540 views

Category:

Technology


3 download

DESCRIPTION

Talk di Alberto Mancini e Francesca Tosi a alla GWTcon 2014.

TRANSCRIPT

Page 1: GWT videocall:  power-up your mobile & web app with WebRTC

GWT videocall:

power-up your mobile & web

app with WebRTC

Francesca Tosi Alberto Mancini

[email protected] [email protected]

Page 2: GWT videocall:  power-up your mobile & web app with WebRTC

Francesca

Web and mobile developer

software engineer and architect

with a passion for clean code

and fine tuned [email protected]@francescatosi+FrancescaTosi

Page 3: GWT videocall:  power-up your mobile & web app with WebRTC

Alberto

Software Developer (Web &

Mobile);

Linux Sysadmin

[email protected]+AlbertoMancini

Page 4: GWT videocall:  power-up your mobile & web app with WebRTC

POV

WEB

GWT

mGWT

Web is good

Web in js with GWT is better

Web in GWT running on mobile (mGWT) is even better

Page 5: GWT videocall:  power-up your mobile & web app with WebRTC

POV

HTML5:

WebRTC

Page 6: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

Plug-in free real-time communication

WebRTC is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple Javascript APIs.

source: webrtc.org

Page 7: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

JS API ?

or

The future of the Web ?

Just another JS API or

WebRTC is a new front in the long war for an open and unencumbered web

Brendan Eich (Mozilla CTO

and inventor of JavaScript)

Page 8: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

get Audio/Video

p2p communication

Acquiring Audio/Video stream

navigator.getUserMedia(constraints,successCallback,errorCallback);

Page 9: GWT videocall:  power-up your mobile & web app with WebRTC

Browser based computation

Augmented Reality browser based

Picshare

NyARToolkit + GWT-nyartoolkit

Page 10: GWT videocall:  power-up your mobile & web app with WebRTC

Why GWT is needed!

Picshare

NyARToolkit + GWT-nyartoolkit

Browser Based

Computation

<video/>

<canvas/>

Ny

HTTP

Page 11: GWT videocall:  power-up your mobile & web app with WebRTC

Browser based computation

Why GWT is needed!

Computer vision

Boofcv

Page 12: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

get Audio/Video

p2p communication

Peer-to-Peercommunication

between browsers

RTCPeerConnectionRTCDataChannel

Page 13: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

disruptiveJS api

Serverless web ?

Page 14: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

Signaling

Page 15: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

STUN

Page 16: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

TURN

Page 17: GWT videocall:  power-up your mobile & web app with WebRTC

Ora tocca ad Alberto

RPCPeerConnection

Page 18: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC

Signaling

Page 19: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC, signaling

Signal - WHAT ?

Page 20: GWT videocall:  power-up your mobile & web app with WebRTC

WebRTC, signaling

needs a communication channel (push-like)

Page 21: GWT videocall:  power-up your mobile & web app with WebRTC
Page 22: GWT videocall:  power-up your mobile & web app with WebRTC

signaling

~ 15 object types

~ 4 event types (just for RTCPc)

~ 6 async methods

void createOffer(OfferHandler callback … ) /*-{

void createAnswer(AnswerHandler callback … ) /*-{

void setLocalDescription(..., DescriptionHandler callback) /*-{

void setRemoteDescription(..., DescriptionHandler cb) /*-{

void addIceCandidate(..., CandidateHandler callback) /*-{

+Mediastreams handling

Page 23: GWT videocall:  power-up your mobile & web app with WebRTC

IMPLMENT, Channel

Channel GAE Channel -> EventBUS

onMessage() {//decodebus.fire(new MessageEvent(...));

}

Page 24: GWT videocall:  power-up your mobile & web app with WebRTC

IMPLMENT

JSNI/JSinterop public final native void

createOffer(OfferHandler callback , OfferConstraints constraints) /*-{this.createOffer(

function(s) { $entry([email protected]::onCreateOfferSuccess(*)(s));

}, function(e) {

$entry([email protected]::onCreateOfferError(*)(e.toString()));

}, constraints );

}-*/;

Page 25: GWT videocall:  power-up your mobile & web app with WebRTC

ADAPTER.JS

Cancel API incompatibilities between browsers

Part of the Chrome/Firefox interoperability sample app

...@Source("adapter.js")TextResource adapterjs();

...ScriptInjector.fromString(

AdapterjsResources.INSTANCE.adapterjs().getText() )

.setWindow(ScriptInjector.TOP_WINDOW)

.inject();

Page 26: GWT videocall:  power-up your mobile & web app with WebRTC

Why WebRTC ?

FreeOpenwidely-supported

native on AndoidiOS

avail. impl.C++/Java/...

Page 27: GWT videocall:  power-up your mobile & web app with WebRTC

Why WebRTC ?

Plugins for IE

e.g.

Temasysprovides ad ad hoc craftedreplacement ofadapter.js

Page 28: GWT videocall:  power-up your mobile & web app with WebRTC

mGWT 2.0

GWT Widgets & morefor mobile

well, Daniel afterwards will explain better:he is the author

Page 29: GWT videocall:  power-up your mobile & web app with WebRTC

FirefoxOS

Web developerspreferredmobile OS ?

B2G

Page 30: GWT videocall:  power-up your mobile & web app with WebRTC

That’s All !!

Francesca TosiR&D at Jooink [email protected]

Alberto ManciniDev at Jooink [email protected]