SlideShare une entreprise Scribd logo
1  sur  53
Télécharger pour lire hors ligne
WebRTC
... GWT & in-browser computation
Alberto Mancini - alberto@jooink.com
Francesca Tosi - francesca@jooink.com
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
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
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)
?
Once upon a time … browsers
(js-)applications
were sandboxed and
kept far away from
the hosting
computer’s
resources.
Once upon a time … browsers
(js-)applications
were sandboxed and
kept far away from
the hosting
computer’s
resources.
Browser Piercing (aka HTML5)
a Javascript Application cannot
➔ access the filesystem
➔ open f/d socket connections
➔ use graphics accelerator
➔ span multiple threads
Browser Piercing (aka HTML5)
a Javascript Application cannot
➔ access the filesystem → and then FileAPI
➔ open f/d socket connections → and then WebSockets
➔ use graphics accelerator → and then WebGL
➔ span multiple threads → and then WebWorkers
Browser Piercing
a Javascript Application cannot
➔ acquire audio and video
➔ communicate P2P
Browser Piercing
a Javascript Application cannot
➔ acquire audio and video
➔ communicate P2P
WebRTC … secure enough?
“… WebRTC has encryption baked right into
it; there's actually no way to send
unencrypted media using a WebRTC
implementation … both Chrome and Firefox
implement.”
WebRTC … secure enough?
But ...
“If the developers fail to carefully consider the
security implications of their choices, the
safeguards mandated by the specification will
not be enough to guarantee the security of
their WebRTC-based applications and the
users.”
WebRTC … secure enough?
Do not ...
“... it would be very easy to inadvertently click
on something that gave camera or microphone
control to someone I don't know and don't care
to know.”
Courtney Sato - nerd queen @ConstellationRG
WebRTC … secure enough?
See also:
WebRTC: APIs, Protocols and Security
Considerations - Part 1 / Part 2
WebRTC Security and Confidentiality
Security Considerations for WebRTC
WebRTC Security Architecture
WebRTC across platforms
● Chrome (mobile too)
● Firefox (mobile too)
● Opera
● Native Java and Obj-C
WebRTC JS-API
Some code
…
WebRTC JS-API
Acquiring video and audio
navigator.getUserMedia(constraints,
successCallback,
errorCallback);
WebRTC JS-API
Acquiring video and audio
navigator.getUserMedia(constraints,
successCallback,
errorCallback);
WebRTC JS-API
Constraints
● Controls the contents of the MediaStream
● Media type, resolution, frame rate
var constraints = {video: true};
video: {
mandatory: { ... },
optional [{... }]
}
WebRTC JS-API
Constraints
● Controls the contents of the MediaStream
● Media type, resolution, frame rate
var constraints = {video: true};
video: {
mandatory: { chromeMediaSource: ‘screen’ },
optional [{... }]
}
WebRTC JS-API
Acquiring video and audio
navigator.getUserMedia(constraints,
successCallback,
errorCallback);
WebRTC JS-API
errorCallback
function errorCallback(error) {
console.log("error: ", error);
}
;-)
WebRTC JS-API
Acquiring video and audio
navigator.getUserMedia(constraints,
successCallback,
errorCallback);
WebRTC JS-API
successCallback
function successCallback(stream) {
...
}
stream: MediaStream; a flux of audio- or video-related
data.
WebRTC JS-API
successCallback
function successCallback(stream) {
var video = ...
video.src =
window.URL.createObjectURL(stream);
}
(W3C File API)
WebRTC JS-API
full sample
var constraints = {video: true};
function successCallback(stream) {
var video = document.querySelector("video");
video.src = window.URL.createObjectURL(stream);
}
function errorCallback(error) {
console.log("navigator.getUserMedia error: ", error);
}
navigator.getUserMedia(constraints, successCallback, errorCallback);
WebRTC JS-API
Live Demo - 1
http://goo.gl/7X91Ie
WebRTC JS-API
RTCPeerConnection
→
getUserMedia
+
RTCPeerConnection
←
WebRTC JS-API
RTCDataChannel
Bidirectional communication of arbitrary data
var position = {x: 3.0, y: -2.0};
...
var message = {txt: ‘...’, timestamp: ...};
RTCPeerConnection sample
pc = new RTCPeerConnection(null);
pc.onaddstream = gotRemoteStream;
pc.addStream(localStream);
pc.createOffer(gotOffer);
function gotOffer(desc) {
pc.setLocalDescription(desc);
sendOffer(desc);
}
function gotAnswer(desc) {
pc.setRemoteDescription(desc);
}
function gotRemoteStream(e) {
attachMediaStream(remoteVideo, e.stream);
}
RTCPeerConnection
Live Demo - 2
https://apprtc.appspot.com
RTCPeerConnection
RTCPeerConnection
RTCPeerConnection
STUN
TURN
WebRTC made easy
...
● Video chat:
○ SimpleWebRTC
○ easyRTC
○ webRTC.io
● Peer-to-peer data:
○ PeerJS
○ Sharefest
Our target
Our target
● getUserMedia: gives us real time stream from the camera
● we can draw the <video/> into a <canvas/>
● from the canvas we can extract pixel data getImageData()
and then elaborate.
Computing in the browser
goals
- Almost native performance
- Manage complex algorithms and applications
on the browser
Our target
cam WebRTC <video/>
canvas ImageData
UInt8ArrayGWT(NyARToolkit)mv matrix
WebGL OBJ Model
Loader3D Shaders
WebGL
video
effects
Video
Computing in the browser
constraints
- reuse existing code
- cross-browser (as much as possible)
Computing in the browser
our approach
- javascript as a target language (GWT)
- hand written optimized pieces of code
GWT
GWT Web Toolkit
- java to javascript (optimizing) compiler
- emulated jre
- widget set
- develop in java and execute in javascript
JooinK’s WebRTC sample
Sample
http://picshare.jooink.com
Demo …
PicShare
Tecnologies
● WebGL for 3D graphics
● WebRTC for MediaSteams
● ImgUR for pictures store
● AppEngine to store indices
● GWT as the glue
FOSS
gwt-nyartoolkit.googlecode.com
gwt-webgl.googlecode.com
The strategy: compile a java-lib with GWT into javascript
What’s next
Challanges
● real-time on mobile apps
● real world recognition: computer vision
(BoofCV)
What’s next
Strategy
● use TypedArrays everywhere
● offload computation to the graphic
accelerator through WebGL
● help the JIT compiler/optimizer with asm.js
References
● http://io13webrtc.appspot.com/#1
(where we got inspiration and most of the pictures)
● http://www.youtube.com/watch?v=p2HzZkd2A40
● http://www.webrtc.org (spec)
References
● http://www.jooink.com
● http://jooink.blogspot.com
● http://www.mokabyte.it
That’s all folks!!!
Francesca Tosi
francesca@jooink.com
Alberto Mancini
alberto@jooink.com
Markers - use at picshare.jooink.com

