SlideShare a Scribd company logo
1 of 162
Download to read offline
HTML5
Friend or Foe?
The Open Web
  Friend or Foe?
Remy Sharp.
Non-Flash-er.
http://remysharp.com/html5-spell-death-to-flash/
"Flash is dead!"
Is Flash is dead?
Should Flash
be worried?
Video killed the
radio Flash star?
http://youtube.com/watch?v=uofWfXOzX-g
Flash based

ā€¢ Capture video
ā€¢ Encode to FLV
ā€¢ Upload/create SWF to play FLV
ā€¢ Copy & paste <object> code
Flash based

ā€¢ Capture video
ā€¢ Encode to FLV
ā€¢ Upload/create SWF to play FLV
         create

ā€¢ Copy & paste <object> code
Open web based

ā€¢ Capture video
ā€¢ Encode to mp4
ā€¢ Add
  <video src="foo.mp4" />
<video src="dizzy.mp4" />
<video src="dizzy.mp4" controls/>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset=utf-8 />
  <title>Video Example</title>
</head>
<body>
<video src="dizzy.mp4" controls/>
</body>
</html>
Scripting
var video = document.getElementsByTagName('video')[0];
if (video.paused) {
  video.play();
}
var video = document.getElementsByTagName('video')[0];
if (video.paused) {
  video.play();
}

// position & asTime defined elsewhere
video.addEventListener('timeupdate', function () {
  positon.innerHTML = asTime(this.currentTime);
}, false);
API
ā€¢   play(), pause(), canPlayType(t)
API
ā€¢   play(), pause(), canPlayType(t)

ā€¢   currentTime, paused, duration,
    loop, autoplay, muted, volume, etc
API
ā€¢   play(), pause(), canPlayType(t)

ā€¢   currentTime, paused, duration,
    loop, autoplay, muted, volume, etc

ā€¢   progress, stalled, play, pause,
    waiting, canplay, seeking,
    timeupdate
Fullscreen?
Warning! User agents should not provide a public API to cause
videos to be shown full-screen. A script, combined with a carefully
crafted video ļ¬le, could trick the user into thinking a system-modal
dialog had been shown, and prompt the user for a password. There is
also the danger of "mere" annoyance, with pages launching full-
screen videos when links are clicked or pages navigated. Instead,
user-agent speciļ¬c interface features may be provided to easily allow
the user to obtain a full-screen playback mode.
Warning! User agents should not provide a public API to cause
videos to be shown full-screen. A script, combined with a carefully
crafted video ļ¬le, could trick the user into thinking a system-modal
dialog had been shown, and prompt the user for a password. There is
also the danger of "mere" annoyance, with pages launching full-
screen videos when links are clicked or pages navigated. Instead,
user-agent speciļ¬c interface features may be provided to easily allow
the user to obtain a full-screen playback mode.
Pros
Pros

ā€¢ No plugins required
Pros

ā€¢ No plugins required
ā€¢ Simple API: play(), pause() etc
Pros

ā€¢ No plugins required
ā€¢ Simple API: play(), pause() etc
ā€¢ Video & Audio API the same
Pros

ā€¢ No plugins required
ā€¢ Simple API: play(), pause() etc
ā€¢ Video & Audio API the same
ā€¢ Player chrome is HTML & CSS
Cons
Cons

ā€¢ Accessibility?
Cons

ā€¢ Accessibility?
Cons

ā€¢ Accessibility?
ā€¢ Codecs
Cons

ā€¢ Accessibility?
ā€¢ Codecs
ā€¢ IE
<video src="dizzy.mp4" controls/>
<video controls>
  <source src="dizzy.ogv" />
  <source src="dizzy.mp4" />
</video>
Video for Everybody
<video width="640" height="360" poster="dizzy.jpg" controls>
  <source src="dizzy.ogv" type="video/ogg" />
  <source src="dizzy.mp4" type="video/mp4" /><!--[if gt IE 6]>
  <object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!
  [endif]--><!--[if !IE]><!-->
  <object width="640" height="375" type="video/quicktime" data="dizzy.mp4">
  <!--<![endif]-->
  <param name="src" value="dizzy.mp4" />
  <param name="showlogo" value="false" />
  <object width="640" height="380" type="application/x-shockwave-flash"
    data="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4">
    <param name="movie" value="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4" />
    <img src="dizzy.jpg" width="640" height="360" alt="Title of video"
         title="No video playback capabilities, please download the video below" />
  </object><!--[if gt IE 6]><!--></object><!--<![endif]-->
</video>
<p>Download Video: <a href="dizzy.mp4">High Quality "MP4"</a> | <a href="dizzy.ogv">Low
Quality "OGG"</a></p>




   http://camendesign.com/code/video_for_everybody
Flash will be
needed for video
 for a while yet.
fonts
sIFR & Cufon
ā€¢ Native font rendering
ā€¢ IE works via EOT

ā€¢ Doesn't work in Firefox 3 - 7%
Streaming
Sockets
ā€¢ Pushed data relies on Flash
ā€¢ Pushed data relies on Flash
ā€¢ If no Flash, switches to polling
ā€¢ Pushed data relies on Flash
ā€¢ If no Flash, switches to polling
ā€¢ Polling bad for high concurrency
ā€¢ Had to work in corporate environment
ā€¢ Corp env were blocking odd traffic &
  Flash

ā€¢ Needed to be pure JS solution
ā€¢ It's possible, but complicated
WebSocket
var ws = new WebSocket("ws://hostname:80/");

ws.onmessage = function (event) {
   // message in, let's convert it to JSON
   var data = JSON.parse(event.data);
};

ws.onclose = function () {};

ws.onopen = function () {};
var ws = new WebSocket("ws://localhost:8080/");
ws.onmessage = function(event) {
  var data = JSON.parse(event.data);
  var p = $(twitterlib.render(data));
  if( $('#tweets > li').length > 15) {
    $('#tweets >li:last').slideDown(100, function() {
      $(this).remove();
    });
  }

  $('#tweets').prepend(p);
  p.slideDown(140);
};
ws.onclose = function() {
   alert("socket closed");
};
ws.onopen = function() {
   //alert("connected...");
};
Graphics
2D Graphics
Canvas
Google Analytics - Flash charts




Interactive Demo - Canvas charts
Let's get technical
<!DOCTYPE html>
<html>
<head>
  <title>Canvas</title>
</head>
<body>
  <canvas></canvas>
</body>
</html>
var ctx = canvas.getContext('2d');
var ctx = canvas.getContext('2d');

