SlideShare a Scribd company logo
HTML5 multimedia
BROWSER-NATIVE VIDEO AND AUDIO




Patrick H. Lauke / DevUp / Barcelona / 27 April 2012
<video>
Adobe Flash currently most common
 video/audio delivery mechanism
<object width="425" height="344">
  <param name="movie"
value="http://www.youtube.com/v/9sEI1AUFJKw&hl=en
&fs=1&"></param>
  <param name="allowFullScreen"
value="true"></param>
  <param name="allowscriptaccess"
value="always"></param>
  <embed
src="http://www.youtube.com/v/9sEI1AUFJKw&hl=en&f
s=1&" type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true"
width="425" height="344"></embed>
</object>
<video src="video.webm"></video>




           originally proposed by Opera in 2007
     dev.opera.com/articles/view/labs-a-call-for-video-on-the-web
<video src="video.webm"
  controls
  autoplay
  muted
  loop
  preload="none|metadata|auto"
  poster="poster.jpg"
  width="320" height="240">
    <a href="video.webm">Download movie</a>
</video>
video as native object
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
people.opera.com/patrickl/experiments/webm/hover+transition
powerful (simple) API
<video> and JavaScript
var v = document.getElementById('player');

v.play()
v.pause()

v.volume = …
v.currentTime = …

v.addEventListener('loadeddata', function() { … }, true)
v.addEventListener('play', function() { … }, true)
v.addEventListener('pause', function() { … }, true)
v.addEventListener('timeupdate', function() { … }, true)
v.addEventListener('ended', function() { … }, true)
www.w3.org/2010/05/video/mediaevents.html
people.opera.com/patrickl/experiments/webm/basic-controls
HTML5 does not specify
how browser controls should look
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
people.opera.com/patrickl/experiments/webm/fancy-controls
people.opera.com/patrickl/experiments/webm/fancy-swap
in-page video on mobile?
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
video formats
the big debate?
HTML5 does not specify
 video container/codec
 (same as with images in HTML 4.01)
MP4/H.264
    or
Ogg Theora
    or
WebM/VP8
MP4 / H.264




ubiquitous, royalty encumbered, licensing
Ogg Theora




    free and open, no licensing fees
not many tools for it, not web optimised
WebM / VP8




  open and royalty-free, web-optimised
support by hardware and software vendors
http://tools.google.com/dlpage/webmmf
Browsers vs codecs
                  Chome Firefox IE      Opera   Safari
  Ogg Theora      ✔        ✔            ✔
  WebM / VP8      ✔        ✔        ?   ✔
  MP4 / H.264     ✔                 ✔           ✔

mobile and devices slightly better...
providing multiple sources
<video controls width="…" height="…">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.webm" type="video/webm">
  <source src="movie.ogv" type="video/ogg">
  <!-- fallback content -->
</video>
specifying codecs
<video controls width="…" height="…">
   <source … type='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'>
   <source … type='video/webm; codecs="vorbis,vp8"'>
   <source … type='video/ogg; codecs="theora,vorbis"'>
   <!-- fallback content -->
</video>
understanding fallback
<video controls width="…" height="…">
   <source … type='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'>
   <!-- fallback content →
   <p>Shown to browsers that don't support video element,
   and NOT just browsers that don't support MP4/H.264</p>
</video>
people.opera.com/patrickl/experiments/webm/wrongsource
feature-detection for codecs
v.canPlayType('video/webm;codecs="vp8,vorbis"')


      "probably" | "maybe" | "" < WAT?
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
video and Responsive Web Design
<source … media="(min-width:1000px)">
<source … media="(max-width:1000px)">
people.opera.com/patrickl/experiments/webm/mediaquery
people.opera.com/patrickl/experiments/webm/mediaquery
flash fallback for older browsers
 http://camendesign.com/code/video_for_everybody
<video controls width="…" height="…">
   <source src="movie.mp4" type="video/mp4" />
   <source src="movie.webm" type="video/webm" />
   <source src="movie.ogv" type="video/ogg" />

   <object width="…" height="…" type="application/x-
shockwave-flash" data="player.swf">
      <param name="movie" value="player.swf" />
      <param name="flashvars" value=" … file=movie.mp4" />
      <!-- fallback content -->
   </object>

</video>
<audio>
audio...exactly the same as video
<audio src=”music.mp3” controls autoplay … ></audio>

<audio controls autoplay>
   <source src="music.mp3" type="audio/mpeg" />
   <source src="music.oga" type="audio/ogg" />
   <!-- fallback content -->
</audio>

formats: MP3 vs Ogg Vorbis (vs WAV)
<canvas>
canvas also works with video
ctx = canvas.getContext("2d");
v = document.getElementsByTagName('video')[0];

ctx.drawImage(v,x1,y1,w1,h2,x2,y2,w2,h2);

grab currently displayed frame (update as appropriate)
html5doctor.com/video-canvas-magic
  html5doctor.com/demos/video-canvas-magic/demo2.html
media.chikuyonok.ru/ambilight
is it all safe to use, right now?
www.youtube.com/html5
don't do browser sniffing



      http://www.flickr.com/photos/timdorr/2096272747/
