SlideShare a Scribd company logo
1 of 179
Download to read offline
Smart Markup for
         Smarter Websites
Aaron Gustafson
Easy Designs, LLC
@AaronGustafson
slideshare.net/AaronGustafson
HTML5 gives
you more
control
over your
documents
and apps
Paving our “cowpaths”
The process is ongoing…
…but the end is near.


 June 2004
 WhatWG begins work        2007                 May 2011             2014
 on Web Applications 1.0   Work begins at W3C   HTML5 to Last Call   HTML5 Standard?




2004                                                                         2014
You can use it now
fault tolerance
n. a system’s ability to continue to
operate when it encounters and
unexpected error.
Browsers ignore
what they don’t
  understand.
For example
<input type="date" name="dob"/>
For example
<video poster=”poster.png”>
 <source src=”video.m4v”/>
 <source src=”video.webm”/>
 <source src=”video.ogv”/>
 <img src=”poster.png” alt=””/>
 <ul>
   <li><a href="video.m4v">Download MP4</a></li>
   <li><a href="video.webm">Download WebM</a></li>
   <li><a href="video ogv">Download Ogg</a></li>
 </ul>
</video>
Now back to those cowpaths…
A great idea that we lost.




                                                        Albert Einstein

  <fig>
   <img src="photo.jpeg" alt=""/>
   <caption>Photo of Albert Einstein</caption>
  </fig>
The original concept in HTML3: http://www.w3.org/MarkUp/html3/figures.html
Microformats brought it back.




                                     Albert Einstein

  <div class="figure">
   <img class="image" src="photo.jpeg" alt=""/>
   <p class="caption">Albert Einstein</p>
  </div>
The original “figure” microformat.
HTML5 re-imagined it.




                             Albert Einstein

  <figure>
   <img src="photo.jpeg" alt=""/>
   <legend>Albert Einstein</legend>
  </figure>
The original HTML5 figure.
Microformats adapted.




                                                          Albert Einstein

  <div class="figure">
   <img class="image" src="photo.jpeg" alt=""/>
   <p class="captionlegend">Albert Einstein</p>
  </div>
The revised (and now draft) “figure” microformat: http://microformats.org/wiki/figure
Microformats adapted.




                                                Albert Einstein

  <figure>
   <img src="photo.jpeg" alt=""/>
   <figcaption>Albert Einstein</figcaption>
  </figure>
The current (dare I say final?) HTML5 figure.
What’s the
easiest way to
write HTML5?
Use the new doctype
<!DOCTYPE html>
The HTML4 Lexicon
                   html
           meta head link style
       title   base body dl dt dd
    bdo script noscript    map dfn    b
   object param p div ul ol li      cite
  iframe address area img br a small
pre code abbr kbd var q samp hr menu
 textarea ins del sub sup span strong
  select   option optgroup label    input
  form fieldset   legend button i    em
    blockquote h1 h2 h3 h4 h5 h6
      table caption col colgroup
           thead tbody tfoot tr
                  th td
The HTML5 Lexicon
                   html
           meta head link style
       title   base body dl dt dd           section article
    bdo script noscript    map dfn    b aside details    summary
   object param p div ul ol li      cite    canvas audio video
  iframe address area img br a small        nav figure figcaption
 pre code abbr kbd var q samp hr menu header footer command
 textarea ins del sub sup span strong        time source datalist
  select   option optgroup label    input    output ruby progress
  form fieldset   legend button i    em     mark hgroup meter
    blockquote h1 h2 h3 h4 h5 h6            wbr keygen embed
      table caption col colgroup                 rt rp
           thead tbody tfoot tr
                  th td
Our focus today
                   html
           meta head link style
       title   base body dl dt dd           section article
    bdo script noscript    map dfn    b aside details    summary
   object param p div ul ol li      cite    canvas audio video
  iframe address area img br a small        nav figure figcaption
 pre code abbr kbd var q samp hr menu header footer command
 textarea ins del sub sup span strong        time source datalist
  select   option optgroup label    input    output ruby progress
  form fieldset   legend button i    em     mark hgroup meter
    blockquote h1 h2 h3 h4 h5 h6            wbr keygen embed
      table caption col colgroup                 rt rp
           thead tbody tfoot tr
                  th td
If only life were simpler…
Simplification
The html element
<html xmlns="http://www.w3.org/1999/xhtml"
      lang="en"
      xml:lang="en">



<html lang="en">
Simplification
Character encoding
<meta http-equiv="Content-Type"
      content="text/html; charset=utf-8">



<meta charset="utf-8" />
Simplification
Styles and scripts
<link rel="stylesheet" href="style-original.css" type="text/css" />
<style type=”text/css”>
 /* … */
</style>
<script type=”text/javascript” src=”myscript.js”></script>



<link rel="stylesheet" href="style-original.css" />
<style>
 /* … */
</style>
<script src=”myscript.js”></script>
Metamorphosis
Nip/tuck
The em element
Represents a span of text text with emphatic stress.

<p>HTML5 introduces several <em>really</em> useful elements and
a ton of new APIs.</p>


The strong element
Represents a span of text of great importance.

<p>Please fill out the form below. <strong>Note: all
fields are required.</strong></p>
Evil incarnate
The small element
Represents so-called “fine print” (e.g. disclaimers, caveats, etc.).
Clarification
The cite element
The title of a cited work (e.g. a book, magazine, or journal).

<p>In <cite>Web Form Design</cite>, Luke Wroblewski draws on
original research, his considerable experience at Yahoo! and eBay,
and the perspectives of many of the field’s leading designers to
show you everything you need to know about designing effective
and engaging Web forms.</p>
Resurrection
The b element
Represents a span of text offset from its surrounding content, but of no
extra importance.

<p>This presentation is about <b>HTML5</b>.</p>


The i element
Represents a span of text in an alternate voice or mood.

<p>The <code>b</code> and <code>i</code> elements
have been legitimized in HTML5. <i>Go figure.</i></p>
Deeper meaning
The hr element
Represents a paragraph-level thematic break.
Raw materials
Organization
The section element
Represents a section of a document, typically with a title or heading.

<section>
 <!-- pretty much anything can go here -->
</section>


The article element
Represents a section of content that forms an independent part of a
document or site.