// Create radial gradient
var grad = ctx.createRadialGradient(0,0,0,0,0,600);
var ctx = canvas.getContext('2d');

// Create radial gradient
var grad = ctx.createRadialGradient(0,0,0,0,0,600);
grad.addColorStop(0, '#E4E4E4');
grad.addColorStop(1, '#000');
var ctx = canvas.getContext('2d');

// Create radial gradient
var grad = ctx.createRadialGradient(0,0,0,0,0,600);
grad.addColorStop(0, '#E4E4E4');
grad.addColorStop(1, '#000');

// assign gradients to fill
ctx.fillStyle = grad;
var ctx = canvas.getContext('2d');

// Create radial gradient
var grad = ctx.createRadialGradient(0,0,0,0,0,600);
grad.addColorStop(0, '#E4E4E4');
grad.addColorStop(1, '#000');

// assign gradients to fill
ctx.fillStyle = grad;

// draw 600x600 fill
ctx.fillRect(0,0,600,600);
Let's mix it up
http://html5demos.com/canvas-grad
body.onmousemove = function (event) {
  var width = window.innerWidth,
      height = window.innerHeight,
      x = event.clientX,
      y = event.clientY,
      rx = 600 * x / width,
      ry = 600 * y / width;

     var xc = parseInt(256 * x / width);
     var yc = parseInt(256 * y / height);

     grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600);
     grad.addColorStop(0, '#000');
     grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')');

     ctx.fillStyle = grad;
     ctx.fillRect(0,0,600,600);
};

              http://html5demos.com/canvas-grad
body.onmousemove = function (event) {
  var width = window.innerWidth,
      height = window.innerHeight,           Caclulate from
      x = event.clientX,                     the mouse the
      y = event.clientY,                       radius and
      rx = 600 * x / width,
      ry = 600 * y / width;
                                                colours

     var xc = parseInt(256 * x / width);
     var yc = parseInt(256 * y / height);

     grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600);
     grad.addColorStop(0, '#000');
     grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')');

     ctx.fillStyle = grad;
     ctx.fillRect(0,0,600,600);
};

              http://html5demos.com/canvas-grad
body.onmousemove = function (event) {
  var width = window.innerWidth,
      height = window.innerHeight,
      x = event.clientX,
      y = event.clientY,
      rx = 600 * x / width,
      ry = 600 * y / width;
                 Re-render the
     var xc =       gradient
              parseInt(256 * x / width);
     var yc = parseInt(256 * y / height);

     grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600);
     grad.addColorStop(0, '#000');
     grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')');

     ctx.fillStyle = grad;
     ctx.fillRect(0,0,600,600);
};

              http://html5demos.com/canvas-grad
body.onmousemove = function (event) {
  var width = window.innerWidth,
      height = window.innerHeight,
      x = event.clientX,
      y = event.clientY,
      rx = 600 * x / width,
      ry = 600 * y / width;

     var xc = parseInt(256 * x / width);
     var yc = parseInt(256 * y / height);
                                    Set the new ļ¬ll
     grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600);
     grad.addColorStop(0, '#000'); style and reļ¬ll -
                                     the browser
     grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')');
                                   handles the hard
     ctx.fillStyle = grad;
     ctx.fillRect(0,0,600,600);
                                         work
};

              http://html5demos.com/canvas-grad
body.onmousemove = function (event) {
  var width = window.innerWidth,
      height = window.innerHeight,
      x = event.clientX,
      y = event.clientY,
      rx = 600 * x / width,
      ry = 600 * y / width;

     var xc = parseInt(256 * x / width);
     var yc = parseInt(256 * y / height);

     grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600);
     grad.addColorStop(0, '#000');
     grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')');

     ctx.fillStyle = grad;
     ctx.fillRect(0,0,600,600);
};

              http://html5demos.com/canvas-grad
canvas.toDataURL("image/png");
canvas.toDataURL("image/png");
data:image/
png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAFxUlEQVR4Ae3dQW5jORAEUXvQ97+yez
CzNQpNyPwdIp+XJkVlRTKgheGvz69/fz78IIDAtwT+
+fa3fokAAv8RIIiLgMBAgCADHEsIEMQdQGAgQJABjiUECOIOIDAQIMgAxxICBHEHEBgIEGSAYwkBgrgDCAwECDLAs
YQAQdwBBAYCBBngWEKAIO4AAgMBggxwLCFAEHcAgYEAQQY4lhAgiDuAwECAIAMcSwj8+nEEn58/
fuQfHehf6/8Ik01rBHyCrPGy+zICBLmscOOuESDIGi+7LyNAkMsKN
              data:image/png;base64,...
+4aAYKs8bL7MgIEuaxw464RIMgaL7svI0CQywo37hoBgqzxsvsyAgS5rHDjrhEgyBovuy8jQJDLCjfuGgGCrPGy
+zICBLmscOOuESDIGi+7LyNAkMsKN
+4aAYKs8bL7MgIEuaxw464RIMgaL7svI0CQywo37hoBgqzxsvsyAgS5rHDjrhEgyBovuy8jQJDLCjfuGgGCrPGy
+zICBLmscOOuESDIGi+7LyNAkMsKN+4aAYKs8bL7MgI//3R3T1m/
7AqdPa5PkLP7Nd2LBAjyIkAvP5sAQc7u13QvEiDIiwC9/
GwCBDm7X9O9SIAgLwL08rMJEOTsfk33IgGCvAjQy88mQJCz+zXdiwR+/i/pLwba/fLPj7/zPe5fH1+7R3P+BgI
+QTZAdeQ5BAhyTpcm2UCAIBugOvIcAgQ5p0uTbCBAkA1QHXkOAYKc06VJNhAgyAaojjyHAEHO6dIkGwgQZANUR55D
gCDndGmSDQQIsgGqI88hQJBzujTJBgIE2QDVkecQIMg5XZpkAwGCbIDqyHMIEOScLk2ygQBBNkB15DkECHJOlybZQ
IAgG6A68hwCBDmnS5NsIECQDVAdeQ4BgpzTpUk2ECDIBqiOPIcAQc7p0iQbCBBkA1RHnkOAIOd0aZINBAiyAaojzy
FAkHO6NMkGAgTZANWR5xC47ununrJ+zuV9YhKfIE9Q9h5vS4Agb1ud4E8QIMgTlL3H2xIgyNtWJ/
gTBAjyBGXv8bYECPK21Qn+BAGCPEHZe7wtAYK8bXWCP0GAIE9Q9h5vS+C6v6TXm/r8O1/j/vHla9y/vRo
+Qb7F4pcI/E
+AIG4CAgMBggxwLCFAEHcAgYEAQQY4lhAgiDuAwECAIAMcSwgQxB1AYCBAkAGOJQQI4g4gMBAgyADHEgIEcQcQGAg
QZIBjCQGCuAMIDAQIMsCxhABB3AEEBgIEGeBYQoAg7gACAwGCDHAsIUAQdwCBgQBBBjiWECCIO4DAQIAgAxxLCBDE
HUBgIECQAY4lBAjiDiAwECDIAMcSAgRxBxAYCBBkgGMJAU93j90BT1lvFeITpNWHNDECBIkVIk6LAEFafUgTI0CQW
CHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBI
kVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0C
QWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDEC
BIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI
0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHND
ECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUg
TI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECvwHnaxGSkEUPVAAAAABJRU5ErkJggg==
Canvas
     +