Contenu connexe

Tendances

WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms
philn2
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
Ariya Hidayat
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
Sim Janghoon
 

Tendances (19)

Multimedia in WebKitGtk+, past/present/future
Multimedia in WebKitGtk+, past/present/futureMultimedia in WebKitGtk+, past/present/future
Multimedia in WebKitGtk+, past/present/future
 
Petri Niemi Qt Web Kit
Petri Niemi Qt Web KitPetri Niemi Qt Web Kit
Petri Niemi Qt Web Kit
 
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
 
JS Fest 2019: Comparing Node.js processes and threads for clustering HTTP, TC...
JS Fest 2019: Comparing Node.js processes and threads for clustering HTTP, TC...JS Fest 2019: Comparing Node.js processes and threads for clustering HTTP, TC...
JS Fest 2019: Comparing Node.js processes and threads for clustering HTTP, TC...
 
WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms
 
GStreamer support in WebKit. what’s new?
GStreamer support in WebKit. what’s new?GStreamer support in WebKit. what’s new?
GStreamer support in WebKit. what’s new?
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 
WPE WebKit for Android
WPE WebKit for AndroidWPE WebKit for Android
WPE WebKit for Android
 
WebRTC eduCONF
WebRTC eduCONFWebRTC eduCONF
WebRTC eduCONF
 