<article>
 <!-- pretty much anything can go here -->
</article>
section
          38
section > article
                    39
40
article
          41
article > section
                    42
Organization
The header element
Represents the header of a section.

<header>
 <!-- titles, etc. go here -->
</header>


The footer element
Represents the footer of a section.

<footer>
 <!-- meta/supplementary information goes here -->
</footer>
44
header
         45
46
footer
         47
article
          48
article > header
                   49
article
          50
article > footer
                   51
Organization
The nav element
Demarcates a group of navigational links.

<nav>
 <ol>
   <li><a href="#details">Details</a></li>
   <li><a href="#lodging">Lodging</a></li>
   <li><a href="#location">Location</a></li>
   <li><a href="#topics">Topics</a></li>
   <li><a href="#contact">Contact Us</a></li>
 </ol>
 <p><a href="register">Register Now</a>
   <b>Only 5 spaces left</b></p>
</nav>
53
nav
      54
55
nav
      56
Organization
The aside element
Demarcates content that is tangentially related to the primary content.

<article>

  <!-- main content -->

  <aside>
   <!-- something related -->
  </aside>

</article>
58
aside
        59
Organization
The details element
A UI control for hiding optional content. Must contain a summary element,
followed by other content.

 <details>
  <summary>This is the visible description</summary>
  <p>This content would be hidden by default.</p>
 </details>




It’s not implemented in any browser yet, this is just an example of how it could work. (Ripped from http://2010.full-frontal.org).
Organization
The figure element
A unit of content (typically referenced by the primary content) that is
self-contained. May contain a figcaption element and other content.

<figure id="fig-1">
 <img src="photo.jpeg" alt=""/>
 <figcaption>Photo of Albert Einstein</figcaption>
</figure>


<figure id="fig-2">
 <table>
   <caption>2011 Forecast Earnings</caption>
   <!-- a bunch of data -->
 </table>
</figure>
Refining the outline
Implicit sections
                                           <h1> HTML5
                                           <p> HTML5 is currently under development...
                                           <p> Like its immediate predecessors, HTML...


                                           <h2> W3C standardization process
                                           <p> The Web Hypertext Application...
                                           <p> The HTML5 specification...
                                           <p> According to the W3C timetable...
                                           <p> Ian Hickson, editor of the HTML5...


                                           <h2> Markup
                                           <p> HTML5 introduces a number of...
                                           <p> The HTML5 syntax is no longer...




                                             1 HTML5
                                             1.1 W3C standardization process
                                             1.2 Markup




A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
Explicit sections
                                           <h1> HTML5
                                           <p> HTML5 is currently under development...
                                           <p> Like its immediate predecessors, HTML...


                                           <h2> W3C standardization process
                             section
                                           <p> The Web Hypertext Application...
                                           <p> The HTML5 specification...
                                           <p> According to the W3C timetable...
                                           <p> Ian Hickson, editor of the HTML5...


                                           <h2> Markup
                             section




                                           <p> HTML5 introduces a number of...
                                           <p> The HTML5 syntax is no longer...




                                             1 HTML5
                                             1.1 W3C standardization process
                                             1.2 Markup




A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
Explicit sections
                                           <h1> HTML5
                                           <p> HTML5 is currently under development...
                                           <p> Like its immediate predecessors, HTML...


                                           <h1> W3C standardization process
                             section
                                           <p> The Web Hypertext Application...
                                           <p> The HTML5 specification...
                                           <p> According to the W3C timetable...
                                           <p> Ian Hickson, editor of the HTML5...


                                           <h1> Markup
                             section




                                           <p> HTML5 introduces a number of...
                                           <p> The HTML5 syntax is no longer...




                                             1 HTML5
                                             1.1 W3C standardization process
                                             1.2 Markup




A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
Explicit sections
                                           <h1> HTML5
                                           <p> HTML5 is currently under development...
                                           <p> Like its immediate predecessors, HTML...


                                           <h4> W3C standardization process
                             section
                                           <p> The Web Hypertext Application...
                                           <p> The HTML5 specification...
                                           <p> According to the W3C timetable...
                                           <p> Ian Hickson, editor of the HTML5...


                                           <h6> Markup
                             section




                                           <p> HTML5 introduces a number of...
                                           <p> The HTML5 syntax is no longer...




                                             1 HTML5
                                             1.1 W3C standardization process
                                             1.2 Markup




A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
Sectioning elements
Create explicit sections in an outline.
๏ section (obviously)
๏ article
๏ aside
๏ footer
๏ header
๏ nav
Outline limitations
         <h1> Title
         <h2> Subtitle
         <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...




          1 Title
          1.1 Subtitle
Heading groups FTW!

     hgroup
              <h1> Title
              <h2> Subtitle
              <p> Text content continues...
              <p> Text content continues...
              <p> Text content continues...
              <p> Text content continues...
              <p> Text content continues...
              <p> Text content continues...
              <p> Text content continues...




               1 Title
Sectioning roots
Establish a new outline.
๏ body (obviously)
๏ blockquote
๏ details
๏ fieldset
๏ figure
๏ td
Rooted sections
         <h1> Title
         <p> Text content continues...
         <p> Text content continues...


         <h2> Section heading
         <p> Text content continues...
         <blockquote>
           <h2> Rooted heading
           <p> Text content continues...
           <p> Text content continues...
         <p> Text content continues...
         <p> Text content continues...




          1 Title
          1.1 Section heading
New elements to consider
When?
The time element
Represents a date and/or time.
74
time
       75
When?
The time element
Represents a date and/or time.

<time>October 25, 2010 8:11 PM</time>
When?
The time element
Represents a date and/or time.

<time>October 25, 2010 8:11 PM</time>

<time datetime="2010-10-25T20:11:00-05:00">
      October 25, 2010 8:11 PM</time>
When?
The time element
Represents a date and/or time.

<time>October 25, 2010 8:11 PM</time>

<time datetime="2010-10-25T20:11:00-05:00">
      October 25, 2010 8:11 PM</time>


<time datetime="2010-10-25T20:11:00-05:00"
      pubdate="pubdate">October 25, 2010 8:11 PM</time>
Highlighting
The mark element
Represents a run of text in one document marked or highlighted for
reference purposes, due to its relevance in another context.

<ol id="search-results">
 <li>
   <h3><a href="...">Web Upgrade <mark>HTML5</mark>
     May Weaken Privacy</a></h3>
   <p>The new language, <mark>HTML5</mark>, could give
     marketers access to many more details about users'
     online activities.</p>
 </li>
</ol>
80
81
mark
       82
mark
       83
More usable forms
Dates and times
<input type=”datetime”>
A UI control for selecting a date and time that includes timezone information.

<input type=”datetime-local”>
A UI control for selecting a date and time that does not include timezone information.

<input type=”date”>
A UI control for selecting a date with access to all date components
(day, month and year).

<input type=” month”>
A UI control for selecting a date that provides access to month and year only.

<input type=”time”>
A UI control for selecting a time that does not include timezone information.

<input type=”week”>
A UI control for selecting a date that provides access to week and year only.
Dates and times



             Safari




                                  Opera



<input type="date" name="dob"/>
Numbers
<input type=”number”>
A UI control for selecting a number.

<input type=”range”>
A UI control for selecting an imprecise number.
Numbers


<input type="number" name="foo"/>




<input type="range" min="1" max="11" name="foo"/>
New types
<input type=”email”>
A UI control for entering an email.

<input type=”url”>
A UI control for entering a URL.

<input type=”tel”>
A UI control for entering a telephone number.
New types




  <input type="email" …/>   <input type="url" …/>
UI control attributes
autocomplete
Tells the User Agent whether or not the value should be stored.

autofocus
Tells the User Agent to bring focus to the form control on page load.

form
An id reference to the form to which a given control belongs.

required
Indicated the form control must be provided a value.

placeholder
Offers users a short hint about the required value.
Value control
min and max
Lower and upper boundary for an element value (dates, time, and numbers only).

step
The granularity of values allowed (dates, time, and numbers only).


 <input type="range" min="1" max="11" step="0.5" .../>
Value control
pattern
A regular expression pattern that the User Agent should validate the input against.

 <input type="text"
        pattern="d{6}w{3}"
        placeholder="6 digits followed by 3 letters"
        .../>
Value control
pattern
An id reference to a datalist element containing acceptable values.

 <input type="text" list="countries" name="country"/>
 <datalist id="countries">
  <option>Afghanistan</option>
  <option>Åland Islands</option>
  <!-- ... -->
 </datalist>
95
Truth based on perspective
?
<button>Tweet</button>
<button>Tweet</button>
<a class=”button”>Tweet</a>
?
<button>Search Mail</button>
<button>Search Mail</button>
   <div>Search Mail</div>
ARIA maps the OS to the web
Semantics+
Landmarks
help users
navigate
quickly
All the site’s a play...
The role attribute
Defines the part an element is playing (assuming it’s different than the
semantics would otherwise imply).

<section id="main" role="main">
 <!-- The primary content for the page would go here -->
</section>
<header role="banner">
<nav role="navigation">
<form role="search">
<section role="main">
<footer role="contentinfo">
<nav role="navigation">
<aside role="complementary">
Landmark roles
application
A region of the page representing a unique software unit executing a set of tasks for its
users. It is an area where assistive technologies should also return browse navigation
keys back over to the web application in this region.
banner
A region that contains the prime heading or internal title of a page.
complementary
A supporting section of the document that remains meaningful even when separated
from the main content.
contentinfo
Metadata that applies to the parent document.
form
A region of the document that represents a collection of form-associated elements.
main
navigation
search
Landmark roles
main
The main content of a document.
navigation
A collection of navigational elements (usually links) for navigating the document or
related documents.
search
The search tool of a web document.
Structural roles
article
columnheader
definition
directory
document
group
heading
img
list
listitem
math
note
presentation
region
row
rowheader
separator
<article role="article">
Structural roles
article
A section of a page that forms an independent part of a document, page, or site.
group
A set of user interface objects which are not intended to be included in a page summary
or table of contents by assistive technologies.
note
A section whose content is parenthetic or ancillary to the main content of the resource.
presentation
An element whose implicit native semantics will not be mapped to the accessibility API.
region
A large perceivable section of a web page or document, that the author feels is
important enough to be included in a page summary or table of contents.
separator
A divider that separates and distinguishes sections of content or groups of menu items.
Semantic comparison
       Ad-hoc             ARIA Role               HTML5

#header, #top      banner                header (kind of)


#main, #content    main                  none


#extra, .sidebar   complementary, note   aside


#footer, #bottom   contentinfo           footer


#nav               navigation            nav


.hentry            article               article
What is this!?
Widget roles
<span role="button">OK</span>
Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)
Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>
Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>