drawImage
     +
   Video
     =
http://blog.mozbox.org/post/2009/04/12/Firefox-35%3A-a-new-experiment-with-Canvas-Video
ctx.translate(canvas.width/2, canvas.height/2);
ctx.scale(-1, 1);
ctx.translate(-canvas.width/2, -canvas.height/2);

ctx.drawImage(
  video, 0, 0,
  video.width,
  video.height,
  0, 0,
  canvas.width,
  canvas.height);




http://html5demos.com/video-canvas
ctx.translate(canvas.width/2, canvas.height/2);
ctx.scale(-1, 1);
ctx.translate(-canvas.width/2, -canvas.height/2);

ctx.drawImage(
  video, 0, 0,
  video.width,
  video.height,
  0, 0,
  canvas.width,
  canvas.height);




http://html5demos.com/video-canvas
ctx.getImageData(0, 0, w, h);
ctx.getImageData(0, 0, w, h);


        0   1    2    3


   0    r   g    b    a


   1    r   g    b    a


  ...   r   g    b    a
pixels.data[i * 4 + 0];


      0   1    2    3


 0    r   g    b    a


 1    r   g    b    a


...   r   g    b    a
pixels.data[i * 4 + 1];


      0   1    2    3


 0    r   g    b    a


 1    r   g    b    a


...   r   g    b    a
pixels.data[i * 4 + 2];


      0   1    2    3


 0    r   g    b    a


 1    r   g    b    a


...   r   g    b    a
pixels.data[i * 4 + 3];


      0   1    2    3


 0    r   g    b    a


 1    r   g    b    a


...   r   g    b    a
for (i = 0; i   < pixels.data.length / 4; i++) {
  totals.r +=   pixels.data[i * 4 + 0]; // r
  totals.g +=   pixels.data[i * 4 + 1]; // g
  totals.b +=   pixels.data[i * 4 + 2]; // b
}

var r =   parseInt(totals.r / (w*h)),
    g =   parseInt(totals.g / (w*h)),
    b =   parseInt(totals.b / (w*h)),
    rgb   = [r, g, b].join(',');
SVG
...using Flash!
segue: just like
screaming monkey
3D
CSS
Yeah, 3D CSS.
#canvas {
  -webkit-perspective: 800;
  -webkit-perspective-origin: 50% 20em;
}

#rubiks {
  -webkit-transform-style: preserve-3d;
  -webkit-transform: rotateX(15deg) rotateY(15deg);
}

#rubiks .face1 {
  -webkit-transform: rotateX(90deg) translateZ
(10.8em);
}

#rubiks .face2 { /* front */
  -webkit-transform: translateZ(10.8em);
}

#rubiks .face3 {
  -webkit-transform: rotateY(90deg) translateZ
WebGL
Mobile?
Offline
Offline Apps


ā€¢   Application cache / manifest

ā€¢   Events: offline, online
ā€¢   navigator.onLine property
Offline Apps


ā€¢   Application cache / manifest

ā€¢   Events: offline, online
http://icanhaz.com/rubiks
http://icanhaz.com/rubiks
Using a Manifest
<!DOCTYPE html>
<html manifest="my.manifest">
<body>
<!-- my page -->
</body>
</html>
Using a Manifest
<!DOCTYPE html>
<html manifest="my.manifest">
<body>
<!-- my page -->
</body>
</html>
my.manifest
CACHE MANIFEST
app.html
css/style.css
js/app.js
#version 13
The Manifest

1. Serve as text/manifest, by
   adding to mime.types:

text/cache-manifest manifest
The Manifest

2. First line must be:


    CACHE MANIFEST
The Manifest

3. Including page is implicitly
   included in the cache.
The Manifest

4. Two futher namespaces:
   NETWORK & FALLBACK

    FALLBACK:
    / offline.html
The Manifest

5. Include some versioning to
   cache bust your manifest


      # version 16
The process
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
Browser: request   Server: serve all   manifest, cache
                                           assets



                       Browser:
 Server: serve
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
Browser: I have a
     Problem:
Browser: request   Server: serve all   manifest, cache
                                           assets
     Change of content
     requiresBrowser:
 Server: serve
               2 refreshes
                   applicationCache    Browser: reload
manifest assets
                       updated



                     Browser: only
Browser: serve                          Server: 304 Not
                   request manifest
   locally                                 Modified
                         file
applicationCache.onUpdateReady =
function () {
   applicationCache.swapCache();
   notice('reload');
};

window.onOnline =
function () {
   // fire an update to the cache
   applicationCache.update();
};
Web Workers
ā€¢   "Threads"
ā€¢"Threads"

ā€¢ Sandboxed
ā€¢"Threads"

ā€¢ Sandboxed
ā€¢ Debugging can be tricky
http://html5demos.com/worker
app.html
var w = new Worker('worker.js');
app.html
var w = new Worker('worker.js');

w.onmessage = function (event) {
   alert("msg: " + event.data);
};
app.html
var w = new Worker('worker.js');

w.onmessage = function (event) {
   alert("msg: " + event.data);
};

w.postMessage('run');
worker.js
onmessage = function (event) {
   if (event.data == 'run') {
     run();
   }
};

function run() {
  var n = 1;
  search: while (running) {
    n += 1;
    for (var i = 2; i <= Math.sqrt(n); i += 1)
      if (n % i == 0)
       continue search;
    // found a prime!
    postMessage(n);
  }
}
worker.js
onmessage = function (event) {
   if (event.data == 'run') {
     run();
   }
};

function run() {
  var n = 1;
  search: while (running) {
    n += 1;
    for (var i = 2; i <= Math.sqrt(n); i += 1)
      if (n % i == 0)
       continue search;
    // found a prime!
    postMessage(n);
  }
}
worker.js
onmessage = function (event) {
   if (event.data == 'run') {
     run();
   }
};

