402
Edge 12 458
Edge 13 400
521
Safari 9
Chrome 45
0
555
16
336
466
Internet Explorer 6
Internet Explorer 11
Firefox 41
desktop browsers results on html5test.com
Slide 10
Slide 11
?weird browsers? code.talks 2015 — september 30th 2015
Slide 12
browsers and devices that do not adhere to current expectations
Slide 13
if (‘ontouchstart’ in window) { element.addEventListener(‘touchstart’, function(e) { … }); } else { element.addEventListener(‘click’, function(e) { … }); }
Slide 14
Slide 15
?weird browsers?
Slide 16
?weird browsers?
Slide 17
game consoles
Slide 18
portable game consoles
Slide 19
smart tvs
Slide 20
e-readers
Slide 21
smartwatches
Slide 22
photo cameras
Slide 23
Andre Jay Meissner
cars
Slide 24
comparable with mobile before the iphone and android everybody is trying to figure it out
Slide 25
Slide 26
Slide 27
smart tvs, set-top boxes and consoles
Slide 28
“big screen browsers”
Slide 29
Slide 30
television browsers are pretty good the last generation of television sets use operating systems that originate from mobile
Slide 31
281
Google TV
418
LG WebOS 414 238
Panasonic Firefox OS
LG Netcast
0
555
301
407
Panasonic Samsung Viera 2014
465
Samsung Tizen 449
Opera Devices smart tv results on html5test.com
Slide 32
53
309
Playstation 3
Playstation TV
98
328
Xbox 360
Playstation 4
286
Xbox One
0
555
66
311
Wii
Wii U
console results on html5test.com
Slide 33
Slide 34
1 control
Slide 35
the biggest challenge of of television browsers
Slide 36
navigation (without mouse or touchscreen)
Slide 37
d-pad
Slide 38
navigation with the d-pad
Slide 39
but it can be worse: moving the cursor with the arrow keys
Slide 40
alternatives
Slide 41
analog controllers
Slide 42
remotes with trackpad
Slide 43
remotes with airmouse
Slide 44
second screen
Slide 45
many manufacturers also create apps for controlling the smart tv, console or set-top box
Slide 46
Slide 47
Slide 48
Slide 49
text input (without keyboard)
Slide 50
d-pads
Slide 51
text input with the d-pad
Slide 52
alternatives
Slide 53
remotes with keyboards
Slide 54
wireless keyboards
Slide 55
and apps
Slide 56
Slide 57
Slide 58
gesture control (throw your hands up in the air, and wave ’em like you just don’t care)
Slide 59
navigation with gesture control
Slide 60
can we control these input methods directly from javascript?
complication:
meta viewport is not supported it is not possible to get the same layout viewport width in all of the different browsers
Slide 97
complication:
device pixel ratio is not supported there is no proper way to show images with the same resolution as the physical screen
Slide 98
800 pixels
nintendo wii
Slide 99
980 pixels
nintendo wii u
Slide 100
960 pixels
lg webos
Slide 101
1024 pixels
google tv
Slide 102
1041 of 1050 pixels
microsoft xbox 360
Slide 103
1200 of 1236 pixels
microsoft xbox one
Slide 104
1226 pixels
lg netcast
Slide 105
1824 pixels
sony playstation 3
Slide 106
1920 pixels
sony playstation 4
Slide 107
Nintendo Wii
800
LG WebOS
960
Nintendo Wii U
980
Philips 2014 series
980
Google TV
1024
Playstation TV
1024
Samsung Tizen
1024
Xbox 360
1051
Xbox One
1200
LG Netcast
1226
Panasonic Viera
1256
Opera Devices
1280
Samsung 2014 series
1280
Panasonic Firefox OS
1536
Playstation 3
1824
Playstation 4
1920
Slide 108
device pixels != device pixels (of course not)
Slide 109
sometimes devices pixels are not physical devices pixels, but virtual device pixels the browser renders in a lower resolution which is upscaled to the resolution of the display
Slide 110
3 distance to the screen
Slide 111
“Make fonts and graphics on the site larger to account for viewing distance. People sit proportionally farther from a TV than from a computer monitor of the same size.” – Internet Explorer for Xbox One Developer Guide
https://msdn.microsoft.com/en-us/library/dn532261(v=vs.85).aspx
Slide 112
fluid design++
the size of the contents is determined by the width of the viewport
Slide 113
1
use percentages for positioning .left { width: 60%; } .right { left: 60%; width: 40%; }
Slide 114
2
base the fontsize on the viewport document.body.style.fontSize = ((window.innerWidth / 1920) * 300) + ‘%’;
Slide 115
3
or maybe use viewport units – with polyfill body { font-size: 3vw; } .left { width: 60vw; height: 100vh; } .right { width: 40vw; height: 100vh; }
Slide 116
4
use a safe margin around the contents body { padding: 5%; }
Slide 117
youtube tv website
Slide 118
identifying smart tv’s (css for televisions)
Slide 119
1
×
css media types @media tv { body {
font-size: 300%; } }
Slide 120
1
css media types
all television browsers use the css media type ‘screen’
3
useragent sniffing
not all smart tv’s are recognisable Mozilla/5.0 (X11; Linux; ko-KR) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+
Slide 125
4
couch mode
the only reliable way to optimise a website for television is to make two different websites… or give the user the ability to switch on couch mode
Slide 126
4 be careful with feature detection
Slide 127
“Basically every feature that talks to the operating system or hardware, is suspect.” – Me
http://blog.html5test.com/2015/08/the-problems-with-feature-detection/
Slide 128
if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition( success, failure ); } else { // alternative }
Slide 129
if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition( success, failure ); }
1
failure is called with a “permission denied” error code
2
no callback at all to success or failure
Slide 130
if (!!navigator.geolocation) { navigator.geolocation.getCurrentPosition( success, failure ); }
3
success is called with longitude = 0 and latitude = 0
4
success is called with the coordinates of Mountain View, USA
Slide 131
is there a future for web apps on the big screen?
Slide 132
Slide 133
the new apple tv does not ship with a browser by default
Slide 134
android tv does not ship with a browser by default
Slide 135
Slide 136
e-readers
Slide 137
187
280
Kindle Touch
Kobo
157
Sony Reader
0
555
52
196
Kindle 3
Pocketbook
e-reader results on html5test.com