feature-detection
progressive enhancement, graceful degradation
              diveintohtml5.info/everything.html
feature-detection for audio/video
if (!!document.createElement('video').canPlayType;) { … }

if (!!document.createElement('audio').canPlayType;) { … }
sublimevideo.net
www.jplayer.org
www.textfiles.com/underconstruction
dev.w3.org/2011/webrtc/editor/webrtc.html
dev.w3.org/2011/webrtc/editor/getusermedia.html
camera access
// Opera
navigator.getUserMedia({video:true},success,error);
[…]
video.src = stream;

// WebKit
navigator.webkitGetUserMedia("video",success,error);
[…]
video.src = window.webkitURL.createObjectURL(stream);


        gUM Shield: http://html5doctor.com/getusermedia/
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
neave.com/webcam/html5
shinydemos.com/qr-code
HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012
www.opera.com/developer
   patrick.lauke@opera.com

More Related Content

What's hot (20)

TXT
Widget radio sarkub (nusa radio)
Kampus Menyan
 
TXT
Video
ybagnoel
 
PDF
Html5 - audio and video tags
Rae Allen
 
PDF
State of Media Accessibility in HTML5
Silvia Pfeiffer
 
PPTX
Movie trailer 1
salderton
 
PDF
Web Directions @media 2010
Patrick Lauke
 
PPTX
DoctypeHTML5 (Hyderabad) Presentation on Multimedia
Parashuram N
 
TXT
Document text nou
sigateam
 
PDF
Object width
lolg720915
 
DOC
Vídeo.1
home
 
PPT
Html5 vs Flash video
Frédéric Caron
 
TXT
Video Of Tajmahal
girdhar gopal
 
TXT
Ravi Singh / Campaign Guru Biography
emt_slideshare
 
PPTX
10x10 presentation tag
lesley90
 
DOC
Video embed from atickam.txt
23rd Street Productions Group
 
PDF
Html5 Open Video Tutorial
Silvia Pfeiffer
 
PDF
HTML5 APIs - The New Frontier
Robert Nyman
 
PDF
Vkmdp cologne
Doug Sillars
 
PDF
HTML5 Multimedia: where we are, where we're going
brucelawson
 
TXT
video gameTttte
BrotherhoodTeam
 
Widget radio sarkub (nusa radio)
Kampus Menyan
 
Video
ybagnoel
 
Html5 - audio and video tags
Rae Allen
 
State of Media Accessibility in HTML5
Silvia Pfeiffer
 
Movie trailer 1
salderton
 
Web Directions @media 2010
Patrick Lauke
 
DoctypeHTML5 (Hyderabad) Presentation on Multimedia
Parashuram N
 
Document text nou
sigateam
 
Object width
lolg720915
 
Vídeo.1
home
 
Html5 vs Flash video
Frédéric Caron
 
Video Of Tajmahal
girdhar gopal
 
Ravi Singh / Campaign Guru Biography
emt_slideshare
 
10x10 presentation tag
lesley90
 
Video embed from atickam.txt
23rd Street Productions Group
 
Html5 Open Video Tutorial
Silvia Pfeiffer
 
HTML5 APIs - The New Frontier
Robert Nyman
 
Vkmdp cologne
Doug Sillars
 
HTML5 Multimedia: where we are, where we're going
brucelawson
 
video gameTttte
BrotherhoodTeam
 

Viewers also liked (6)

PDF
HTML5 and friends - standards>next Manchester 24.11.2010
Patrick Lauke
 
PDF
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Patrick Lauke
 
PPT
Cbnlvcc pres12 09
Cheryl Bella
 
PPT
Building Strong Media Relationships
Cheryl Bella
 
