SlideShare a Scribd company logo
1 of 28
Tobias Uhlig, Solutions Engineer, Sencha
Rich Waters, Chief Software Architect, Extnd LLC
@tobiasuhlig
@rwaters
tobiu@sencha.com
senchacon@rich-waters.com
Pushing the
Boundaries of Sencha
and HTML5’s
WebRTC
Agenda
• Google+
• Facebook
• S-Circles
• WebRTC
Google+
Google+ Sign-In
<!-- Place this asynchronous JavaScript just before your </body>
tag -->
<script type="text/javascript">
(function() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
<span id="signinButton">...</span>
Web 2.0 Google+ Sign-In
loadGooglePlusApi : function() {
window.onSignInCallback = function(authResult) {
SCircles.app.fireEvent('googlePlusSignInCallback', authResult);
};
var api = document.createElement('script');
Ext.apply(api, {
async : true,
type : 'text/javascript',
src : 'https://plus.google.com/js/client:plusone.js'
});
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(api, s);
}
Facebook
Facebook Query Language
• SQL-Style
• Provides for some advanced features not available in the
Graph API
• Supports subqueries
• Does not support (left) joining tables
FQL - Simple examples
SELECT name FROM user WHERE uid = me()
SELECT uid, name, pic_square FROM user WHERE uid = me()
OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
FQL Multi-query
FB.api({
method : 'fql.multiquery',
queries : {
query1 : 'SELECT ' + streamFields + ' FROM stream WHERE filter_key IN
(SELECT filter_key
FROM stream_filter WHERE uid = me()) AND actor_id IN
(SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY
updated_time DESC
LIMIT 50',
query2 : 'SELECT uid, first_name, last_name FROM user WHERE uid IN
(SELECT actor_id
FROM #query1)'
}
},
function (response) {
});
FQL Multi-query
FB.api({
method : 'fql.multiquery',
queries : {
query1 : 'SELECT ' + streamFields + ' FROM stream WHERE filter_key IN
(SELECT filter_key
FROM stream_filter WHERE uid = me()
AND type="friendlist"
) AND actor_id IN
(SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY
updated_time DESC
LIMIT 50',
query2 : 'SELECT uid, first_name, last_name FROM user WHERE uid IN
(SELECT actor_id
FROM #query1)'
}
},
function (response) {
});
Graph API Explorer
• Live Demo
• http://developers.facebook.com/tools/explorer
Open Graph - Simple examples
• 2 main starting points:
- me
- me/home
• http://developers.facebook.com/docs/reference/api/field_expa
Open Graph VS FQL
• Different Focus:
- Open Graph easier to use
- FQL more powerful
• Be careful:
- different table structures
- different field names and types (even for “same” fields)
- different output JSON
WebRTC
Web RTC
• <video>
• MediaStream
• WebSockets (Signaling)
• PeerConnection
MediaStream - getUserMedia
video = document.createElement(‘video’);
...
n.getMedia = n.webkitGetUserMedia || n.mozGetUserMedia;
n.getMedia({
audio: true,
video: {
mandatory: {},
optional: []
}
}, function() {
video[moz ? 'mozSrcObject' : 'src'] = moz ? stream :
window.webkitURL.createObjectURL(stream);
video.play();
}, function (e) {
console.error(e);
});
Signaling
• Only time your own server is
needed
• Exchange information using
Session Description Protocol
(SDP)
Signaling
• Implementation left to developers
• Websocket or Ajax
- Channel based communication
- ‘default-channel’
- unique user token channel
RTCPeerConnection
function createOffer() {
if (!options.onOfferSDP) return;
peerConnection.createOffer(function (sessionDescription) {
sessionDescription.sdp =
getInteropSDP(sessionDescription.sdp);
peerConnection.setLocalDescription(sessionDescription);
options.onOfferSDP(sessionDescription);
}, null, constraints);
}
RTCPeerConnection
function createAnswer() {
if (!options.onAnswerSDP) return;
options.offerSDP = new SessionDescription(options.offerSDP);
peerConnection.setRemoteDescription(options.offerSDP);
peerConnection.createAnswer(function (sessionDescription) {
sessionDescription.sdp =
getInteropSDP(sessionDescription.sdp);
peerConnection.setLocalDescription(sessionDescription);
options.onAnswerSDP(sessionDescription);
}, null, constraints);
}
ICE & STUN & TURN
• Interactive Connectivity Establishment
• Session Traversal Utilities for NAT (STUN)
- stun.l.google.com:19302
• Traversal Using Relays around NAT (TURN)
• Run your own server
- https://code.google.com/p/rfc5766-turn-server/
- http://www.pjsip.org/pjnath/docs/html/
ICE Candidates
• Get automatically generated once SDP exchange
complete
• a=candidate:747209234 1 udp 1845501695 66.90.30.120
61920 typ srflx raddr 172.19.8.196 rport 61920 generation 0
• ICE Candidates must be sent through signaling server as
connection is not yet established until all candidates
received
PeerConnection.onaddstream
PeerConnection.onaddstream = function(event) {
var video = document.createElement(‘video’);
video[moz ? 'mozSrcObject' : 'src'] = moz ? stream :
webkitURL.createObjectURL(stream);
video.play();
...
};
Ensure video is flowing:
(video.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA
|| video.paused
|| video.currentTime <= 0)
WebRTC Future
• Mobile!
- Chrome Android
- Opera Mobile (not mini)
- Bowser
- Firefox mobile (planned)
- Blackberry
• SIP interop
WebRTC Resources
• PeerJS - http://peerjs.com/
- simplified communication & provided signaling server
- only supports DataChannel (no streaming)
• WebRTC Experiments & Demos -
https://www.webrtc-experiment.com/
- much lower level
- examples of video chat, screen sharing & DataChannels
• Adapter.js -
https://code.google.com/p/webrtc/source/browse/trunk/samp
- Chrome/Firefox polyfill
Take the Survey!
• Session Survey
- Available on the SenchaCon
mobile app
- http://app.senchacon.com
• Be Social!
- @SenchaCon
- #SenchaCon
- @tobiasuhlig
- @rwaters

More Related Content

What's hot

WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
Robert Nyman
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
Chang W. Doh
 

What's hot (20)

JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
Polymer / WebComponents
Polymer / WebComponentsPolymer / WebComponents
Polymer / WebComponents
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widget
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
 
Vue presentation
Vue presentationVue presentation
Vue presentation
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 Apps
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of us
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 
Vue business first
Vue business firstVue business first
Vue business first
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
 Cutting edge HTML5 API you can use today (by Bohdan Rusinka) Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
 
Solution to capture webpage screenshot with html2 canvas.js for backend devel...
Solution to capture webpage screenshot with html2 canvas.js for backend devel...Solution to capture webpage screenshot with html2 canvas.js for backend devel...
Solution to capture webpage screenshot with html2 canvas.js for backend devel...
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
 
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
 

Viewers also liked

Turist în orașul meu craiova
Turist în orașul meu  craiovaTurist în orașul meu  craiova
Turist în orașul meu craiova
Gheorghitoiumaria
 
Purist Presentation 052513
Purist Presentation 052513Purist Presentation 052513
Purist Presentation 052513
Norman Ash
 
Social media marketing from a bottom up perspective
Social media marketing from a bottom up perspectiveSocial media marketing from a bottom up perspective
Social media marketing from a bottom up perspective
Maxim Boiko Savenko
 
The victorian era[1]
The victorian era[1]The victorian era[1]
The victorian era[1]
Ada Villalba
 

Viewers also liked (20)

87693 heart attack1
87693 heart attack187693 heart attack1
87693 heart attack1
 
SugarCRM for Mac Users
SugarCRM for Mac UsersSugarCRM for Mac Users
SugarCRM for Mac Users
 
TAB
TABTAB
TAB
 
Adsuwak-Proyecto Startup Weekend Valencia 2014
Adsuwak-Proyecto Startup Weekend Valencia 2014Adsuwak-Proyecto Startup Weekend Valencia 2014
Adsuwak-Proyecto Startup Weekend Valencia 2014
 
The power of measuring tool for project mangement
The power of measuring tool for project mangement The power of measuring tool for project mangement
The power of measuring tool for project mangement
 
Charu's dossier
Charu's dossier Charu's dossier
Charu's dossier
 
Turist în orașul meu craiova
Turist în orașul meu  craiovaTurist în orașul meu  craiova
Turist în orașul meu craiova
 
Heros of islam
Heros of islamHeros of islam
Heros of islam
 
Remix trailers
Remix trailersRemix trailers
Remix trailers
 
Ojag naha vol13
Ojag naha vol13Ojag naha vol13
Ojag naha vol13
 
Purist Presentation 052513
Purist Presentation 052513Purist Presentation 052513
Purist Presentation 052513
 
Interactive scenario
Interactive scenarioInteractive scenario
Interactive scenario
 
CRM Training
CRM TrainingCRM Training
CRM Training
 
Social media marketing from a bottom up perspective
Social media marketing from a bottom up perspectiveSocial media marketing from a bottom up perspective
Social media marketing from a bottom up perspective
 
The Consumption function, Prof. Prabha Panth, Osmania University, Hyderabad
The Consumption function, Prof. Prabha Panth, Osmania University, HyderabadThe Consumption function, Prof. Prabha Panth, Osmania University, Hyderabad
The Consumption function, Prof. Prabha Panth, Osmania University, Hyderabad
 
About Acumin
About AcuminAbout Acumin
About Acumin
 
Staffing event IT
Staffing event ITStaffing event IT
Staffing event IT
 
A Windows Phone világa
A Windows Phone világaA Windows Phone világa
A Windows Phone világa
 
Microsoft Kurumsal sosyal ana_sunum_v3
Microsoft Kurumsal sosyal ana_sunum_v3Microsoft Kurumsal sosyal ana_sunum_v3
Microsoft Kurumsal sosyal ana_sunum_v3
 
The victorian era[1]
The victorian era[1]The victorian era[1]
The victorian era[1]
 

Similar to Pushing the Boundaries of Sencha and HTML5′s WebRTC

HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Patrick Lauke
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
smueller_sandsmedia
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
Kevin Decker
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
woutervugt
 
Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
Patrick Lauke
 

Similar to Pushing the Boundaries of Sencha and HTML5′s WebRTC (20)

HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
HTML5 and CSS3 refresher
HTML5 and CSS3 refresherHTML5 and CSS3 refresher
HTML5 and CSS3 refresher
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
 
Node azure
Node azureNode azure
Node azure
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile apps
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
Programming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioProgramming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.io
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Html 5
Html 5Html 5
Html 5
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Pushing the Boundaries of Sencha and HTML5′s WebRTC

  • 1. Tobias Uhlig, Solutions Engineer, Sencha Rich Waters, Chief Software Architect, Extnd LLC @tobiasuhlig @rwaters tobiu@sencha.com senchacon@rich-waters.com Pushing the Boundaries of Sencha and HTML5’s WebRTC
  • 2. Agenda • Google+ • Facebook • S-Circles • WebRTC
  • 4. Google+ Sign-In <!-- Place this asynchronous JavaScript just before your </body> tag --> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <span id="signinButton">...</span>
  • 5. Web 2.0 Google+ Sign-In loadGooglePlusApi : function() { window.onSignInCallback = function(authResult) { SCircles.app.fireEvent('googlePlusSignInCallback', authResult); }; var api = document.createElement('script'); Ext.apply(api, { async : true, type : 'text/javascript', src : 'https://plus.google.com/js/client:plusone.js' }); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(api, s); }
  • 7. Facebook Query Language • SQL-Style • Provides for some advanced features not available in the Graph API • Supports subqueries • Does not support (left) joining tables
  • 8. FQL - Simple examples SELECT name FROM user WHERE uid = me() SELECT uid, name, pic_square FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
  • 9. FQL Multi-query FB.api({ method : 'fql.multiquery', queries : { query1 : 'SELECT ' + streamFields + ' FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid = me()) AND actor_id IN (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY updated_time DESC LIMIT 50', query2 : 'SELECT uid, first_name, last_name FROM user WHERE uid IN (SELECT actor_id FROM #query1)' } }, function (response) { });
  • 10. FQL Multi-query FB.api({ method : 'fql.multiquery', queries : { query1 : 'SELECT ' + streamFields + ' FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid = me() AND type="friendlist" ) AND actor_id IN (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY updated_time DESC LIMIT 50', query2 : 'SELECT uid, first_name, last_name FROM user WHERE uid IN (SELECT actor_id FROM #query1)' } }, function (response) { });
  • 11. Graph API Explorer • Live Demo • http://developers.facebook.com/tools/explorer
  • 12. Open Graph - Simple examples • 2 main starting points: - me - me/home • http://developers.facebook.com/docs/reference/api/field_expa
  • 13. Open Graph VS FQL • Different Focus: - Open Graph easier to use - FQL more powerful • Be careful: - different table structures - different field names and types (even for “same” fields) - different output JSON
  • 14.
  • 16.
  • 17. Web RTC • <video> • MediaStream • WebSockets (Signaling) • PeerConnection
  • 18. MediaStream - getUserMedia video = document.createElement(‘video’); ... n.getMedia = n.webkitGetUserMedia || n.mozGetUserMedia; n.getMedia({ audio: true, video: { mandatory: {}, optional: [] } }, function() { video[moz ? 'mozSrcObject' : 'src'] = moz ? stream : window.webkitURL.createObjectURL(stream); video.play(); }, function (e) { console.error(e); });
  • 19. Signaling • Only time your own server is needed • Exchange information using Session Description Protocol (SDP)
  • 20. Signaling • Implementation left to developers • Websocket or Ajax - Channel based communication - ‘default-channel’ - unique user token channel
  • 21. RTCPeerConnection function createOffer() { if (!options.onOfferSDP) return; peerConnection.createOffer(function (sessionDescription) { sessionDescription.sdp = getInteropSDP(sessionDescription.sdp); peerConnection.setLocalDescription(sessionDescription); options.onOfferSDP(sessionDescription); }, null, constraints); }
  • 22. RTCPeerConnection function createAnswer() { if (!options.onAnswerSDP) return; options.offerSDP = new SessionDescription(options.offerSDP); peerConnection.setRemoteDescription(options.offerSDP); peerConnection.createAnswer(function (sessionDescription) { sessionDescription.sdp = getInteropSDP(sessionDescription.sdp); peerConnection.setLocalDescription(sessionDescription); options.onAnswerSDP(sessionDescription); }, null, constraints); }
  • 23. ICE & STUN & TURN • Interactive Connectivity Establishment • Session Traversal Utilities for NAT (STUN) - stun.l.google.com:19302 • Traversal Using Relays around NAT (TURN) • Run your own server - https://code.google.com/p/rfc5766-turn-server/ - http://www.pjsip.org/pjnath/docs/html/
  • 24. ICE Candidates • Get automatically generated once SDP exchange complete • a=candidate:747209234 1 udp 1845501695 66.90.30.120 61920 typ srflx raddr 172.19.8.196 rport 61920 generation 0 • ICE Candidates must be sent through signaling server as connection is not yet established until all candidates received
  • 25. PeerConnection.onaddstream PeerConnection.onaddstream = function(event) { var video = document.createElement(‘video’); video[moz ? 'mozSrcObject' : 'src'] = moz ? stream : webkitURL.createObjectURL(stream); video.play(); ... }; Ensure video is flowing: (video.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA || video.paused || video.currentTime <= 0)
  • 26. WebRTC Future • Mobile! - Chrome Android - Opera Mobile (not mini) - Bowser - Firefox mobile (planned) - Blackberry • SIP interop
  • 27. WebRTC Resources • PeerJS - http://peerjs.com/ - simplified communication & provided signaling server - only supports DataChannel (no streaming) • WebRTC Experiments & Demos - https://www.webrtc-experiment.com/ - much lower level - examples of video chat, screen sharing & DataChannels • Adapter.js - https://code.google.com/p/webrtc/source/browse/trunk/samp - Chrome/Firefox polyfill
  • 28. Take the Survey! • Session Survey - Available on the SenchaCon mobile app - http://app.senchacon.com • Be Social! - @SenchaCon - #SenchaCon - @tobiasuhlig - @rwaters

Editor's Notes

  1. fires as soon as we have a clue about a remote stream, but data will not be immediately flowing