<div role="alertdialog">
 <p>Something went wrong.</p>
 <img src="x.png" alt="dismiss" role="button" />
</div>
<a class=”button”>Tweet</a>
<a role=”button”>Tweet</a>
role="application"
aria-activedescendant="folder-1"
role="tablist"
role="tab"
aria-selected="true"
aria-controls="folder-1"
role="tab"
aria-selected="false"
aria-controls="folder-4"
role="tabpanel"
aria-hidden="false"
aria-labelledby="folder-1-tab"
What’s going on!?
Widget states

                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Widget states

                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="not bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Widget states

                          B         B
                         (off)      (on)



<span role="button" aria-pressed="false">
 <img src="bold-off.png" alt="not bold" />
</span>
<span role="button" aria-pressed="true">
 <img src="bold-on.png" alt="bold" />
</span>
Widget states
aria-busy
aria-checked
aria-disabled
aria-expanded
aria-grabbed
aria-hidden
aria-invalid
aria-pressed
aria-selected
aria-valuenow (the W3C defines this as a “property”)
aria-valuetext (ditto)
Highlighting living content
Live regions
Live regions




<input class="tweet-counter" value="140" disabled="disabled">
Live regions




<span id="chars_left_notice" class="numeric">
 <strong id="status-field-char-counter"
       class="char-counter">140</strong>
</span>
Live regions




<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>


.hidden {
  position: absolute;
  left: −999em;
}
Live regions




<span class="tweet-counter">maximum of 140 characters</span>



<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>
Live regions




<span aria-live="polite" aria-atomic="true"
      class="tweet-counter">140<b class="hidden">
      characters remaining</b></span>