function run() {
  var n = 1;
  search: while (running) {
    n += 1;
    for (var i = 2; i <= Math.sqrt(n); i += 1)
      if (n % i == 0)
       continue search;
    // found a prime!
    postMessage(n);
  }
}
Can dos

ā€¢ Spawn more workers
ā€¢ setTimeout/Interval & clear
ā€¢ Access navigator
ā€¢ Error handling onerror
ā€¢ XHR (though responseXML is null)
8 workers   Workers disabled
8 workers   Workers disabled
Geolocation
Not always accurate!
navigator.geolocation.getCurrentPosition(function (geo) {
  console.log(geo);
}, function () {
  // error handler
});
navigator.geolocation.getCurrentPosition(function (geo) {
  console.log(geo);
}, function () {
  // error handler
});
Microdata,
datagrids,
                  Accessible
XHR2 & upload
progress events   Rich
                  Internet
                  Applications
    History
    manager,
    drag & drop     ...and more!
http://www.w3.org/TR/html5

http://tr.im/whatwg_complete

irc://irc.freenode.net/#whatwg
@rem
remy@leftlogic.com
http://delicious.com/remy.sharp/fb022010

More Related Content

What's hot

Steganography.
Steganography.Steganography.
Steganography.yprajapati
Ā 
Open Source ź·øė¦¬ź³  gitź³¼ github, code review
Open Source ź·øė¦¬ź³  gitź³¼ github, code reviewOpen Source ź·øė¦¬ź³  gitź³¼ github, code review
Open Source ź·øė¦¬ź³  gitź³¼ github, code reviewMinsuk Lee
Ā 
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°OnGameServer
Ā 
Steganography and watermarking
Steganography and watermarkingSteganography and watermarking
Steganography and watermarkingsudip nandi
Ā 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rulesFreddy BuenaƱo
Ā 
Seminar Report on image compression
Seminar Report on image compressionSeminar Report on image compression
Seminar Report on image compressionPradip Kumar
Ā 
Zero Day Malware Detection/Prevention Using Open Source Software
Zero Day Malware Detection/Prevention Using Open Source SoftwareZero Day Malware Detection/Prevention Using Open Source Software
Zero Day Malware Detection/Prevention Using Open Source SoftwareMyNOG
Ā 
Exp_3_20BCA1311 Linux Labbyharshdeep.docx
Exp_3_20BCA1311 Linux Labbyharshdeep.docxExp_3_20BCA1311 Linux Labbyharshdeep.docx
Exp_3_20BCA1311 Linux Labbyharshdeep.docxApkaAmitbro
Ā 
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the InternetAmazon Web Services
Ā 
Windows Operating System Archaeology
Windows Operating System ArchaeologyWindows Operating System Archaeology
Windows Operating System Archaeologyenigma0x3
Ā 
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdf
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdfHPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdf
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdfMingHsunOu2
Ā 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11Henry Schreiner
Ā 
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
GFX Part 7 - Introduction to Rendering Targets in OpenGL ESGFX Part 7 - Introduction to Rendering Targets in OpenGL ES
GFX Part 7 - Introduction to Rendering Targets in OpenGL ESPrabindh Sundareson
Ā 
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018unixfreaxjp
Ā 
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”Jongwon Kim
Ā 

What's hot (18)

YSlow 2.0
YSlow 2.0YSlow 2.0
YSlow 2.0
Ā 
What is Game Server ?
What is Game Server ?What is Game Server ?
What is Game Server ?
Ā 
Steganography.
Steganography.Steganography.
Steganography.
Ā 
Open Source ź·øė¦¬ź³  gitź³¼ github, code review
Open Source ź·øė¦¬ź³  gitź³¼ github, code reviewOpen Source ź·øė¦¬ź³  gitź³¼ github, code review
Open Source ź·øė¦¬ź³  gitź³¼ github, code review
Ā 
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°
IPv6 ģ“ė” ź³¼ ģ†Œģ¼“ ķ”„ė”œź·øėž˜ė°
Ā 
Steganography and watermarking
Steganography and watermarkingSteganography and watermarking
Steganography and watermarking
Ā 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
Ā 
Seminar Report on image compression
Seminar Report on image compressionSeminar Report on image compression
Seminar Report on image compression
Ā 
Zero Day Malware Detection/Prevention Using Open Source Software
Zero Day Malware Detection/Prevention Using Open Source SoftwareZero Day Malware Detection/Prevention Using Open Source Software
Zero Day Malware Detection/Prevention Using Open Source Software
Ā 
Exp_3_20BCA1311 Linux Labbyharshdeep.docx
Exp_3_20BCA1311 Linux Labbyharshdeep.docxExp_3_20BCA1311 Linux Labbyharshdeep.docx
Exp_3_20BCA1311 Linux Labbyharshdeep.docx
Ā 
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
Ā 
Windows Operating System Archaeology
Windows Operating System ArchaeologyWindows Operating System Archaeology
Windows Operating System Archaeology
Ā 
Digital Watermarking
Digital WatermarkingDigital Watermarking
Digital Watermarking
Ā 
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdf
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdfHPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdf
HPE OfficeConnect 1920S Switch Series Management and Configuration Guide.pdf
Ā 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11
Ā 
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
GFX Part 7 - Introduction to Rendering Targets in OpenGL ESGFX Part 7 - Introduction to Rendering Targets in OpenGL ES
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
Ā 
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018
怌Tsurugi Linuxć€ćƒ—ćƒ¬ć‚¼ćƒ³ćƒ†ćƒ¼ć‚·ćƒ§ćƒ³AVTOKYO2018
Ā 
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”
KGC 2014 ķ”„ė”œķŒŒģ¼ėŸ¬ė„¼ ģ“ģš©ķ•œ ź²Œģž„ ķ“ė¼ģ“ģ–øķŠø ģµœģ ķ™”
Ā 

