SlideShare a Scribd company logo
Audio
&Video
in HTML5

Aaron Gustafson
Easy Designs, LLC
slideshare.net/AaronGustafson
Audio & Video




                2
Audio & Video




“I want to see
   the end of
  the plug-in”
         —HTML5
Audio & Video




We’re almost there
Audio & Video




  Older browsers
still need a fallback
Audio & Video




  Older browsers
still need a fallback
      (Usually Flash)
Audio & Video




Music to our ears
Audio & Video




Can you hear me now?
The audio element
<audio src="my.oga" controls="controls"></audio>
Audio & Video




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
Audio & Video




Can you hear me now?
<audio controls="controls">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <!-- fallback -->
</audio>
Audio & Video




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.
Audio & Video




Can you hear me now?
<audio controls="controls" autobuffer="autobuffer"
        preload="auto">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <!-- fallback -->
</audio>
Audio & Video




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>
Audio & Video




Fallback options
<audio controls="controls" autobuffer="autobuffer"
        preload="auto">
 <source src="my.mp3"/>
 <source src="my.oga"/>
 <object …>
   <!-- flash player goes here -->
 </object>
</audio>
Audio & Video




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
Audio & Video




Roll your own
$('audio').each(function(){
   var audio = this,
   $button = $('<button>Play</button>')
               .click(function(){
                  audio.play();
                });
   $(this)
    .removeAttr('controls')
    .after($button);
 });
                                             Using jQuery
Audio & Video




Opiate of the masses
Audio & Video




Elementary, my dear Watson
The video element
<video src="my.ogv" controls="controls"></video>
Audio & Video




Not so elementary
Video file = container file (like ZIP)

๏ 1 video track
๏ 1 (or more) audio tracks
๏ metadata
๏ subtitle/caption tracks (optional)
Audio & Video




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.
Audio & Video




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.
Audio & Video




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.
Audio & Video




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
Audio & Video




Format juggling
<video controls="controls" width="640" height="480">
 <source src="my.m4v"/>
 <source src="my.webm"/>
 <source src="my.ogv"/>
 <!-- fallback -->
</video>
Audio & 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>
Audio & 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.
Audio & Video




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.
Audio & Video




No MIME, no service
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
Audio & 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"/>
 <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>
Audio & 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>
Audio & Video




How the sausage is made
Audio & Video




Tools of the trade

                     RoadMovie
   Firefogg
Audio & Video




Working with RoadMovie
Audio & Video




Working with RoadMovie
Audio & Video




Working with RoadMovie
Audio & Video




Working with RoadMovie
Subtitle formats
SubRip (.srt)
SubViewer (.sub)
SubStation Alpha (.ssa/.ass)
MicroDVD
Audio & Video




Working with RoadMovie
Subtitle formats
SubRip (.srt)

 1
 00:01:31,041 --> 00:01:32,000
 Hello?

 2
 00:02:10,164 --> 00:02:12,082
 Good morning, is your mother in?
Audio & Video




Working with RoadMovie
Subtitle formats
SubViewer (.sub)

 00:01:31.04,00:01:32.00
 Hello?

 00:02:10.16,00:02:12.08
 Good morning, is your mother in?
Audio & Video




Working with RoadMovie
Audio & Video




Working with Firefogg
Audio & Video




Working with Firefogg
Audio & Video




Working with Firefogg
Audio & Video




Working with Firefogg
Audio & Video




Working with Firefogg
Audio & Video




Working with Firefogg
Audio & Video




Service please
Audio & Video




The Future: Media Fragments
// temporal
http://www.example.com/video.ogv#t=10,20

// Live streaming
http://www.example.com/video.ogv#t=clock:2009-07-26T11:19:01Z,
2009-07-26T11:20:01Z

// Rectangular region
http://www.example.com/video.ogv#xywh=160,120,320,240

// Track selection
http://www.example.com/video.ogv#track=”video”
             http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/
Audio & Video




The Future: Media Annotations
var title = song.getMediaProperty(["title"]);