Ultrasound Image Viewer - Qt + SGX
Ultrasound Image Viewer - Qt + SGXUltrasound Image Viewer - Qt + SGX
Ultrasound Image Viewer - Qt + SGX
 
Introduction solidity
Introduction solidityIntroduction solidity
Introduction solidity
 
WebKit and GStreamer
WebKit and GStreamerWebKit and GStreamer
WebKit and GStreamer
 
Webrtc puzzle
Webrtc puzzleWebrtc puzzle
Webrtc puzzle
 
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
ceph::errorator<> throw/catch-free, compile time-checked exceptions for seast...
 
Introduction to video streaming on SGX through v3dfx-base
Introduction to video streaming on SGX through v3dfx-baseIntroduction to video streaming on SGX through v3dfx-base
Introduction to video streaming on SGX through v3dfx-base
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 
What is a Service Mesh and what can it do for your Microservices
What is a Service Mesh and what can it do for your MicroservicesWhat is a Service Mesh and what can it do for your Microservices
What is a Service Mesh and what can it do for your Microservices
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
LCU14 209- LLVM Linux
LCU14 209- LLVM LinuxLCU14 209- LLVM Linux
LCU14 209- LLVM Linux
 

Similaire à WebRTC ... GWT & in-browser computation

Similaire à WebRTC ... GWT & in-browser computation (20)

Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
 
WebRTC
WebRTCWebRTC
WebRTC
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC[workshop] The Revolutionary WebRTC
[workshop] The Revolutionary WebRTC
 
Introduction to WebRTC
Introduction to WebRTCIntroduction to WebRTC
Introduction to WebRTC
 
WbeRTC in IOT presented in KrankyGeek
WbeRTC in IOT presented in KrankyGeekWbeRTC in IOT presented in KrankyGeek
WbeRTC in IOT presented in KrankyGeek
 
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
WebRTC Webinar & Q&A - W3C WebRTC JS API Test Platform & Updates from W3C Lis...
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
 
WebRTC in WPE/GTK Ports: Current status and challenges
WebRTC in WPE/GTK Ports: Current status and challengesWebRTC in WPE/GTK Ports: Current status and challenges
WebRTC in WPE/GTK Ports: Current status and challenges
 
[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Analysis of video quality and end-to-end latency in WebRTC
Analysis of video quality and end-to-end latency in WebRTCAnalysis of video quality and end-to-end latency in WebRTC
Analysis of video quality and end-to-end latency in WebRTC
 
WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)WebRTC standards update (Jul 2014)
WebRTC standards update (Jul 2014)
 
Webrtc in Real world
Webrtc in Real world Webrtc in Real world
Webrtc in Real world
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
 
Twilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC RebornTwilio Signal 2016 WebRTC Reborn
Twilio Signal 2016 WebRTC Reborn
 
WebRTC
WebRTCWebRTC
WebRTC
 
WebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNageWebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNage
 
WebRTC in action
WebRTC in actionWebRTC in action
WebRTC in action
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 

Plus de JooinK (9)

(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer
 
Power-up your mobile & web App with WebRTC
Power-up your mobile & web App with WebRTCPower-up your mobile & web App with WebRTC
Power-up your mobile & web App with WebRTC
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
Go native benchmark test su dispositivi x86: java, ndk, ipp e tbb
Go native  benchmark test su dispositivi x86: java, ndk, ipp e tbbGo native  benchmark test su dispositivi x86: java, ndk, ipp e tbb
Go native benchmark test su dispositivi x86: java, ndk, ipp e tbb
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Javascript as a target language - GWT kickoff - part1/2
Javascript as a target language - GWT kickoff - part1/2Javascript as a target language - GWT kickoff - part1/2
Javascript as a target language - GWT kickoff - part1/2
 
Augmented experience: Augmented Reality
Augmented experience: Augmented RealityAugmented experience: Augmented Reality
Augmented experience: Augmented Reality
 
Web&mobile - 4 ottobre 2012
Web&mobile  - 4 ottobre 2012Web&mobile  - 4 ottobre 2012
Web&mobile - 4 ottobre 2012
 
JooinK Presentation
JooinK PresentationJooinK Presentation
JooinK Presentation
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

WebRTC ... GWT & in-browser computation