Viewers also liked

Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009
Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009
Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009Aduci
Ā 
OnConnectionLost: The life of an offline web application - JSUnconf 2015
OnConnectionLost: The life of an offline web application - JSUnconf 2015OnConnectionLost: The life of an offline web application - JSUnconf 2015
OnConnectionLost: The life of an offline web application - JSUnconf 2015Johannes Thƶnes
Ā 
Updated: NW.js - Desktop Apps with Javascript
Updated: NW.js - Desktop Apps with JavascriptUpdated: NW.js - Desktop Apps with Javascript
Updated: NW.js - Desktop Apps with JavascriptRalf Schwoebel
Ā 
From JavaEE to Android: Way in one click?
From JavaEE to Android: Way in one click?From JavaEE to Android: Way in one click?
From JavaEE to Android: Way in one click?Sergii Zhuk
Ā 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Stephan Hochdƶrfer
Ā 
Anatomy of mobile App development
Anatomy of mobile App developmentAnatomy of mobile App development
Anatomy of mobile App developmentRalf Schwoebel
Ā 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web ApplicationAllan Huang
Ā 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Stephan Hochdƶrfer
Ā 
Online / Offline
Online / OfflineOnline / Offline
Online / OfflinePeter Rozek
Ā 
HTML5 Offline Web Applications (Silicon Valley User Group)
HTML5 Offline Web Applications (Silicon Valley User Group)HTML5 Offline Web Applications (Silicon Valley User Group)
HTML5 Offline Web Applications (Silicon Valley User Group)robinzimmermann
Ā 
HTML5 AppCache: The Manifest
HTML5 AppCache: The ManifestHTML5 AppCache: The Manifest
HTML5 AppCache: The ManifestRalf Schwoebel
Ā 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Ivano Malavolta
Ā 
El ornato limpieza de vĆ­as y espacios pĆŗblicos
El ornato limpieza de vĆ­as y espacios pĆŗblicosEl ornato limpieza de vĆ­as y espacios pĆŗblicos
El ornato limpieza de vĆ­as y espacios pĆŗblicosivazorro
Ā 
Html5 Offline Applications
Html5 Offline Applications Html5 Offline Applications
Html5 Offline Applications Sunny Sharma
Ā 

Viewers also liked (14)

Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009
Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009
Incorporating Web Services in Mobile Applications - Web 2.0 San Fran 2009
Ā 
OnConnectionLost: The life of an offline web application - JSUnconf 2015
OnConnectionLost: The life of an offline web application - JSUnconf 2015OnConnectionLost: The life of an offline web application - JSUnconf 2015
OnConnectionLost: The life of an offline web application - JSUnconf 2015
Ā 
Updated: NW.js - Desktop Apps with Javascript
Updated: NW.js - Desktop Apps with JavascriptUpdated: NW.js - Desktop Apps with Javascript
Updated: NW.js - Desktop Apps with Javascript
Ā 
From JavaEE to Android: Way in one click?
From JavaEE to Android: Way in one click?From JavaEE to Android: Way in one click?
From JavaEE to Android: Way in one click?
Ā 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13
Ā 
Anatomy of mobile App development
Anatomy of mobile App developmentAnatomy of mobile App development
Anatomy of mobile App development
Ā 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web Application
Ā 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8
Ā 
Online / Offline
Online / OfflineOnline / Offline
Online / Offline
Ā 
HTML5 Offline Web Applications (Silicon Valley User Group)
HTML5 Offline Web Applications (Silicon Valley User Group)HTML5 Offline Web Applications (Silicon Valley User Group)
HTML5 Offline Web Applications (Silicon Valley User Group)
Ā 
HTML5 AppCache: The Manifest
HTML5 AppCache: The ManifestHTML5 AppCache: The Manifest
HTML5 AppCache: The Manifest
Ā 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
Ā 
El ornato limpieza de vĆ­as y espacios pĆŗblicos
El ornato limpieza de vĆ­as y espacios pĆŗblicosEl ornato limpieza de vĆ­as y espacios pĆŗblicos
El ornato limpieza de vĆ­as y espacios pĆŗblicos
Ā 
Html5 Offline Applications
Html5 Offline Applications Html5 Offline Applications
Html5 Offline Applications
Ā 

Similar to HTML5: friend or foe (to Flash)?

codebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIsRemy Sharp
Ā 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with WingsRemy Sharp
Ā 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
Ā 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Remy Sharp
Ā 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02PL dream
Ā 
The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014Christian Heilmann
Ā 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & FriendsRemy Sharp
Ā 
Jarv.us Showcase ā€” SenchaCon 2011
Jarv.us Showcase ā€” SenchaCon 2011Jarv.us Showcase ā€” SenchaCon 2011
Jarv.us Showcase ā€” SenchaCon 2011Chris Alfano
Ā 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Codemotion
Ā 
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼rich
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼richHTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼rich
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼richRobert Nyman
Ā 
Progressive What Apps?
Progressive What Apps?Progressive What Apps?
Progressive What Apps?Patrick Kettner
Ā 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5Kevin DeRudder
Ā 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not FlashThomas Fuchs
Ā 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopShoshi Roberts
Ā 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
Ā 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
Ā 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fallShumpei Shiraishi
Ā 
HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015Christian Heilmann
Ā 

Similar to HTML5: friend or foe (to Flash)? (20)

codebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIs
Ā 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
Ā 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
Ā 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
Ā 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
Ā 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
Ā 
The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014
Ā 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
Ā 
Jarv.us Showcase ā€” SenchaCon 2011
Jarv.us Showcase ā€” SenchaCon 2011Jarv.us Showcase ā€” SenchaCon 2011
Jarv.us Showcase ā€” SenchaCon 2011
Ā 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Ā 
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼rich
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼richHTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼rich
HTML5 and CSS3 ā€“ exploring mobile possibilities - Frontend Conference ZĆ¼rich
Ā 
Progressive What Apps?
Progressive What Apps?Progressive What Apps?
Progressive What Apps?
Ā 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
Ā 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
Ā 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
Ā 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
Ā 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Ā 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
Ā 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Ā 
HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015
Ā 

More from Remy Sharp

HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
Ā 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQueryRemy Sharp
Ā 
Forget the Web
Forget the WebForget the Web
Forget the WebRemy Sharp
Ā 
Interaction Implementation
Interaction ImplementationInteraction Implementation
Interaction ImplementationRemy Sharp
Ā 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the newRemy Sharp
Ā 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?Remy Sharp
Ā 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
Ā 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for MobileRemy Sharp
Ā 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the webRemy Sharp
Ā 
TwitterLib.js
TwitterLib.jsTwitterLib.js
TwitterLib.jsRemy Sharp
Ā 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIsRemy Sharp
Ā 
iPhone Appleless Apps
iPhone Appleless AppsiPhone Appleless Apps
iPhone Appleless AppsRemy Sharp
Ā 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
Ā 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do MoreRemy Sharp
Ā 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIsRemy Sharp
Ā 
jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009Remy Sharp
Ā 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryRemy Sharp
Ā 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
Ā 

More from Remy Sharp (18)

HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
Ā 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
Ā 
Forget the Web
Forget the WebForget the Web
Forget the Web
Ā 
Interaction Implementation
Interaction ImplementationInteraction Implementation
Interaction Implementation
Ā 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
Ā 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
Ā 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Ā 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
Ā 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
Ā 
TwitterLib.js
TwitterLib.jsTwitterLib.js
TwitterLib.js
Ā 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
Ā 
iPhone Appleless Apps
iPhone Appleless AppsiPhone Appleless Apps
iPhone Appleless Apps
Ā 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Ā 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
Ā 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
Ā 
jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009
Ā 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Ā 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
Ā 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
Ā 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
Ā 
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 FresherRemote DBA Services
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
Ā 
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...DianaGray10
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
Ā 
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 WoodJuan lago vƔzquez
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
Ā 

Recently uploaded (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Ā 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Ā 
+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...
Ā 
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
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Ā 
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...
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Ā 
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
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Ā 

HTML5: friend or foe (to Flash)?

  • 2. The Open Web Friend or Foe?
  • 6. Is Flash is dead?
  • 8.
  • 11. Flash based ā€¢ Capture video ā€¢ Encode to FLV ā€¢ Upload/create SWF to play FLV ā€¢ Copy & paste <object> code
  • 12. Flash based ā€¢ Capture video ā€¢ Encode to FLV ā€¢ Upload/create SWF to play FLV create ā€¢ Copy & paste <object> code
  • 13. Open web based ā€¢ Capture video ā€¢ Encode to mp4 ā€¢ Add <video src="foo.mp4" />
  • 16. <!DOCTYPE html> <html lang="en"> <head> <meta charset=utf-8 /> <title>Video Example</title> </head> <body> <video src="dizzy.mp4" controls/> </body> </html>
  • 17.
  • 19.
  • 20. var video = document.getElementsByTagName('video')[0]; if (video.paused) { video.play(); }
  • 21. var video = document.getElementsByTagName('video')[0]; if (video.paused) { video.play(); } // position & asTime defined elsewhere video.addEventListener('timeupdate', function () { positon.innerHTML = asTime(this.currentTime); }, false);
  • 22. API ā€¢ play(), pause(), canPlayType(t)
  • 23. API ā€¢ play(), pause(), canPlayType(t) ā€¢ currentTime, paused, duration, loop, autoplay, muted, volume, etc
  • 24. API ā€¢ play(), pause(), canPlayType(t) ā€¢ currentTime, paused, duration, loop, autoplay, muted, volume, etc ā€¢ progress, stalled, play, pause, waiting, canplay, seeking, timeupdate
  • 26. Warning! User agents should not provide a public API to cause videos to be shown full-screen. A script, combined with a carefully crafted video ļ¬le, could trick the user into thinking a system-modal dialog had been shown, and prompt the user for a password. There is also the danger of "mere" annoyance, with pages launching full- screen videos when links are clicked or pages navigated. Instead, user-agent speciļ¬c interface features may be provided to easily allow the user to obtain a full-screen playback mode.
  • 27. Warning! User agents should not provide a public API to cause videos to be shown full-screen. A script, combined with a carefully crafted video ļ¬le, could trick the user into thinking a system-modal dialog had been shown, and prompt the user for a password. There is also the danger of "mere" annoyance, with pages launching full- screen videos when links are clicked or pages navigated. Instead, user-agent speciļ¬c interface features may be provided to easily allow the user to obtain a full-screen playback mode.
  • 28.
  • 29.
  • 30. Pros
  • 32. Pros ā€¢ No plugins required ā€¢ Simple API: play(), pause() etc
  • 33. Pros ā€¢ No plugins required ā€¢ Simple API: play(), pause() etc ā€¢ Video & Audio API the same
  • 34. Pros ā€¢ No plugins required ā€¢ Simple API: play(), pause() etc ā€¢ Video & Audio API the same ā€¢ Player chrome is HTML & CSS
  • 35. Cons
  • 37.
  • 41.
  • 43. <video controls> <source src="dizzy.ogv" /> <source src="dizzy.mp4" /> </video>
  • 44. Video for Everybody <video width="640" height="360" poster="dizzy.jpg" controls> <source src="dizzy.ogv" type="video/ogg" /> <source src="dizzy.mp4" type="video/mp4" /><!--[if gt IE 6]> <object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><! [endif]--><!--[if !IE]><!--> <object width="640" height="375" type="video/quicktime" data="dizzy.mp4"> <!--<![endif]--> <param name="src" value="dizzy.mp4" /> <param name="showlogo" value="false" /> <object width="640" height="380" type="application/x-shockwave-flash" data="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4"> <param name="movie" value="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4" /> <img src="dizzy.jpg" width="640" height="360" alt="Title of video" title="No video playback capabilities, please download the video below" /> </object><!--[if gt IE 6]><!--></object><!--<![endif]--> </video> <p>Download Video: <a href="dizzy.mp4">High Quality "MP4"</a> | <a href="dizzy.ogv">Low Quality "OGG"</a></p> http://camendesign.com/code/video_for_everybody
  • 45. Flash will be needed for video for a while yet.
  • 46. fonts
  • 48.
  • 49. ā€¢ Native font rendering ā€¢ IE works via EOT ā€¢ Doesn't work in Firefox 3 - 7%
  • 51.
  • 52. ā€¢ Pushed data relies on Flash
  • 53. ā€¢ Pushed data relies on Flash ā€¢ If no Flash, switches to polling
  • 54. ā€¢ Pushed data relies on Flash ā€¢ If no Flash, switches to polling ā€¢ Polling bad for high concurrency
  • 55. ā€¢ Had to work in corporate environment ā€¢ Corp env were blocking odd traffic & Flash ā€¢ Needed to be pure JS solution ā€¢ It's possible, but complicated
  • 57. var ws = new WebSocket("ws://hostname:80/"); ws.onmessage = function (event) { // message in, let's convert it to JSON var data = JSON.parse(event.data); }; ws.onclose = function () {}; ws.onopen = function () {};
  • 58. var ws = new WebSocket("ws://localhost:8080/"); ws.onmessage = function(event) { var data = JSON.parse(event.data); var p = $(twitterlib.render(data)); if( $('#tweets > li').length > 15) { $('#tweets >li:last').slideDown(100, function() { $(this).remove(); }); } $('#tweets').prepend(p); p.slideDown(140); }; ws.onclose = function() { alert("socket closed"); }; ws.onopen = function() { //alert("connected..."); };
  • 59.
  • 63.
  • 64. Google Analytics - Flash charts Interactive Demo - Canvas charts
  • 65.
  • 67.
  • 68. <!DOCTYPE html> <html> <head> <title>Canvas</title> </head> <body> <canvas></canvas> </body> </html>
  • 69. var ctx = canvas.getContext('2d');
  • 70. var ctx = canvas.getContext('2d'); // Create radial gradient var grad = ctx.createRadialGradient(0,0,0,0,0,600);
  • 71. var ctx = canvas.getContext('2d'); // Create radial gradient var grad = ctx.createRadialGradient(0,0,0,0,0,600); grad.addColorStop(0, '#E4E4E4'); grad.addColorStop(1, '#000');
  • 72. var ctx = canvas.getContext('2d'); // Create radial gradient var grad = ctx.createRadialGradient(0,0,0,0,0,600); grad.addColorStop(0, '#E4E4E4'); grad.addColorStop(1, '#000'); // assign gradients to fill ctx.fillStyle = grad;
  • 73. var ctx = canvas.getContext('2d'); // Create radial gradient var grad = ctx.createRadialGradient(0,0,0,0,0,600); grad.addColorStop(0, '#E4E4E4'); grad.addColorStop(1, '#000'); // assign gradients to fill ctx.fillStyle = grad; // draw 600x600 fill ctx.fillRect(0,0,600,600);
  • 74.
  • 77. body.onmousemove = function (event) { var width = window.innerWidth, height = window.innerHeight, x = event.clientX, y = event.clientY, rx = 600 * x / width, ry = 600 * y / width; var xc = parseInt(256 * x / width); var yc = parseInt(256 * y / height); grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600); grad.addColorStop(0, '#000'); grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')'); ctx.fillStyle = grad; ctx.fillRect(0,0,600,600); }; http://html5demos.com/canvas-grad
  • 78. body.onmousemove = function (event) { var width = window.innerWidth, height = window.innerHeight, Caclulate from x = event.clientX, the mouse the y = event.clientY, radius and rx = 600 * x / width, ry = 600 * y / width; colours var xc = parseInt(256 * x / width); var yc = parseInt(256 * y / height); grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600); grad.addColorStop(0, '#000'); grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')'); ctx.fillStyle = grad; ctx.fillRect(0,0,600,600); }; http://html5demos.com/canvas-grad
  • 79. body.onmousemove = function (event) { var width = window.innerWidth, height = window.innerHeight, x = event.clientX, y = event.clientY, rx = 600 * x / width, ry = 600 * y / width; Re-render the var xc = gradient parseInt(256 * x / width); var yc = parseInt(256 * y / height); grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600); grad.addColorStop(0, '#000'); grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')'); ctx.fillStyle = grad; ctx.fillRect(0,0,600,600); }; http://html5demos.com/canvas-grad
  • 80. body.onmousemove = function (event) { var width = window.innerWidth, height = window.innerHeight, x = event.clientX, y = event.clientY, rx = 600 * x / width, ry = 600 * y / width; var xc = parseInt(256 * x / width); var yc = parseInt(256 * y / height); Set the new ļ¬ll grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600); grad.addColorStop(0, '#000'); style and reļ¬ll - the browser grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')'); handles the hard ctx.fillStyle = grad; ctx.fillRect(0,0,600,600); work }; http://html5demos.com/canvas-grad
  • 81. body.onmousemove = function (event) { var width = window.innerWidth, height = window.innerHeight, x = event.clientX, y = event.clientY, rx = 600 * x / width, ry = 600 * y / width; var xc = parseInt(256 * x / width); var yc = parseInt(256 * y / height); grad = ctx.createRadialGradient(rx, ry, 0, rx, ry, 600); grad.addColorStop(0, '#000'); grad.addColorStop(1, 'rgb('+xc+','+(255-xc)+','+yc+')'); ctx.fillStyle = grad; ctx.fillRect(0,0,600,600); }; http://html5demos.com/canvas-grad
  • 83. canvas.toDataURL("image/png"); data:image/ png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAFxUlEQVR4Ae3dQW5jORAEUXvQ97+yez CzNQpNyPwdIp+XJkVlRTKgheGvz69/fz78IIDAtwT+ +fa3fokAAv8RIIiLgMBAgCADHEsIEMQdQGAgQJABjiUECOIOIDAQIMgAxxICBHEHEBgIEGSAYwkBgrgDCAwECDLAs YQAQdwBBAYCBBngWEKAIO4AAgMBggxwLCFAEHcAgYEAQQY4lhAgiDuAwECAIAMcSwj8+nEEn58/ fuQfHehf6/8Ik01rBHyCrPGy+zICBLmscOOuESDIGi+7LyNAkMsKN data:image/png;base64,... +4aAYKs8bL7MgIEuaxw464RIMgaL7svI0CQywo37hoBgqzxsvsyAgS5rHDjrhEgyBovuy8jQJDLCjfuGgGCrPGy +zICBLmscOOuESDIGi+7LyNAkMsKN +4aAYKs8bL7MgIEuaxw464RIMgaL7svI0CQywo37hoBgqzxsvsyAgS5rHDjrhEgyBovuy8jQJDLCjfuGgGCrPGy +zICBLmscOOuESDIGi+7LyNAkMsKN+4aAYKs8bL7MgI//3R3T1m/ 7AqdPa5PkLP7Nd2LBAjyIkAvP5sAQc7u13QvEiDIiwC9/ GwCBDm7X9O9SIAgLwL08rMJEOTsfk33IgGCvAjQy88mQJCz+zXdiwR+/i/pLwba/fLPj7/zPe5fH1+7R3P+BgI +QTZAdeQ5BAhyTpcm2UCAIBugOvIcAgQ5p0uTbCBAkA1QHXkOAYKc06VJNhAgyAaojjyHAEHO6dIkGwgQZANUR55D gCDndGmSDQQIsgGqI88hQJBzujTJBgIE2QDVkecQIMg5XZpkAwGCbIDqyHMIEOScLk2ygQBBNkB15DkECHJOlybZQ IAgG6A68hwCBDmnS5NsIECQDVAdeQ4BgpzTpUk2ECDIBqiOPIcAQc7p0iQbCBBkA1RHnkOAIOd0aZINBAiyAaojzy FAkHO6NMkGAgTZANWR5xC47ununrJ+zuV9YhKfIE9Q9h5vS4Agb1ud4E8QIMgTlL3H2xIgyNtWJ/ gTBAjyBGXv8bYECPK21Qn+BAGCPEHZe7wtAYK8bXWCP0GAIE9Q9h5vS+C6v6TXm/r8O1/j/vHla9y/vRo +Qb7F4pcI/E +AIG4CAgMBggxwLCFAEHcAgYEAQQY4lhAgiDuAwECAIAMcSwgQxB1AYCBAkAGOJQQI4g4gMBAgyADHEgIEcQcQGAg QZIBjCQGCuAMIDAQIMsCxhABB3AEEBgIEGeBYQoAg7gACAwGCDHAsIUAQdwCBgQBBBjiWECCIO4DAQIAgAxxLCBDE HUBgIECQAY4lBAjiDiAwECDIAMcSAgRxBxAYCBBkgGMJAU93j90BT1lvFeITpNWHNDECBIkVIk6LAEFafUgTI0CQW CHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBI kVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0C QWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDEC BIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI 0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHND ECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUg TI0CQWCHitAgQpNWHNDECBIkVIk6LAEFafUgTI0CQWCHitAgQpNWHNDECvwHnaxGSkEUPVAAAAABJRU5ErkJggg==
  • 84. Canvas + drawImage + Video =
  • 85.
  • 86.
  • 87.
  • 89. ctx.translate(canvas.width/2, canvas.height/2); ctx.scale(-1, 1); ctx.translate(-canvas.width/2, -canvas.height/2); ctx.drawImage( video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height); http://html5demos.com/video-canvas
  • 90. ctx.translate(canvas.width/2, canvas.height/2); ctx.scale(-1, 1); ctx.translate(-canvas.width/2, -canvas.height/2); ctx.drawImage( video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height); http://html5demos.com/video-canvas
  • 92. ctx.getImageData(0, 0, w, h); 0 1 2 3 0 r g b a 1 r g b a ... r g b a
  • 93. pixels.data[i * 4 + 0]; 0 1 2 3 0 r g b a 1 r g b a ... r g b a
  • 94. pixels.data[i * 4 + 1]; 0 1 2 3 0 r g b a 1 r g b a ... r g b a
  • 95. pixels.data[i * 4 + 2]; 0 1 2 3 0 r g b a 1 r g b a ... r g b a
  • 96. pixels.data[i * 4 + 3]; 0 1 2 3 0 r g b a 1 r g b a ... r g b a
  • 97. for (i = 0; i < pixels.data.length / 4; i++) { totals.r += pixels.data[i * 4 + 0]; // r totals.g += pixels.data[i * 4 + 1]; // g totals.b += pixels.data[i * 4 + 2]; // b } var r = parseInt(totals.r / (w*h)), g = parseInt(totals.g / (w*h)), b = parseInt(totals.b / (w*h)), rgb = [r, g, b].join(',');
  • 98.
  • 99.
  • 100. SVG
  • 101.
  • 102.
  • 105. 3D
  • 107.
  • 108. #canvas { -webkit-perspective: 800; -webkit-perspective-origin: 50% 20em; } #rubiks { -webkit-transform-style: preserve-3d; -webkit-transform: rotateX(15deg) rotateY(15deg); } #rubiks .face1 { -webkit-transform: rotateX(90deg) translateZ (10.8em); } #rubiks .face2 { /* front */ -webkit-transform: translateZ(10.8em); } #rubiks .face3 { -webkit-transform: rotateY(90deg) translateZ
  • 109. WebGL
  • 110.
  • 112.
  • 114. Offline Apps ā€¢ Application cache / manifest ā€¢ Events: offline, online ā€¢ navigator.onLine property
  • 115. Offline Apps ā€¢ Application cache / manifest ā€¢ Events: offline, online
  • 118. Using a Manifest <!DOCTYPE html> <html manifest="my.manifest"> <body> <!-- my page --> </body> </html>
  • 119. Using a Manifest <!DOCTYPE html> <html manifest="my.manifest"> <body> <!-- my page --> </body> </html>
  • 121. The Manifest 1. Serve as text/manifest, by adding to mime.types: text/cache-manifest manifest
  • 122. The Manifest 2. First line must be: CACHE MANIFEST
  • 123. The Manifest 3. Including page is implicitly included in the cache.
  • 124. The Manifest 4. Two futher namespaces: NETWORK & FALLBACK FALLBACK: / offline.html
  • 125. The Manifest 5. Include some versioning to cache bust your manifest # version 16
  • 127. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 128. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 129. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 130. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 131. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 132. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 133. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 134. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 135. Browser: I have a Browser: request Server: serve all manifest, cache assets Browser: Server: serve applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 136. Browser: I have a Problem: Browser: request Server: serve all manifest, cache assets Change of content requiresBrowser: Server: serve 2 refreshes applicationCache Browser: reload manifest assets updated Browser: only Browser: serve Server: 304 Not request manifest locally Modified file
  • 137. applicationCache.onUpdateReady = function () { applicationCache.swapCache(); notice('reload'); }; window.onOnline = function () { // fire an update to the cache applicationCache.update(); };
  • 139. ā€¢ "Threads"
  • 142.
  • 144. app.html var w = new Worker('worker.js');
  • 145. app.html var w = new Worker('worker.js'); w.onmessage = function (event) { alert("msg: " + event.data); };
  • 146. app.html var w = new Worker('worker.js'); w.onmessage = function (event) { alert("msg: " + event.data); }; w.postMessage('run');
  • 147. worker.js onmessage = function (event) { if (event.data == 'run') { run(); } }; function run() { var n = 1; search: while (running) { n += 1; for (var i = 2; i <= Math.sqrt(n); i += 1) if (n % i == 0) continue search; // found a prime! postMessage(n); } }
  • 148. worker.js onmessage = function (event) { if (event.data == 'run') { run(); } }; function run() { var n = 1; search: while (running) { n += 1; for (var i = 2; i <= Math.sqrt(n); i += 1) if (n % i == 0) continue search; // found a prime! postMessage(n); } }
  • 149. worker.js onmessage = function (event) { if (event.data == 'run') { run(); } }; function run() { var n = 1; search: while (running) { n += 1; for (var i = 2; i <= Math.sqrt(n); i += 1) if (n % i == 0) continue search; // found a prime! postMessage(n); } }
  • 150. Can dos ā€¢ Spawn more workers ā€¢ setTimeout/Interval & clear ā€¢ Access navigator ā€¢ Error handling onerror ā€¢ XHR (though responseXML is null)
  • 151. 8 workers Workers disabled
  • 152. 8 workers Workers disabled
  • 154.
  • 156. navigator.geolocation.getCurrentPosition(function (geo) { console.log(geo); }, function () { // error handler });
  • 157. navigator.geolocation.getCurrentPosition(function (geo) { console.log(geo); }, function () { // error handler });
  • 158.
  • 159.
  • 160. Microdata, datagrids, Accessible XHR2 & upload progress events Rich Internet Applications History manager, drag & drop ...and more!