Live regions
Notification options
off
change not announced

polite
change announced after user completes her current activity

assertive
user agent should interrupt the user’s activity, but not immediately
Who is Supporting WAI-ARIA?
Music to our ears
Can you hear me now?
The audio element
<audio src="my.oga" controls="controls"></audio>
Can you hear me now?
    Browser            .aac   .mp3   .oga   .wav

Chrome 6+              YES    YES    YES     NO


Firefox 3.6+           NO      NO    YES    YES


Internet Explorer 9+   YES    YES    NO     YES


Opera 10.5+            NO      NO    YES    YES


Safari 5+              YES    YES    NO     YES
Can you hear me now?
<audio controls="controls">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <!-- fallback -->
</audio>
Available attributes
src
URL for the audio file.
autoplay
A boolean specifying whether or not the file should play as soon as it can.
loop
A boolean specifying whether or not playback of the file should be repeated.
controls
A boolean that tells the browser to use its default media controls.
preload
Tells the browser what to content to preload. Options: “none,” “metadata,” and “auto.”
autobuffer (deprecated)
A boolean defining whether the file should be buffered in advance. Replaced by preload.
Can you hear me now?
<audio controls="controls" autobuffer="autobuffer"
        preload="auto">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <!-- fallback -->
</audio>
Fallback options
<audio controls="controls" autobuffer="autobuffer"
        preload="auto">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <ul>
   <li><a href="my.mp3">Download as audio/mp3</a></li>
   <li><a href="my.oga">Download as audio/ogg</a></li>
 </ul>
</audio>
Fallback options
<audio controls="controls" autobuffer="autobuffer"
        preload="auto">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <object …>
   <!-- flash player goes here -->
 </object>
</audio>
Fallback options
$('audio').each(function(){
   var $audio = $(this), media = {}, formats = [];
   $audio.find('source').each(function(){
     var src = $(this).attr('src'),
         ext = src.split('.').pop();
     media[ext] = src;
     formats.push(ext);
   });
    $audio.jPlayer({
     swfPath: '/vendors/jPlayer',
     ready:    function(){
       $audio.jPlayer('setMedia', media);
     },
     supplied: formats.join(', ')
   });
 });
                                                     Using jQuery & jPlayer
Roll your own
$('audio').each(function(){
   var audio = this,
   $button = $('<button>Play</button>')
               .click(function(){
                  audio.play();
                });
   $(this)
    .removeAttr('controls')
    .after($button);
 });
                                          Using jQuery
Opiate of the masses
Elementary, my dear Watson
The video element
<video src="my.ogv" controls="controls"></video>
Not so elementary
Video file = container file (like ZIP)

๏ 1 video track
๏ 1 (or more) audio tracks
๏ metadata
๏ subtitle/caption tracks (optional)
Not so elementary
Video formats
Flash Video (.flv)
Prior to 2008, the only video format supported in Adobe Flash.

MPEG 4 (.m4v or .mp4)
Based on QuickTime; iTunes uses this format.

Ogg (.ogv)
Open source container format.

WebM (.webm)
New format announced in May 2010.
Not so elementary
Video codecs
H.264
Used primarily in MPEG 4. Only video codec natively supported on iOS. Patented.

Theora
Used primarily in Ogg. Royalty free. Supported in Firefox 3.5+ (in Ogg).

VP8
Used primarily in WebM. Owned by Google, but licensed royalty-free.
Not so elementary
Audio codecs
MP3
Nearly universal in usage, but was part of FLV. Patented.

AAC (Advanced Audio Coding)
Used primarily in MP4. Patented.

Vorbis
Used in Ogg audio & video as well as WebM. Royalty-free.
Not so elementary
          Browser    .m4v               .ogv            .webm
                    (AAC + H.264)   (Vorbis + Theora)   (Vorbis + VP8)


Chrome                   3+               3+                 6+
                      (for now)



Firefox                 NO               3.5+                4+


Internet Explorer       9+                NO              MAYBE


Opera                   NO              10.5+              10.6+


Safari                  3.1+           MAYBE              MAYBE
Format juggling
<video controls="controls" width="640" height="480">
 <source src="my.m4v"/>
 <source src="my.webm"/>
 <source src="my.ogv"/>
 <!-- fallback -->
</video>
A good first impression
<video controls="controls" width="640" height="480"
        poster="my.png">
 <source src="my.m4v"/>
 <source src="my.webm"/>
 <source src="my.ogv"/>
 <!-- fallback -->
</video>
Kindness to strangers
 <video controls="controls" width="640" height="480"
         poster="my.png">
  <source src="my.m4v"
            type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/>
  <source src="my.webm"
            type='video/webm; codecs="vp8, vorbis"'/>
  <source src="my.ogv"
            type='video/ogg; codecs="theora, vorbis"'/>
  <!-- fallback -->
 </video>

Note: The MPEG 4 codec will depend on the encoding “profiles” you use.
Available attributes
src
URL for the audio file.
autoplay
A boolean specifying whether or not the file should play as soon as it can.
loop
A boolean specifying whether or not playback of the file should be repeated.
controls
A boolean that tells the browser to use its default media controls.
poster
The image to be shown while the video is not activated.
preload
Tells the browser what to content to preload. Options: “none,” “metadata,” and “auto.”
autobuffer (deprecated)
A boolean defining whether the file should be buffered in advance. Replaced by preload.
No MIME, no service
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
Fallback options
<video width="600" height="400" poster="/r/2-5.png"
        controls="controls" preload="none">
 <source src="/r/2-5.m4v" type="video/mp4"/>
 <source src="/r/2-5.webm" type="video/webm"/>
 <source src="/r/2-5.ogv" type="video/ogg"/>
 <img src="/r/2-5.png" width="600" height="400" alt=""/>
 <ul>
   <li><a href="/r/2-5.m4v">Download as video/mp4</a></li>
   <li><a href="/r/2-5.webm">Download as video/webm</a></li>
   <li><a href="/r/2-5.ogv">Download as video/ogg</a></li>
 </ul>