if ( noErrorStatus(title[0].status) == true )
{
    // title = [ { "Title" : {
    //      "propertyName" : "title",
    //      "titleLabel" : "Artificial Horizon" ,
    //      "typeLink" : "http://www.ebu.ch/metadata/cs/
ebu_ObjectTypeCodeCS.xml#21",
    //      "typeLabel" : "Album title",
    //      "statusCode" : 200
    // } } ]
}
       http://dev.w3.org/2008/video/mediaann/mediaont-api-1.0/mediaont-api-1.0.html
Audio & Video




The Future: Timed Text
<video src="elephant.ogv" poster="elephant.png">
   <itext id="video_ar" lang="ar" type="text/srt"
          charset="Windows-1256" display="auto"
          src="elephant.ar.srt" category="SUB"></itext>
   <itext id="video_zh" lang="zh" type="text/srt"
          charset="GB18030" display="auto"
          src="elephant.zh.srt" category="SUB"></itext>
   <itext id="video_es" lang="es" type="text/srt"
          charset="ISO-8859" display="auto"
          src="elephant.es.srt" category="SUB"></itext>
   <itext id="audiodesc" lang="en" type="text/srt"
          charset="ISO-8859" display="yes"
          src="audiodescription.srt" category="TAD"></itext>
</video>
Audio & Video




The Future: Timed Text
<video src="elephant.ogv" poster="elephant.png">
   <track srclang="ar" src="elephant.ar.srt"
           label=”!"#$%&‫ ”ا‬kind="subtitles"/>
   <track srclang="zh" src="elephant.zh.srt"
          label=”汉语” kind="subtitles"/>
   <track srclang="es" src="elephant.es.srt"
          label=”Español” kind="subtitles"/>
   <track src="audiodescription.srt" kind="descriptions"
          label=”Audio Descriptions”/>
</video>
Audio & Video




The Future: Timed Text




    http://www.annodex.net/~silvia/itext/elephant_no_skin_v2.html
Audio & Video




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

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

               flickr Photo Credits
    “Revolutionary Technology…” by Jimee, Jackie, Tom & Asha
                   “08-jan-28” by sashafatcat
              “Revere EIGHT - 8mm…” by Kevitivity
              “Sausage Making Machinery” by erix!

More Related Content

What's hot

Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV Foundation
Chris Adamson
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las Vegas
Chris Adamson
 
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologiesCraft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Máté Nádasdi
 
Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)
Chris Adamson
 
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Chris Adamson
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV Foundation
Bob McCune
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
Chris Adamson
 
How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013
Security Weekly
 
Html 5 full course
Html 5 full courseHtml 5 full course
Html 5 full course
AbhishekMondal42
 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video Tricks
Chris Adamson
 
NodeJS Edinburgh Video Killed My Data Plan
NodeJS Edinburgh Video Killed My Data PlanNodeJS Edinburgh Video Killed My Data Plan
NodeJS Edinburgh Video Killed My Data Plan
Doug Sillars
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV Foundation
Bob McCune
 
Wordpress Beyond Websites
Wordpress Beyond WebsitesWordpress Beyond Websites
Wordpress Beyond Websites
Scott Saunders
 
AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14
Ryder Mackay
 
Video Killed My Data Plan: Helsinki
Video Killed My Data Plan: HelsinkiVideo Killed My Data Plan: Helsinki
Video Killed My Data Plan: Helsinki
Doug Sillars
 
Video editimi tutorial
Video editimi tutorialVideo editimi tutorial
Video editimi tutorial
Artur Gjino
 
Video performance glasgow
Video performance glasgowVideo performance glasgow
Video performance glasgow
Doug Sillars
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
Yoss Cohen
 

What's hot (19)

Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV Foundation
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las Vegas
 
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologiesCraft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologies
 
Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)
 
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV Foundation
 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
 
How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013
 
Html 5 full course
Html 5 full courseHtml 5 full course
Html 5 full course
 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video Tricks
 
