93
Web on TV THE JOY AND (MOSTLY) PAIN OF TV DEVELOPMENT Patrick H. Lauke / jQuery Europe / Vienna / 23 February 2013

Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

Embed Size (px)

Citation preview

Page 1: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

Web on TV THE JOY AND (MOSTLY) PAIN OF TV DEVELOPMENT

Patrick H. Lauke / jQuery Europe / Vienna / 23 February 2013

Page 2: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 3: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

“web” on TV is nothing new

Page 4: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 5: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 6: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 7: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 8: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

CE-HTMLXHTML 1.0, CSS 2.1, DOM Level 2,

Ajax, special APIs for TV

hbbtv.org

Page 9: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 10: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 11: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

“Smart” TV = runs apps (optionally, has a web browser)

Page 12: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

Apps● native apps (Android, Apple TV, ...)● packaged web apps (W3C widgets or similar)● “in the cloud” (they're URLs)

Page 13: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 14: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 15: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 16: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 17: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 18: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 19: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 20: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 21: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 22: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developing for TV

Page 23: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

1. display size2. input mechanisms3. features/performance

Page 24: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

1. display size2. input mechanisms3. features/performance

Page 25: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 26: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 27: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 28: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 29: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 30: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 31: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 32: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 33: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

720×576960×540

1280×7201920×1080

Page 34: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

CSS 2 Media Types?

Page 35: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

Media types

all brailleembossed handheldprint projectionscreen speechtty tv

Page 36: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 37: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 38: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

<!-- mobile/tablet viewport sanity -->

<meta name=”viewport” content=”width=device-width”>

<!-- but TVs don't support viewport -->

Page 39: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

old-school browser sniffing

http://www.flickr.com/photos/timdorr/2096272747/

Page 40: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

/* Still make it responsive/adaptive */

/* Full HD */@media screen and (min-width: 1920px) { … }

/* HD-Ready */@media screen and (min-width: 1280px) and (max-width: 1920px) { … }

/* Smaller */@media screen and (max-width: 1280px) { … }

Page 41: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

● large text and images● large UI elements for interaction● minimise scrolling

Page 42: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

1. display size2. input mechanisms3. features/performance

Page 43: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

● mouse pointer (“magic” remotes)● spatial navigation (Opera only?)● D-pad key events

Page 44: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 45: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

● not very precise (giant mouse pointer)● scrolling can be an issue

Page 46: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 47: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 48: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

Opera-specific: spatial navigationShift + cursor keys

focusable elements and elements with mouseover / click

Page 49: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

don't lose your focusa:focus, button:focus { … }

Page 50: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 51: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

blah.addEventListener("keydown", function(e) {…

switch (e.keyCode) {case 37:

// leftbreak;

case 38:// upbreak;

case 39:// rightbreak;

…}

}, useCapture);

// Fun fact: key codes can vary between devices!

Page 52: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

blah.addEventListener("keydown", function(e) {

e.preventDefault(); // prevent Opera's spatnav

}, useCapture);

Page 53: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

var VK_ENTER = 13; var VK_RED = 403;var VK_PAUSE = 19; var VK_GREEN = 404;var VK_PAGE_UP = 33; var VK_YELLOW = 405;var VK_PAGE_DOWN = 34; var VK_BLUE = 406;var VK_LEFT = 37; var VK_REWIND = 412;var VK_UP = 38; var VK_STOP = 413;var VK_RIGHT = 39; var VK_PLAY = 415;var VK_DOWN = 40; var VK_FAST_FWD = 417;var VK_0 = 48; var VK_INFO = 457;var VK_1 = 49; var VK_BACK = 461;var VK_2 = 50;var VK_3 = 51;var VK_4 = 52;var VK_5 = 53;var VK_6 = 54;var VK_7 = 55;var VK_8 = 56;var VK_9 = 57;

Page 54: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

// abstracted VK_ globals … better?

blah.addEventListener("keydown", function(e) {…

switch (e.keyCode) {case VK_LEFT:

// leftbreak;

case VK_UP:// upbreak;

case VK_RIGHT:// rightbreak;

…}

}, useCapture);

Page 56: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

// DOM Level 3 … better?

blah.addEventListener("keydown", function(e) {…

switch (e.key) {case 'Left':

// leftbreak;

case 'Up':// upbreak;

case 'Right':// rightbreak;

…}

}, useCapture);

Page 57: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

key repeats and lag[keydown]+ > keyup

[keydown > keyup]+

Page 58: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

minimise form input / text entry

Page 59: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 60: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 61: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

1. display size2. input mechanisms3. features/performance

Page 62: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

tl;drdesign like for mobiles … 5 years ago

Page 63: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 64: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

www.webkit.org/perf/sunspider/...

Page 65: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 66: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

CSS3 transitions / animations vs JS

Page 68: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 69: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 70: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

microjs.com

Page 71: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developer.lge.com

Page 72: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 73: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

html5test.com

Page 74: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 75: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 76: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

// Feature detect?

var hasStorage = (function() {try {

localStorage.setItem(mod, mod);localStorage.removeItem(mod);return true;

} catch(e) {return false;

}}());

Page 77: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

dev-test.nemikor.com/web-storage/support-test

Page 78: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 79: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 80: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

no magic bullet...

Page 81: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

testing and debugging

Page 82: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 83: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 84: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developer.lge.com

Page 85: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developer.vieraconnect.com

Page 86: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developer.vieraconnect.com

Page 87: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

samsungdforum.com

Page 88: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

developers.google.com/tv

Page 89: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013
Page 90: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

opera.com/business/tv/emulator

Page 91: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

dev.opera.com/tv

Page 92: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

console.maban.co.uk

Page 93: Web on TV - the joy and (mostly) pain of TV development / jQuery Europe / Vienna 23.02.2013

@patrick_h_laukeslideshare.net/redux