</video>
Fallback options
<video width="600" height="400" poster="/r/2-5.png"
       controls="controls" preload="none">
 <source src="/r/2-5.m4v" type="video/mp4"/>
 <source src="/r/2-5.webm" type="video/webm"/>
 <source src="/r/2-5.ogv" type="video/ogg"/>
 <object width="600" height="400"
         type="application/x-shockwave-flash"
         data="flowplayer-3.2.1.swf">
   <param name="movie" value="flowplayer-3.2.1.swf"/>
   <param name="allowfullscreen" value="true"/>
   <param name="flashvars" value='config={"clip": {"url":
           "/r/2-5.m4v", "autoPlay":false,
           "autoBuffering":true}}'/>
   <img src="/r/2-5.png" width="600" height="400" alt=""/>
   <ul><!-- links --></ul>
 </object>
</video>
For More:
                           @AaronGustafson
                    http://adaptivewebdesign.info
                        http://easy-designs.net
                         http://easy-reader.net

                          Slides available at
               http://slideshare.net/AaronGustafson

            This presentation is licensed under
Creative Commons Attribution-Noncommercial-Share Alike 3.0

                       flickr Photo Credits
   “2008 06 11 - 3257 - Washington DC - N Portal Dr at 16th St.” by thisisbossi
                            “Aruba” by Salvatore.Freni
                              “IMG_6200” by pcutler
                      “Construction material” by raisin bun
                             “TOC” by D'Arcy Norman
                      “HTML5 logo in Braille” by Ted Drake
                     “Dual Samsung Monitors” by steve-uk
                            “Statue of liberty” by gadl
                             “Lego creation” by MiikaS
                        “iFlickr touch screen” by exfordy
                           “Green Plant” by kevin1024
                           “08-jan-28” by sashafatcat
                     “Revere EIGHT - 8mm…” by Kevitivity

More Related Content

What's hot

HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introductiondynamis
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & FriendsRemy Sharp
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtmlsagaroceanic11
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examplesAlfredo Torre
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookScottperrone
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5Jamshid Hashimi
 
Html 5 New Features
Html 5 New FeaturesHtml 5 New Features
Html 5 New FeaturesAta Ebrahimi
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overviewJacob Nelson
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - IntroductionDavy De Pauw
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5Sayed Ahmed
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Aaron Gustafson
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)Clément Wehrung
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video PlayerJim Jeffers
 

What's hot (20)

HTML5
HTML5HTML5
HTML5
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Html 5 New Features
Html 5 New FeaturesHtml 5 New Features
Html 5 New Features
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - Introduction
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]
 
HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 

Similar to HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]

Similar to HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011] (20)

HTML5 & CSS3 Workshop [FoWD NYC 2011]
HTML5 & CSS3 Workshop [FoWD NYC 2011]HTML5 & CSS3 Workshop [FoWD NYC 2011]
HTML5 & CSS3 Workshop [FoWD NYC 2011]
 
HTML5 Semantics
HTML5 SemanticsHTML5 Semantics
HTML5 Semantics
 
Html5
Html5Html5
Html5
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 today
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction
 
Html5
Html5Html5
Html5
 
HTML5
HTML5HTML5
HTML5
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3A practical guide to building websites with HTML5 & CSS3
A practical guide to building websites with HTML5 & CSS3
 
HTML5 - An Introduction
HTML5 - An IntroductionHTML5 - An Introduction
HTML5 - An Introduction
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to html55
Introduction to html55Introduction to html55
Introduction to html55
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
HTML5 Design
HTML5 DesignHTML5 Design
HTML5 Design
 

More from Aaron Gustafson

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Aaron Gustafson
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Aaron Gustafson
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Aaron Gustafson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Aaron Gustafson
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Aaron Gustafson
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Aaron Gustafson
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Aaron Gustafson
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Aaron Gustafson
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Aaron Gustafson
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]Aaron Gustafson
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Aaron Gustafson
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Aaron Gustafson
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Aaron Gustafson
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for EveryoneAaron Gustafson
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Aaron Gustafson
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Aaron Gustafson
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Aaron Gustafson
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Aaron Gustafson
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Aaron Gustafson
 

More from Aaron Gustafson (20)

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
 