NodeJS Edinburgh Video Killed My Data Plan
NodeJS Edinburgh Video Killed My Data PlanNodeJS Edinburgh Video Killed My Data Plan
NodeJS Edinburgh Video Killed My Data Plan
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV Foundation
 
Wordpress Beyond Websites
Wordpress Beyond WebsitesWordpress Beyond Websites
Wordpress Beyond Websites
 
AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14AVFoundation @ TACOW 2013 05 14
AVFoundation @ TACOW 2013 05 14
 
Video Killed My Data Plan: Helsinki
Video Killed My Data Plan: HelsinkiVideo Killed My Data Plan: Helsinki
Video Killed My Data Plan: Helsinki
 
Video editimi tutorial
Video editimi tutorialVideo editimi tutorial
Video editimi tutorial
 
Video performance glasgow
Video performance glasgowVideo performance glasgow
Video performance glasgow
 
How To Theme Fedora
How To Theme FedoraHow To Theme Fedora
How To Theme Fedora
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
 

Similar to HTML5 Audio & Video

HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...Patrick Lauke
 
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012Patrick Lauke
 
HTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're goingHTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're going
brucelawson
 
HTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're goingHTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're going
brucelawson
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
Christian Heilmann
 
web programming & scripting 2
web programming & scripting 2web programming & scripting 2
web programming & scripting 2
Swapnali Pawar
 
HTML5 Multimedia Support
HTML5 Multimedia SupportHTML5 Multimedia Support
HTML5 Multimedia Support
Henry Osborne
 
HTML5 Video Right Now
HTML5 Video Right NowHTML5 Video Right Now
HTML5 Video Right NowCarlos Araya
 
HTML5 Video for WordPress
HTML5 Video for WordPressHTML5 Video for WordPress
HTML5 Video for WordPress
steveheffernan
 
Responsive Videos, mehr oder weniger
Responsive Videos, mehr oder wenigerResponsive Videos, mehr oder weniger
Responsive Videos, mehr oder weniger
Walter Ebert
 
HTML5 Video Presentation
HTML5 Video PresentationHTML5 Video Presentation
HTML5 Video Presentationsith33
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
Hamza Zahid
 
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...Patrick Lauke
 
FYBSC IT Web Programming Unit II Audio Video in HTML
FYBSC IT Web Programming Unit II  Audio  Video in HTMLFYBSC IT Web Programming Unit II  Audio  Video in HTML
FYBSC IT Web Programming Unit II Audio Video in HTML
Arti Parab Academics
 
Intro to HTML5 audio tag
Intro to HTML5 audio tagIntro to HTML5 audio tag
Intro to HTML5 audio tag
satejsahu
 
Chapter 11 - Web Design
Chapter 11 - Web DesignChapter 11 - Web Design
Chapter 11 - Web Design
tclanton4
 
State of Media Accessibility in HTML5
State of Media Accessibility in HTML5State of Media Accessibility in HTML5
State of Media Accessibility in HTML5
Silvia Pfeiffer
 
HTML Media: Where We Are & Where We Need To Go
HTML Media: Where We Are & Where We Need To GoHTML Media: Where We Are & Where We Need To Go
HTML Media: Where We Are & Where We Need To Go
Nigel Parker
 
Mobile Web Video
Mobile Web VideoMobile Web Video
Mobile Web Video
Sarah Allen
 
Upgrade to HTML5 Video
Upgrade to HTML5 VideoUpgrade to HTML5 Video
Upgrade to HTML5 Videosteveheffernan
 

Similar to HTML5 Audio & Video (20)

HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona /...
 
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012
HTML5 multimedia - browser-native video and audio - JSDay / Verona / 17 May 2012
 
HTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're goingHTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're going
 
HTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're goingHTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're going
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
 
web programming & scripting 2
web programming & scripting 2web programming & scripting 2
web programming & scripting 2
 
HTML5 Multimedia Support
HTML5 Multimedia SupportHTML5 Multimedia Support
HTML5 Multimedia Support
 
HTML5 Video Right Now
HTML5 Video Right NowHTML5 Video Right Now
HTML5 Video Right Now
 
