GWT videocall: 
power-up your mobile & web 
app with WebRTC 
Francesca Tosi Alberto Mancini 
francesca@jooink.com alberto@jooink.com
Francesca 
Web and mobile developer 
software engineer and architect 
with a passion for clean code 
and fine tuned details 
francesca@jooink.com 
@francescatosi 
+FrancescaTosi
Alberto 
Software Developer (Web & 
Mobile); 
Linux Sysadmin 
DevOps 
alberto@jooink.com 
+AlbertoMancini
POV 
WEB 
GWT 
mGWT 
Web is good 
Web in js with GWT is better 
Web in GWT running on mobile 
(mGWT) is even better
POV 
HTML5: 
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
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)
WebRTC 
get 
Audio/Video 
p2p 
communication 
Acquiring Audio/Video stream 
navigator.getUserMedia(constraints, 
successCallback, 
errorCallback);
Browser based computation 
Augmented 
Reality browser 
based 
Picshare 
NyARToolkit + 
GWT-nyartoolkit
Browser Based 
Computation 
Why GWT is 
needed! 
Picshare 
NyARToolkit + 
GWT-nyartoolkit 
<video/> 
<canvas/> 
Ny 
HTTP
Browser based computation 
Why GWT is 
needed! 
Computer vision 
Boofcv
WebRTC 
get 
Audio/Video 
p2p 
communication 
Peer-to-Peer 
communication 
between browsers 
RTCPeerConnection 
RTCDataChannel
WebRTC 
disruptive 
JS api 
Serverless 
web ?
WebRTC 
Signaling
WebRTC 
STUN
WebRTC 
TURN
Ora tocca ad Alberto 
RPCPeerConnection
WebRTC 
Signaling
WebRTC, signaling 
Signal - WHAT ?
WebRTC, signaling 
needs a 
communication 
channel (push-like)
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
IMPLMENT, Channel 
Channel GAE Channel -> EventBUS 
onMessage() { 
//decode 
bus.fire(new MessageEvent(...)); 
}
IMPLMENT 
JSNI/JSinterop public final native void 
createOffer(OfferHandler callback , OfferConstraints constraints) /*-{ 
this.createOffer( 
function(s) { 
$entry(callback.@...OfferHandler::onCreateOfferSuccess(*)(s)); 
}, 
function(e) { 
$entry(callback.@....adapterjs.OfferHandler::onCreateOfferError(*) 
(e.toString())); 
}, 
constraints ); 
}-*/;
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();
Why WebRTC ? 
Free 
Open 
widely-supported 
native on 
Andoid 
iOS 
avail. impl. 
C++/Java/...
Why WebRTC ? 
Plugins for IE 
e.g. 
Temasys 
provides ad 
ad hoc crafted 
replacement of 
adapter.js
mGWT 2.0 
GWT 
Widgets & more 
for mobile 
well, Daniel 
afterwards will 
explain better: 
he is the author
FirefoxOS 
Web developers 
preferred 
mobile OS ? 
B2G
That’s All !! 
Francesca Tosi 
R&D at Jooink Team 
francesca@jooink.com 
Alberto Mancini 
Dev at Jooink Team 
alberto@jooink.com

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

  • 1.
    GWT videocall: power-upyour mobile & web app with WebRTC Francesca Tosi Alberto Mancini francesca@jooink.com alberto@jooink.com
  • 2.
    Francesca Web andmobile developer software engineer and architect with a passion for clean code and fine tuned details francesca@jooink.com @francescatosi +FrancescaTosi
  • 3.
    Alberto Software Developer(Web & Mobile); Linux Sysadmin DevOps alberto@jooink.com +AlbertoMancini
  • 4.
    POV WEB GWT mGWT Web is good Web in js with GWT is better Web in GWT running on mobile (mGWT) is even better
  • 5.
  • 6.
    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
  • 7.
    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)
  • 8.
    WebRTC get Audio/Video p2p communication Acquiring Audio/Video stream navigator.getUserMedia(constraints, successCallback, errorCallback);
  • 9.
    Browser based computation Augmented Reality browser based Picshare NyARToolkit + GWT-nyartoolkit
  • 10.
    Browser Based Computation Why GWT is needed! Picshare NyARToolkit + GWT-nyartoolkit <video/> <canvas/> Ny HTTP
  • 11.
    Browser based computation Why GWT is needed! Computer vision Boofcv
  • 12.
    WebRTC get Audio/Video p2p communication Peer-to-Peer communication between browsers RTCPeerConnection RTCDataChannel
  • 13.
    WebRTC disruptive JSapi Serverless web ?
  • 14.
  • 15.
  • 16.
  • 17.
    Ora tocca adAlberto RPCPeerConnection
  • 18.
  • 19.
  • 20.
    WebRTC, signaling needsa communication channel (push-like)
  • 22.
    signaling ~ 15object 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
  • 23.
    IMPLMENT, Channel ChannelGAE Channel -> EventBUS onMessage() { //decode bus.fire(new MessageEvent(...)); }
  • 24.
    IMPLMENT JSNI/JSinterop publicfinal native void createOffer(OfferHandler callback , OfferConstraints constraints) /*-{ this.createOffer( function(s) { $entry(callback.@...OfferHandler::onCreateOfferSuccess(*)(s)); }, function(e) { $entry(callback.@....adapterjs.OfferHandler::onCreateOfferError(*) (e.toString())); }, constraints ); }-*/;
  • 25.
    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();
  • 26.
    Why WebRTC ? Free Open widely-supported native on Andoid iOS avail. impl. C++/Java/...
  • 27.
    Why WebRTC ? Plugins for IE e.g. Temasys provides ad ad hoc crafted replacement of adapter.js
  • 28.
    mGWT 2.0 GWT Widgets & more for mobile well, Daniel afterwards will explain better: he is the author
  • 29.
    FirefoxOS Web developers preferred mobile OS ? B2G
  • 30.
    That’s All !! Francesca Tosi R&D at Jooink Team francesca@jooink.com Alberto Mancini Dev at Jooink Team alberto@jooink.com

Editor's Notes

  • #11 questo e’ quello con cui abbiamo stressato gli amici del GDG per mesi … e’ il porting di nyartoolkit per gwt, non ve lo stiamo a spiegare ma si fa agilmente realtime video editing e realta’ aumentata marker based pure-js; e’ tutto su googlecode e github