SlideShare ist ein Scribd-Unternehmen logo
1 von 135
Downloaden Sie, um offline zu lesen
@almirfilho
@caio_gondim
@loopinfinito
HTML5Sensitivo
Seubrowser+LSD
Acessoa
dispositivos
APIsdoAlém
APIsdoAlém
Acelerômetro
APIsdoAlém
Acelerômetro
Geolocalização
APIsdoAlém
Acelerômetro
Geolocalização
Câmera
APIsdoAlém
Acelerômetro
Geolocalização
Câmera
Microfone
@caio_gondim
@almirfilho
@loopinfinito
loopinfinito.com.br
APIsdoAlém
Acelerômetro
Geolocalização
Câmera
Microfone
Acelerômetro
Orientação
&
Aceleração
Sistemade
Coordenadas
y
Sistemade
Coordenadas
y
x
Sistemade
Coordenadas
z
y
x
Sistemade
Coordenadas
Rotação
z
y
x
Rotação
alpha
z
y
x
Rotação
z
y
x
beta
Rotação
z
y
x
gamma
API
API
DeviceOrientationEvent
DeviceMotionEvent
Orientação
DeviceOrientationEvent
Obtéma
Rotaçãodoseixos
zyx
Obtéma
Rotaçãodoseixos
zyx
gammabeta alpha
Obtéma
Rotaçãodoseixos
emgraus
gammabeta alpha
z
alpha = 0º
z
alpha = 25º
x
beta = 0º
x
beta = 30º
y
gamma = 0º
y
gamma = 45º
JavaScript
porfavor!
if( window.DeviceOrientationEvent != undefined ){
// suporte garantido =)
}
Testeosuporte
window.addEventListener( ‘deviceorientation’,
function( eventData ){
// faça acontecer
}
)
Trateoevento
eventData = {
alpha: 0.01042012, // graus
beta: 11.34221344, // graus
gamma: 27.102012102, // graus
absolute: true,
... // propriedades de Event
}
Dadosde
deviceorientation
Aceleração
DeviceMotionEvent
Obtémdados
sobremovimentos
físicosemcadaeixo
Obtémdados
sobremovimentos
físicosemcadaeixo
zyx
zyx
emm/s²
if( window.DeviceMotionEvent != undefined ){
// suporte garantido =)
}
Testeosuporte
window.addEventListener( ‘devicemotion’,
function( eventData ){
// faça acontecer
}
)
Trateoevento
eventData = {
interval: 200, // milisegundos
acceleration: {
x: 0.1534532, // metro/s²
y: 3.9876581, // metro/s²
z: 1.0092722 // metro/s²
},
accelerationIncludingGravity: { x, y, z }, // idem
rotationRate: { alpha, beta, gamma } // orientation
... // propriedades de Event
}
Dadosdedevicemotion
DEMO
almirfilho.github.com/cilada
SuporteDesktop
SuporteDesktop
7 6
(parcial)(parcial)
SuporteMobile
SuporteMobile
184.2
3.012 10
15
Geolocalização
Acelerômetro
APIsdoAlém
Câmera
Microfone
Geolocalização
Posiçãoemrelaçãoa
superfíciedoplaneta
serviçosdemapas
redessociais
aplicaçõese-gov
Quemusa?
Localização=Contexto
Localização=Contexto
Maiorrelevância
Busca
&
Recomendação
maiseficazes
Obtendoa
Geolocalização
DesktopxMóvel
Desktop
Posição
Localização
fixa
aproximada
Móvel
Posição
Localização
variável
maisexata
API
API
navigator.geolocation
if( navigator.geolocation != undefined ){
// suporte garantido =)
}
Testeosuporte
// requisitando geolocalização
navigator.geolocation.getCurrentPosition( showMap )
// setando o callback
function showMap( position ){
// só alegria
}
Definaocallback
Dadosde.getCurrentPosition
position = {
timestamp: 307770135, // DOMTimeStamp
	 coords: {
	 	 accuracy: 12, // metros
	 	 latitude: -35.29873363499, // graus
	 	 longitude: 123.44334887755,// graus
	 	 altitude: 400.3, // metros (opcional)
	 	 heading: 45.5, // graus (opcional)
	 	 speed: 5.4 // m/s (opcional)
	 }
}
DEMO
almirfilho.github.com/fulltheface
SuporteDesktop
SuporteDesktop
5 3.5
9
5
10.6
SuporteMobile
SuporteMobile
183.2
2.111 7
15
Geolocalização
Acelerômetro
APIsdoAlém
Câmera
Microfone
Câmera
WebRTC
WebRTC
Real-Time
Communications
API
API
Stream
Media Capture
API
Stream
Stream
input
<video>
MediaStream
MediaStream
Track
video
MediaStream
Track
audio
PeerConection
API
Media Capture
// sem prefixos dos vendors
if ( navigator.getUserMedia ){
// câmera, ação!
}
Testeosuporte
navigator.getUserMedia(
{ video: true },
sucessoCallback,
falhaCallback
)
Permissão
function sucessoCallback(stream) {
var video = document.getElementsByTagName(‘video’)[0]
video.autoplay = true
video.src = window.webkitURL.createObjectURL(stream)
}
Linkandono
<video>
Mixcom
<canvas>
Mixcom
WebGL
DEMO
caiogondim.github.com/webpix
SuporteDesktop
SuporteDesktop
21
12.0
SuporteMobile
SuporteMobile
Câmera
Geolocalização
Acelerômetro
APIsdoAlém
Microfone
Microfone
API
API
Web Speech
Media Capture
Web Speech
Reconhecimento
&Síntese
devoz
Reconhecimento
devoz
Síntesedevoz
if ( document.createElement( ‘input’ ).webkitSpeech != undefined )
{
// suporte garantido =)
}
Testeosuporte
<input type=”text” x-webkit-speech />
MarcaçãoHTML
{ }
document
.getElementsByTagName( ‘input’ )[0]
.addEventListener( ‘webkitspeechchange’,
function( eventData ){
// sua mágica
}
)
Evento
eventData = {
results: [
{
confidence: 0.61285305,
utterance: ‘praia’
},
...
],
... // propriedades de Event
}
Dadosde
webkitspeechange
DEMO
caiogondim.github.com/hal
SuporteDesktop
SuporteDesktop
22*
Capturade
Áudio
Media Capture
Baixo
Nível
Baixa
Latência
Guitarra
Micexterno
...
// sem prefixos dos vendors
if ( navigator.getUserMedia ){
// we got it!
}
Testeosuporte
navigator.getUserMedia(
{ audio: true },
sucessoCallback,
falhaCallback
)
Permissão
Mixcom
WebAudio
function sucessoCallback( stream ) {
var context = new webkitAudioContext()
var mediaStreamSource = context
.createMediaStreamSource( stream )
mediaStreamSource.connect( filter1 )
...
filter1.connect( context.destination )
}
Callback
DEMO
SuporteDesktop
SuporteDesktop
216
SuporteMobile
SuporteMobile
6
Câmera
Geolocalização
Acelerômetro
APIsdoAlém
Microfone
?
@loopinfinito
@almirfilho
@caio_gondim
Obrigado!
Estetrabalhoélicenciadopela
CreativeCommons
http://creativecommons.org.br/as-licencas/

Weitere ähnliche Inhalte

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

HTML5 Sensitivo: Seu browser no plano astral