HTML5 Video for WordPress
HTML5 Video for WordPressHTML5 Video for WordPress
HTML5 Video for WordPress
 
Responsive Videos, mehr oder weniger
Responsive Videos, mehr oder wenigerResponsive Videos, mehr oder weniger
Responsive Videos, mehr oder weniger
 
HTML5 Video Presentation
HTML5 Video PresentationHTML5 Video Presentation
HTML5 Video Presentation
 
HTML5 audio & video
HTML5 audio & videoHTML5 audio & video
HTML5 audio & video
 
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...
HTML5 multimedia - browser-native video, audio and canvas - meet.js Summit / ...
 
FYBSC IT Web Programming Unit II Audio Video in HTML
FYBSC IT Web Programming Unit II  Audio  Video in HTMLFYBSC IT Web Programming Unit II  Audio  Video in HTML
FYBSC IT Web Programming Unit II Audio Video in HTML
 
Intro to HTML5 audio tag
Intro to HTML5 audio tagIntro to HTML5 audio tag
Intro to HTML5 audio tag
 
Chapter 11 - Web Design
Chapter 11 - Web DesignChapter 11 - Web Design
Chapter 11 - Web Design
 
State of Media Accessibility in HTML5
State of Media Accessibility in HTML5State of Media Accessibility in HTML5
State of Media Accessibility in HTML5
 
HTML Media: Where We Are & Where We Need To Go
HTML Media: Where We Are & Where We Need To GoHTML Media: Where We Are & Where We Need To Go
HTML Media: Where We Are & Where We Need To Go
 
Mobile Web Video
Mobile Web VideoMobile Web Video
Mobile Web Video
 
Upgrade to HTML5 Video
Upgrade to HTML5 VideoUpgrade to HTML5 Video
Upgrade to HTML5 Video
 

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 Everyone
Aaron 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 2
Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
Aaron 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

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