PDF
Getting touchy - an introduction to touch and pointer events (complete master...
Patrick Lauke
 
PPT
Using Social Media to Expand Your Network
Cheryl Bella
 
HTML5 and friends - standards>next Manchester 24.11.2010
Patrick Lauke
 
Handys und Tablets - Webentwicklung jenseits des Desktops - WebTech Mainz 12....
Patrick Lauke
 
Cbnlvcc pres12 09
Cheryl Bella
 
Building Strong Media Relationships
Cheryl Bella
 
Getting touchy - an introduction to touch and pointer events (complete master...
Patrick Lauke
 
Using Social Media to Expand Your Network
Cheryl Bella
 
Ad

Similar to HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012 (20)

PDF
HTML5 multimedia - where we are, where we're going
brucelawson
 
KEY
HTML5 Video Player - HTML5 Dev Conf 2012
steveheffernan
 
PDF
Html5video
benwilkins
 
PDF
Multimedia on the web - HTML5 video and audio
Christian Heilmann
 
KEY
HTML5 Video Presentation
sith33
 
PPTX
HTML5 Multimedia Streaming
EDINA, University of Edinburgh
 
PDF
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Máté Nádasdi
 
PPTX
HTML5 Multimedia Streaming
Niall Munro
 
PDF
HTML5 Audio & Video
Aaron Gustafson
 
KEY
HTML5 Update
Paladin Web Services
 
PDF
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Patrick Lauke
 
PDF
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
Patrick Lauke
 
KEY
HTML5 Video for WordPress
steveheffernan
 
PDF
Brave new world of HTML5 - WebTech 2010 Milano 09.11.2010
Patrick Lauke
 
PDF
HTML5 and Accessibility sitting in a tree
brucelawson
 
PDF
Beginning html5 media, 2nd edition
ser
 
PDF
HTML5 and friends - JISC CETIS Conference 2010 Nottingham 15.11.2010
Patrick Lauke
 
PDF
Brave new world of HTML5
Chris Mills
 
PDF
webinale2011_Chris Mills_Brave new world of HTML5Html5
smueller_sandsmedia
 
PDF
Perfecting video playback on the web
Janessa Det
 
HTML5 multimedia - where we are, where we're going
brucelawson
 
HTML5 Video Player - HTML5 Dev Conf 2012
steveheffernan
 
Html5video
benwilkins
 
Multimedia on the web - HTML5 video and audio
Christian Heilmann
 
HTML5 Video Presentation
sith33
 
HTML5 Multimedia Streaming
EDINA, University of Edinburgh
 
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Máté Nádasdi
 
HTML5 Multimedia Streaming
Niall Munro
 
HTML5 Audio & Video
Aaron Gustafson
 
HTML5 Update
Paladin Web Services
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Patrick Lauke
 
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
Patrick Lauke
 
HTML5 Video for WordPress
steveheffernan
 
Brave new world of HTML5 - WebTech 2010 Milano 09.11.2010
Patrick Lauke
 
HTML5 and Accessibility sitting in a tree
brucelawson
 
Beginning html5 media, 2nd edition
ser
 
HTML5 and friends - JISC CETIS Conference 2010 Nottingham 15.11.2010
Patrick Lauke
 
Brave new world of HTML5
Chris Mills
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
smueller_sandsmedia
 
Perfecting video playback on the web
Janessa Det
 
Ad

More from Patrick Lauke (20)

PDF
These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...
Patrick Lauke
 
PDF
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Patrick Lauke
 
PDF
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
Patrick Lauke
 
PDF
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
Patrick Lauke
 
PDF
Too much accessibility - good intentions, badly implemented / Public Sector F...
Patrick Lauke
 
PDF
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
PDF
Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...
Patrick Lauke
 
PDF
Managing and educating content editors - experiences and ideas from the trenc...
Patrick Lauke
 
PDF
Implementing Web Standards across the institution: trials and tribulations of...
Patrick Lauke
 
PDF
Geolinking content - experiments in connecting virtual and physical places / ...
Patrick Lauke
 
PDF
All change for WCAG 2.0 - what you need to know about the new accessibility g...
Patrick Lauke
 
PDF
Web Accessibility - an introduction / Salford Business School briefing / Univ...
Patrick Lauke
 
PDF
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Patrick Lauke
 
PDF
Web standards pragmatism - from validation to the real world / Web Developers...
Patrick Lauke
 
PDF
Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...
Patrick Lauke
 
PDF
The state of the web - www.salford.ac.uk / 2007
Patrick Lauke
 
PDF
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Patrick Lauke
 
PDF
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
Patrick Lauke
 
PDF
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
Patrick Lauke
 
PDF
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
Patrick Lauke
 
These (still) aren't the SCs you're looking for ... (mis)adventures in WCAG 2...
Patrick Lauke
 
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Patrick Lauke
 
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
Patrick Lauke
 
These aren't the SCs you're looking for ... (mis)adventures in WCAG 2.x inter...
Patrick Lauke
 
Too much accessibility - good intentions, badly implemented / Public Sector F...
Patrick Lauke
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
Evaluating web sites for accessibility with Firefox / Manchester Digital Acce...
Patrick Lauke
 
Managing and educating content editors - experiences and ideas from the trenc...
Patrick Lauke
 
Implementing Web Standards across the institution: trials and tribulations of...
Patrick Lauke
 
Geolinking content - experiments in connecting virtual and physical places / ...
Patrick Lauke
 
All change for WCAG 2.0 - what you need to know about the new accessibility g...
Patrick Lauke
 
Web Accessibility - an introduction / Salford Business School briefing / Univ...
Patrick Lauke
 
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
Patrick Lauke
 
Web standards pragmatism - from validation to the real world / Web Developers...
Patrick Lauke
 
Ian Lloyd/Patrick H. Lauke: Accessified - practical accessibility fixes any w...
Patrick Lauke
 
The state of the web - www.salford.ac.uk / 2007
Patrick Lauke
 
Keyboard accessibility - just because I don't use a mouse doesn't mean I'm se...
Patrick Lauke
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
Patrick Lauke
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
Patrick Lauke
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
Patrick Lauke
 

Recently uploaded (20)

PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
July Patch Tuesday
Ivanti
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Biography of Daniel Podor.pdf
Daniel Podor
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

HTML5 multimedia - browser-native video and audio - DevUp HTML5 / Barcelona / 27.04.2012