Recently uploaded

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]

  • 1. Smart Markup for Smarter Websites Aaron Gustafson Easy Designs, LLC @AaronGustafson slideshare.net/AaronGustafson
  • 2. HTML5 gives you more control over your documents and apps
  • 4. The process is ongoing…
  • 5. …but the end is near. June 2004 WhatWG begins work 2007 May 2011 2014 on Web Applications 1.0 Work begins at W3C HTML5 to Last Call HTML5 Standard? 2004 2014
  • 6. You can use it now
  • 7. fault tolerance n. a system’s ability to continue to operate when it encounters and unexpected error.
  • 8.
  • 9.
  • 10.
  • 11. Browsers ignore what they don’t understand.
  • 13. For example <video poster=”poster.png”> <source src=”video.m4v”/> <source src=”video.webm”/> <source src=”video.ogv”/> <img src=”poster.png” alt=””/> <ul> <li><a href="video.m4v">Download MP4</a></li> <li><a href="video.webm">Download WebM</a></li> <li><a href="video ogv">Download Ogg</a></li> </ul> </video>
  • 14. Now back to those cowpaths…
  • 15. A great idea that we lost. Albert Einstein <fig> <img src="photo.jpeg" alt=""/> <caption>Photo of Albert Einstein</caption> </fig> The original concept in HTML3: http://www.w3.org/MarkUp/html3/figures.html
  • 16. Microformats brought it back. Albert Einstein <div class="figure"> <img class="image" src="photo.jpeg" alt=""/> <p class="caption">Albert Einstein</p> </div> The original “figure” microformat.
  • 17. HTML5 re-imagined it. Albert Einstein <figure> <img src="photo.jpeg" alt=""/> <legend>Albert Einstein</legend> </figure> The original HTML5 figure.
  • 18. Microformats adapted. Albert Einstein <div class="figure"> <img class="image" src="photo.jpeg" alt=""/> <p class="captionlegend">Albert Einstein</p> </div> The revised (and now draft) “figure” microformat: http://microformats.org/wiki/figure
  • 19. Microformats adapted. Albert Einstein <figure> <img src="photo.jpeg" alt=""/> <figcaption>Albert Einstein</figcaption> </figure> The current (dare I say final?) HTML5 figure.
  • 20. What’s the easiest way to write HTML5?
  • 21. Use the new doctype <!DOCTYPE html>
  • 22. The HTML4 Lexicon html meta head link style title base body dl dt dd bdo script noscript map dfn b object param p div ul ol li cite iframe address area img br a small pre code abbr kbd var q samp hr menu textarea ins del sub sup span strong select option optgroup label input form fieldset legend button i em blockquote h1 h2 h3 h4 h5 h6 table caption col colgroup thead tbody tfoot tr th td
  • 23. The HTML5 Lexicon html meta head link style title base body dl dt dd section article bdo script noscript map dfn b aside details summary object param p div ul ol li cite canvas audio video iframe address area img br a small nav figure figcaption pre code abbr kbd var q samp hr menu header footer command textarea ins del sub sup span strong time source datalist select option optgroup label input output ruby progress form fieldset legend button i em mark hgroup meter blockquote h1 h2 h3 h4 h5 h6 wbr keygen embed table caption col colgroup rt rp thead tbody tfoot tr th td
  • 24. Our focus today html meta head link style title base body dl dt dd section article bdo script noscript map dfn b aside details summary object param p div ul ol li cite canvas audio video iframe address area img br a small nav figure figcaption pre code abbr kbd var q samp hr menu header footer command textarea ins del sub sup span strong time source datalist select option optgroup label input output ruby progress form fieldset legend button i em mark hgroup meter blockquote h1 h2 h3 h4 h5 h6 wbr keygen embed table caption col colgroup rt rp thead tbody tfoot tr th td
  • 25. If only life were simpler…
  • 26. Simplification The html element <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html lang="en">
  • 27. Simplification Character encoding <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta charset="utf-8" />
  • 28. Simplification Styles and scripts <link rel="stylesheet" href="style-original.css" type="text/css" /> <style type=”text/css”> /* … */ </style> <script type=”text/javascript” src=”myscript.js”></script> <link rel="stylesheet" href="style-original.css" /> <style> /* … */ </style> <script src=”myscript.js”></script>
  • 30. Nip/tuck The em element Represents a span of text text with emphatic stress. <p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p> The strong element Represents a span of text of great importance. <p>Please fill out the form below. <strong>Note: all fields are required.</strong></p>
  • 31. Evil incarnate The small element Represents so-called “fine print” (e.g. disclaimers, caveats, etc.).
  • 32. Clarification The cite element The title of a cited work (e.g. a book, magazine, or journal). <p>In <cite>Web Form Design</cite>, Luke Wroblewski draws on original research, his considerable experience at Yahoo! and eBay, and the perspectives of many of the field’s leading designers to show you everything you need to know about designing effective and engaging Web forms.</p>
  • 33. Resurrection The b element Represents a span of text offset from its surrounding content, but of no extra importance. <p>This presentation is about <b>HTML5</b>.</p> The i element Represents a span of text in an alternate voice or mood. <p>The <code>b</code> and <code>i</code> elements have been legitimized in HTML5. <i>Go figure.</i></p>
  • 34. Deeper meaning The hr element Represents a paragraph-level thematic break.
  • 36. Organization The section element Represents a section of a document, typically with a title or heading. <section> <!-- pretty much anything can go here --> </section> The article element Represents a section of content that forms an independent part of a document or site. <article> <!-- pretty much anything can go here --> </article>
  • 37.
  • 38. section 38
  • 40. 40
  • 41. article 41
  • 43. Organization The header element Represents the header of a section. <header> <!-- titles, etc. go here --> </header> The footer element Represents the footer of a section. <footer> <!-- meta/supplementary information goes here --> </footer>
  • 44. 44
  • 45. header 45
  • 46. 46
  • 47. footer 47
  • 48. article 48
  • 50. article 50
  • 52. Organization The nav element Demarcates a group of navigational links. <nav> <ol> <li><a href="#details">Details</a></li> <li><a href="#lodging">Lodging</a></li> <li><a href="#location">Location</a></li> <li><a href="#topics">Topics</a></li> <li><a href="#contact">Contact Us</a></li> </ol> <p><a href="register">Register Now</a> <b>Only 5 spaces left</b></p> </nav>
  • 53. 53
  • 54. nav 54
  • 55. 55
  • 56. nav 56
  • 57. Organization The aside element Demarcates content that is tangentially related to the primary content. <article> <!-- main content --> <aside> <!-- something related --> </aside> </article>
  • 58. 58
  • 59. aside 59
  • 60. Organization The details element A UI control for hiding optional content. Must contain a summary element, followed by other content. <details> <summary>This is the visible description</summary> <p>This content would be hidden by default.</p> </details> It’s not implemented in any browser yet, this is just an example of how it could work. (Ripped from http://2010.full-frontal.org).
  • 61. Organization The figure element A unit of content (typically referenced by the primary content) that is self-contained. May contain a figcaption element and other content. <figure id="fig-1"> <img src="photo.jpeg" alt=""/> <figcaption>Photo of Albert Einstein</figcaption> </figure> <figure id="fig-2"> <table> <caption>2011 Forecast Earnings</caption> <!-- a bunch of data --> </table> </figure>
  • 63. Implicit sections <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
  • 64. Explicit sections <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
  • 65. Explicit sections <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h1> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h1> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
  • 66. Explicit sections <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h4> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h6> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup A snippet of the Wikipedia entry on HTML5: http://en.wikipedia.org/wiki/HTML5
  • 67. Sectioning elements Create explicit sections in an outline. ๏ section (obviously) ๏ article ๏ aside ๏ footer ๏ header ๏ nav
  • 68. Outline limitations <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Subtitle
  • 69. Heading groups FTW! hgroup <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title
  • 70. Sectioning roots Establish a new outline. ๏ body (obviously) ๏ blockquote ๏ details ๏ fieldset ๏ figure ๏ td
  • 71. Rooted sections <h1> Title <p> Text content continues... <p> Text content continues... <h2> Section heading <p> Text content continues... <blockquote> <h2> Rooted heading <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Section heading
  • 72. New elements to consider
  • 73. When? The time element Represents a date and/or time.
  • 74. 74
  • 75. time 75
  • 76. When? The time element Represents a date and/or time. <time>October 25, 2010 8:11 PM</time>
  • 77. When? The time element Represents a date and/or time. <time>October 25, 2010 8:11 PM</time> <time datetime="2010-10-25T20:11:00-05:00"> October 25, 2010 8:11 PM</time>
  • 78. When? The time element Represents a date and/or time. <time>October 25, 2010 8:11 PM</time> <time datetime="2010-10-25T20:11:00-05:00"> October 25, 2010 8:11 PM</time> <time datetime="2010-10-25T20:11:00-05:00" pubdate="pubdate">October 25, 2010 8:11 PM</time>
  • 79. Highlighting The mark element Represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. <ol id="search-results"> <li> <h3><a href="...">Web Upgrade <mark>HTML5</mark> May Weaken Privacy</a></h3> <p>The new language, <mark>HTML5</mark>, could give marketers access to many more details about users' online activities.</p> </li> </ol>
  • 80. 80
  • 81. 81
  • 82. mark 82
  • 83. mark 83
  • 85. Dates and times <input type=”datetime”> A UI control for selecting a date and time that includes timezone information. <input type=”datetime-local”> A UI control for selecting a date and time that does not include timezone information. <input type=”date”> A UI control for selecting a date with access to all date components (day, month and year). <input type=” month”> A UI control for selecting a date that provides access to month and year only. <input type=”time”> A UI control for selecting a time that does not include timezone information. <input type=”week”> A UI control for selecting a date that provides access to week and year only.
  • 86. Dates and times Safari Opera <input type="date" name="dob"/>
  • 87. Numbers <input type=”number”> A UI control for selecting a number. <input type=”range”> A UI control for selecting an imprecise number.
  • 88. Numbers <input type="number" name="foo"/> <input type="range" min="1" max="11" name="foo"/>
  • 89. New types <input type=”email”> A UI control for entering an email. <input type=”url”> A UI control for entering a URL. <input type=”tel”> A UI control for entering a telephone number.
  • 90. New types <input type="email" …/> <input type="url" …/>
  • 91. UI control attributes autocomplete Tells the User Agent whether or not the value should be stored. autofocus Tells the User Agent to bring focus to the form control on page load. form An id reference to the form to which a given control belongs. required Indicated the form control must be provided a value. placeholder Offers users a short hint about the required value.
  • 92. Value control min and max Lower and upper boundary for an element value (dates, time, and numbers only). step The granularity of values allowed (dates, time, and numbers only). <input type="range" min="1" max="11" step="0.5" .../>
  • 93. Value control pattern A regular expression pattern that the User Agent should validate the input against. <input type="text" pattern="d{6}w{3}" placeholder="6 digits followed by 3 letters" .../>
  • 94. Value control pattern An id reference to a datalist element containing acceptable values. <input type="text" list="countries" name="country"/> <datalist id="countries"> <option>Afghanistan</option> <option>Åland Islands</option> <!-- ... --> </datalist>
  • 95. 95
  • 96. Truth based on perspective
  • 97.
  • 98. ?
  • 101.
  • 102. ?
  • 104. <button>Search Mail</button> <div>Search Mail</div>
  • 105. ARIA maps the OS to the web
  • 108. All the site’s a play... The role attribute Defines the part an element is playing (assuming it’s different than the semantics would otherwise imply). <section id="main" role="main"> <!-- The primary content for the page would go here --> </section>
  • 109.
  • 114.
  • 117.
  • 119. Landmark roles application A region of the page representing a unique software unit executing a set of tasks for its users. It is an area where assistive technologies should also return browse navigation keys back over to the web application in this region. banner A region that contains the prime heading or internal title of a page. complementary A supporting section of the document that remains meaningful even when separated from the main content. contentinfo Metadata that applies to the parent document. form A region of the document that represents a collection of form-associated elements. main navigation search
  • 120. Landmark roles main The main content of a document. navigation A collection of navigational elements (usually links) for navigating the document or related documents. search The search tool of a web document.
  • 122.
  • 124. Structural roles article A section of a page that forms an independent part of a document, page, or site. group A set of user interface objects which are not intended to be included in a page summary or table of contents by assistive technologies. note A section whose content is parenthetic or ancillary to the main content of the resource. presentation An element whose implicit native semantics will not be mapped to the accessibility API. region A large perceivable section of a web page or document, that the author feels is important enough to be included in a page summary or table of contents. separator A divider that separates and distinguishes sections of content or groups of menu items.
  • 125. Semantic comparison Ad-hoc ARIA Role HTML5 #header, #top banner header (kind of) #main, #content main none #extra, .sidebar complementary, note aside #footer, #bottom contentinfo footer #nav navigation nav .hentry article article
  • 128. Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better)
  • 129. Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div>
  • 130. Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div> <div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /> </div>
  • 133.
  • 139.
  • 141. Widget states B B (off) (on) <span> <img src="bold-off.png" alt="bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 142. Widget states B B (off) (on) <span> <img src="bold-off.png" alt="not bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 143. Widget states B B (off) (on) <span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /> </span> <span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /> </span>
  • 147. Live regions <input class="tweet-counter" value="140" disabled="disabled">
  • 148. Live regions <span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong> </span>
  • 149. Live regions <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span> .hidden { position: absolute; left: −999em; }
  • 150. Live regions <span class="tweet-counter">maximum of 140 characters</span> <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>
  • 151. Live regions <span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>
  • 153. Notification options off change not announced polite change announced after user completes her current activity assertive user agent should interrupt the user’s activity, but not immediately
  • 154. Who is Supporting WAI-ARIA?
  • 155. Music to our ears
  • 156. Can you hear me now? The audio element <audio src="my.oga" controls="controls"></audio>
  • 157. Can you hear me now? Browser .aac .mp3 .oga .wav Chrome 6+ YES YES YES NO Firefox 3.6+ NO NO YES YES Internet Explorer 9+ YES YES NO YES Opera 10.5+ NO NO YES YES Safari 5+ YES YES NO YES
  • 158. Can you hear me now? <audio controls="controls"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --> </audio>
  • 159. Available attributes src URL for the audio file. autoplay A boolean specifying whether or not the file should play as soon as it can. loop A boolean specifying whether or not playback of the file should be repeated. controls A boolean that tells the browser to use its default media controls. preload Tells the browser what to content to preload. Options: “none,” “metadata,” and “auto.” autobuffer (deprecated) A boolean defining whether the file should be buffered in advance. Replaced by preload.
  • 160. Can you hear me now? <audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --> </audio>
  • 161. Fallback options <audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <ul> <li><a href="my.mp3">Download as audio/mp3</a></li> <li><a href="my.oga">Download as audio/ogg</a></li> </ul> </audio>
  • 162. Fallback options <audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <object …> <!-- flash player goes here --> </object> </audio>
  • 163. Fallback options $('audio').each(function(){ var $audio = $(this), media = {}, formats = []; $audio.find('source').each(function(){ var src = $(this).attr('src'), ext = src.split('.').pop(); media[ext] = src; formats.push(ext); }); $audio.jPlayer({ swfPath: '/vendors/jPlayer', ready: function(){ $audio.jPlayer('setMedia', media); }, supplied: formats.join(', ') }); }); Using jQuery & jPlayer
  • 164. Roll your own $('audio').each(function(){ var audio = this, $button = $('<button>Play</button>') .click(function(){ audio.play(); }); $(this) .removeAttr('controls') .after($button); }); Using jQuery
  • 165. Opiate of the masses
  • 166. Elementary, my dear Watson The video element <video src="my.ogv" controls="controls"></video>
  • 167. Not so elementary Video file = container file (like ZIP) ๏ 1 video track ๏ 1 (or more) audio tracks ๏ metadata ๏ subtitle/caption tracks (optional)
  • 168. Not so elementary Video formats Flash Video (.flv) Prior to 2008, the only video format supported in Adobe Flash. MPEG 4 (.m4v or .mp4) Based on QuickTime; iTunes uses this format. Ogg (.ogv) Open source container format. WebM (.webm) New format announced in May 2010.
  • 169. Not so elementary Video codecs H.264 Used primarily in MPEG 4. Only video codec natively supported on iOS. Patented. Theora Used primarily in Ogg. Royalty free. Supported in Firefox 3.5+ (in Ogg). VP8 Used primarily in WebM. Owned by Google, but licensed royalty-free.
  • 170. Not so elementary Audio codecs MP3 Nearly universal in usage, but was part of FLV. Patented. AAC (Advanced Audio Coding) Used primarily in MP4. Patented. Vorbis Used in Ogg audio & video as well as WebM. Royalty-free.
  • 171. Not so elementary Browser .m4v .ogv .webm (AAC + H.264) (Vorbis + Theora) (Vorbis + VP8) Chrome 3+ 3+ 6+ (for now) Firefox NO 3.5+ 4+ Internet Explorer 9+ NO MAYBE Opera NO 10.5+ 10.6+ Safari 3.1+ MAYBE MAYBE
  • 172. Format juggling <video controls="controls" width="640" height="480"> <source src="my.m4v"/> <source src="my.webm"/> <source src="my.ogv"/> <!-- fallback --> </video>
  • 173. A good first impression <video controls="controls" width="640" height="480" poster="my.png"> <source src="my.m4v"/> <source src="my.webm"/> <source src="my.ogv"/> <!-- fallback --> </video>
  • 174. Kindness to strangers <video controls="controls" width="640" height="480" poster="my.png"> <source src="my.m4v" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/> <source src="my.webm" type='video/webm; codecs="vp8, vorbis"'/> <source src="my.ogv" type='video/ogg; codecs="theora, vorbis"'/> <!-- fallback --> </video> Note: The MPEG 4 codec will depend on the encoding “profiles” you use.
  • 175. Available attributes src URL for the audio file. autoplay A boolean specifying whether or not the file should play as soon as it can. loop A boolean specifying whether or not playback of the file should be repeated. controls A boolean that tells the browser to use its default media controls. poster The image to be shown while the video is not activated. preload Tells the browser what to content to preload. Options: “none,” “metadata,” and “auto.” autobuffer (deprecated) A boolean defining whether the file should be buffered in advance. Replaced by preload.
  • 176. No MIME, no service AddType video/ogg .ogv AddType video/mp4 .mp4 AddType video/webm .webm
  • 177. Fallback options <video width="600" height="400" poster="/r/2-5.png" controls="controls" preload="none"> <source src="/r/2-5.m4v" type="video/mp4"/> <source src="/r/2-5.webm" type="video/webm"/> <source src="/r/2-5.ogv" type="video/ogg"/> <img src="/r/2-5.png" width="600" height="400" alt=""/> <ul> <li><a href="/r/2-5.m4v">Download as video/mp4</a></li> <li><a href="/r/2-5.webm">Download as video/webm</a></li> <li><a href="/r/2-5.ogv">Download as video/ogg</a></li> </ul> </video>
  • 178. Fallback options <video width="600" height="400" poster="/r/2-5.png" controls="controls" preload="none"> <source src="/r/2-5.m4v" type="video/mp4"/> <source src="/r/2-5.webm" type="video/webm"/> <source src="/r/2-5.ogv" type="video/ogg"/> <object width="600" height="400" type="application/x-shockwave-flash" data="flowplayer-3.2.1.swf"> <param name="movie" value="flowplayer-3.2.1.swf"/> <param name="allowfullscreen" value="true"/> <param name="flashvars" value='config={"clip": {"url": "/r/2-5.m4v", "autoPlay":false, "autoBuffering":true}}'/> <img src="/r/2-5.png" width="600" height="400" alt=""/> <ul><!-- links --></ul> </object> </video>
  • 179. For More: @AaronGustafson http://adaptivewebdesign.info http://easy-designs.net http://easy-reader.net Slides available at http://slideshare.net/AaronGustafson This presentation is licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 flickr Photo Credits “2008 06 11 - 3257 - Washington DC - N Portal Dr at 16th St.” by thisisbossi “Aruba” by Salvatore.Freni “IMG_6200” by pcutler “Construction material” by raisin bun “TOC” by D'Arcy Norman “HTML5 logo in Braille” by Ted Drake “Dual Samsung Monitors” by steve-uk “Statue of liberty” by gadl “Lego creation” by MiikaS “iFlickr touch screen” by exfordy “Green Plant” by kevin1024 “08-jan-28” by sashafatcat “Revere EIGHT - 8mm…” by Kevitivity