HTML5 Audio & Video

  • 1. Audio &Video in HTML5 Aaron Gustafson Easy Designs, LLC slideshare.net/AaronGustafson
  • 3. Audio & Video “I want to see the end of the plug-in” —HTML5
  • 4. Audio & Video We’re almost there
  • 5. Audio & Video Older browsers still need a fallback
  • 6. Audio & Video Older browsers still need a fallback (Usually Flash)
  • 7. Audio & Video Music to our ears
  • 8. Audio & Video Can you hear me now? The audio element <audio src="my.oga" controls="controls"></audio>
  • 9. Audio & Video 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
  • 10. Audio & Video Can you hear me now? <audio controls="controls"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --> </audio>
  • 11. Audio & Video 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.
  • 12. Audio & Video Can you hear me now? <audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --> </audio>
  • 13. Audio & Video 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>
  • 14. Audio & Video Fallback options <audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <object …> <!-- flash player goes here --> </object> </audio>
  • 15. Audio & Video 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
  • 16. Audio & Video Roll your own $('audio').each(function(){ var audio = this, $button = $('<button>Play</button>') .click(function(){ audio.play(); }); $(this) .removeAttr('controls') .after($button); }); Using jQuery
  • 17. Audio & Video Opiate of the masses
  • 18. Audio & Video Elementary, my dear Watson The video element <video src="my.ogv" controls="controls"></video>
  • 19. Audio & Video Not so elementary Video file = container file (like ZIP) ๏ 1 video track ๏ 1 (or more) audio tracks ๏ metadata ๏ subtitle/caption tracks (optional)
  • 20. Audio & Video 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.
  • 21. Audio & Video 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.
  • 22. Audio & Video 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.
  • 23. Audio & Video 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
  • 24. Audio & Video Format juggling <video controls="controls" width="640" height="480"> <source src="my.m4v"/> <source src="my.webm"/> <source src="my.ogv"/> <!-- fallback --> </video>
  • 25. Audio & 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>
  • 26. Audio & 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.
  • 27. Audio & Video 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.
  • 28. Audio & Video No MIME, no service AddType video/ogg .ogv AddType video/mp4 .mp4 AddType video/webm .webm
  • 29. Audio & 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"/> <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>
  • 30. Audio & 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>
  • 31. Audio & Video How the sausage is made
  • 32. Audio & Video Tools of the trade RoadMovie Firefogg
  • 33. Audio & Video Working with RoadMovie
  • 34. Audio & Video Working with RoadMovie
  • 35. Audio & Video Working with RoadMovie
  • 36. Audio & Video Working with RoadMovie Subtitle formats SubRip (.srt) SubViewer (.sub) SubStation Alpha (.ssa/.ass) MicroDVD
  • 37. Audio & Video Working with RoadMovie Subtitle formats SubRip (.srt) 1 00:01:31,041 --> 00:01:32,000 Hello? 2 00:02:10,164 --> 00:02:12,082 Good morning, is your mother in?
  • 38. Audio & Video Working with RoadMovie Subtitle formats SubViewer (.sub) 00:01:31.04,00:01:32.00 Hello? 00:02:10.16,00:02:12.08 Good morning, is your mother in?
  • 39. Audio & Video Working with RoadMovie
  • 40. Audio & Video Working with Firefogg
  • 41. Audio & Video Working with Firefogg
  • 42. Audio & Video Working with Firefogg
  • 43. Audio & Video Working with Firefogg
  • 44. Audio & Video Working with Firefogg
  • 45. Audio & Video Working with Firefogg
  • 47. Audio & Video The Future: Media Fragments // temporal http://www.example.com/video.ogv#t=10,20 // Live streaming http://www.example.com/video.ogv#t=clock:2009-07-26T11:19:01Z, 2009-07-26T11:20:01Z // Rectangular region http://www.example.com/video.ogv#xywh=160,120,320,240 // Track selection http://www.example.com/video.ogv#track=”video” http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/
  • 48. Audio & Video The Future: Media Annotations var title = song.getMediaProperty(["title"]); if ( noErrorStatus(title[0].status) == true ) { // title = [ { "Title" : { // "propertyName" : "title", // "titleLabel" : "Artificial Horizon" , // "typeLink" : "http://www.ebu.ch/metadata/cs/ ebu_ObjectTypeCodeCS.xml#21", // "typeLabel" : "Album title", // "statusCode" : 200 // } } ] } http://dev.w3.org/2008/video/mediaann/mediaont-api-1.0/mediaont-api-1.0.html
  • 49. Audio & Video The Future: Timed Text <video src="elephant.ogv" poster="elephant.png"> <itext id="video_ar" lang="ar" type="text/srt" charset="Windows-1256" display="auto" src="elephant.ar.srt" category="SUB"></itext> <itext id="video_zh" lang="zh" type="text/srt" charset="GB18030" display="auto" src="elephant.zh.srt" category="SUB"></itext> <itext id="video_es" lang="es" type="text/srt" charset="ISO-8859" display="auto" src="elephant.es.srt" category="SUB"></itext> <itext id="audiodesc" lang="en" type="text/srt" charset="ISO-8859" display="yes" src="audiodescription.srt" category="TAD"></itext> </video>
  • 50. Audio & Video The Future: Timed Text <video src="elephant.ogv" poster="elephant.png"> <track srclang="ar" src="elephant.ar.srt" label=”!"#$%&‫ ”ا‬kind="subtitles"/> <track srclang="zh" src="elephant.zh.srt" label=”汉语” kind="subtitles"/> <track srclang="es" src="elephant.es.srt" label=”Español” kind="subtitles"/> <track src="audiodescription.srt" kind="descriptions" label=”Audio Descriptions”/> </video>
  • 51. Audio & Video The Future: Timed Text http://www.annodex.net/~silvia/itext/elephant_no_skin_v2.html
  • 52. Audio & Video Slides available at http://slideshare.net/AaronGustafson This presentation is licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 flickr Photo Credits “Revolutionary Technology…” by Jimee, Jackie, Tom & Asha “08-jan-28” by sashafatcat “Revere EIGHT - 8mm…” by Kevitivity “Sausage Making Machinery” by erix!