SlideShare ist ein Scribd-Unternehmen logo
1 von 21
HTML5 Multimedia Canvas, Audio, Video and more..
Agenda Canvas Audio Video SVG WebGL
whoami /r Parashuram Work for a company that makes browsers Web Enthusiast – spends time writing code Worked on IndexedDB standards and demos http://nparashuram.com http://blog.nparashuram.com @nparashuram
Canvas
Pixel based drawing surface 2d context The drawing API Lines and Curves Fille and Gradients Image data, security context GPU accelerated, possible trace-JITed JS code Works well with Videos, WebWorkers Canvas
Canvas - Code <canvas id = “myCanvas” width = “100px” height =  “100px” style = “width:200px;height:200px”> Canvasnot supported </canvas> <script> varelem= document.getElementById('myCanvas'); </script>
Canvas - Code varcontext = elem.getContext('2d'); context.fillRect(0, 0, 150, 100); context.moveTo(10, 10);  context.lineTo(100, 10);  context.stroke(); context.closePath(); context.drawImage(img_elem, dx, dy, dw, dh);
Canvas - Code context.font = 'italic 30px sans-serif';  context.strokeText('Hello world!', 0, 50); context.fillText ('Hello world!', 0, 0); context.shadowColor = 'rgba(255, 0, 0, 0.5)'; context.shadowBlur = 4; context.shadowColor = 'rgba(255, 0, 0, 0.5)'; context.fillRect(20, 20, 150, 100); var g= context.createLinearGradient(sx, sy, dx, dy); context.fillStyle = g;
Canvas - Demos http://canvaspaint.org/ http://nparashuram.com/seamcarving/index.html http://www.canvasdemos.com/type/games/ http://www.benjoffe.com/code/demos/canvascape/ http://caniuse.com/#search=canvas
Video Native support to play video in browser Codecs (What data is stored) H.264 Theora VP8 Containers (How data is stored) MPEG4 Flash Ogg WebM Should be Served with correct MIME-TYPE Fallback mechanism
Video - Code <video  poster="star.png" autoplay loop preload controls > <sourcesrc="movie.webm"  	type='video/webm; codecs="vp8, vorbis"' /> 	<sourcesrc="movie.mp4"  	type='video/mp4;codecs="avc1.42E01E,mp4a.40.2"'/> Video tag not supported. Use Flash Tags here or Download <a href="movie.webm">here</a>. <video>
Video - Code video.play(); video.pause() video.playbackRate = 0.8; video.addTrack(kind, label, language)  onPlay, canplaythrough, progress, stalled, loadeddata, loadedmetadata, waiting,
Video - Demos http://html5demos.com/video http://html5demos.com/two-videos http://sublimevideo.net/demo http://caniuse.com/video
Audio Native support for sound Controls, API similar to Video Play audio files, control playback Audio Data API – work in progress
Audio - Code <audiocontrols preload="auto" autobuffer>  	<sourcesrc="elvis.mp3" /> 	<sourcesrc="elvis.ogg" />  <!-- now include flash fall back --> </audio>
Audio - Demos http://www.jplayer.org/latest/demo-01/# http://tinyurl.com/4v8yu42 http://apm.ircam.fr/page/audio-tag/
SVG XML Based Scalable Vector Graphics Embed inline in HTML Scalable Images  Elements scriptable on DOM SVG in CSS as background images SVG Filters for Video
SVG - Code <svgxmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width='300px' height='300px'> 	<title> Small SVG example </title> <circle cx='120' cy='150' r='60' style='fill: gold;'> 		<animateattributeName='r' from='2' to='80' 			begin='0' dur='3' repeatCount='indefinite' /> </circle> 	<polyline points='120 30, 25 150, 290 150'  	stroke-width='4’  	stroke='brown' style='fill: none;' /> <text x='60' y='250' fill='blue'> Hello, World! </text> </svg>
SVG - Demo http://svg-edit.googlecode.com/svn/branches/2.4/editor/svg-editor.html http://slides.html5rocks.com/#inline-svg http://caniuse.com/svg-html5
WebGL 3D Graphics API Based on OpenGL ES 2.0 On Canvas element Learning WebGL Demos http://www.ambiera.com/coppercube/webgldemos.html http://www.khronos.org/webgl/wiki/Demo_Repository
Demos http://www.craftymind.com/factory/html5video/CanvasVideo.html https://developer.mozilla.org/samples/video/chroma-key/index.xhtml http://people.mozilla.com/~prouget/demos/DynamicContentInjection/play.xhtml http://media.chikuyonok.ru/ambilight/ http://9elements.com/io/projects/html5/canvas/ http://www.canvasdemos.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Flash Security, OWASP Chennai
Flash Security, OWASP ChennaiFlash Security, OWASP Chennai
Flash Security, OWASP Chennai
lavakumark
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
StarTech Conference
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
Andrelma
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
emedomimgues
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
Edna17
 

Was ist angesagt? (20)

HTML+CSS Resources
HTML+CSS ResourcesHTML+CSS Resources
HTML+CSS Resources
 
From jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 MinutesFrom jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 Minutes
 
Jager
JagerJager
Jager
 
youtube
youtubeyoutube
youtube
 
Embedded UA 101 - STC Summit 2013, Scott DeLoach, ClickStart
Embedded UA 101 - STC Summit 2013, Scott DeLoach, ClickStartEmbedded UA 101 - STC Summit 2013, Scott DeLoach, ClickStart
Embedded UA 101 - STC Summit 2013, Scott DeLoach, ClickStart
 
Slideshare
SlideshareSlideshare
Slideshare
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser rendering
 
Flash Security, OWASP Chennai
Flash Security, OWASP ChennaiFlash Security, OWASP Chennai
Flash Security, OWASP Chennai
 
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
 
Code dintegration videowall
Code dintegration videowallCode dintegration videowall
Code dintegration videowall
 
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
 
Embed for bit gravilty 6.txt
Embed for bit gravilty 6.txtEmbed for bit gravilty 6.txt
Embed for bit gravilty 6.txt
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
 
Blogs como gerenciar
Blogs como gerenciarBlogs como gerenciar
Blogs como gerenciar
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
 
Android Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery ApplicationAndroid Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery Application
 
Video
VideoVideo
Video
 

Ähnlich wie DoctypeHTML5 (Hyderabad) Presentation on Multimedia

ARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: PublishingARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: Publishing
Gilbert Guerrero
 
Ie9 dev overview (300) beta
Ie9 dev overview (300) betaIe9 dev overview (300) beta
Ie9 dev overview (300) beta
Kirk Yamamoto
 
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
 

Ähnlich wie DoctypeHTML5 (Hyderabad) Presentation on Multimedia (20)

ARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: PublishingARTDM 170, Week 16: Publishing
ARTDM 170, Week 16: Publishing
 
Filling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and ShimsFilling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and Shims
 
Be HTML5-ready today
Be HTML5-ready todayBe HTML5-ready today
Be HTML5-ready today
 
HTML5
HTML5HTML5
HTML5
 
Web Apps
Web AppsWeb Apps
Web Apps
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Ie9 dev overview (300) beta
Ie9 dev overview (300) betaIe9 dev overview (300) beta
Ie9 dev overview (300) beta
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
 
Mobile Web Video
Mobile Web VideoMobile Web Video
Mobile Web Video
 
Html5 - Novas Tags na Prática!
Html5 - Novas Tags na Prática!Html5 - Novas Tags na Prática!
Html5 - Novas Tags na Prática!
 
Lca2009 Video A11y
Lca2009 Video A11yLca2009 Video A11y
Lca2009 Video A11y
 
HTML5 Multimedia
HTML5 MultimediaHTML5 Multimedia
HTML5 Multimedia
 
HTML5 e Css3 - 8 | WebMaster & WebDesigner
HTML5 e Css3 - 8 | WebMaster & WebDesignerHTML5 e Css3 - 8 | WebMaster & WebDesigner
HTML5 e Css3 - 8 | WebMaster & WebDesigner
 
GWT
GWTGWT
GWT
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
Basics of html5, data_storage, css3
Basics of html5, data_storage, css3Basics of html5, data_storage, css3
Basics of html5, data_storage, css3
 
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 / ...
 
EPiServer Web Parts
EPiServer Web PartsEPiServer Web Parts
EPiServer Web Parts
 
Responsive Videos, mehr oder weniger
Responsive Videos, mehr oder wenigerResponsive Videos, mehr oder weniger
Responsive Videos, mehr oder weniger
 
HTML5 Video Player - HTML5 Dev Conf 2012
HTML5 Video Player - HTML5 Dev Conf 2012HTML5 Video Player - HTML5 Dev Conf 2012
HTML5 Video Player - HTML5 Dev Conf 2012
 

Mehr von Parashuram N (8)

React Native - Fabric review-2018-07-25
React Native - Fabric review-2018-07-25React Native - Fabric review-2018-07-25
React Native - Fabric review-2018-07-25
 
Chain React 2018 - The state of React Native
Chain React 2018 - The state of React NativeChain React 2018 - The state of React Native
Chain React 2018 - The state of React Native
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Client storage
Client storageClient storage
Client storage
 
Understanding Javascript Engines
Understanding Javascript Engines Understanding Javascript Engines
Understanding Javascript Engines
 
Indexed DB
Indexed DBIndexed DB
Indexed DB
 
Indexed db - the store in the browser
Indexed db - the store in the browserIndexed db - the store in the browser
Indexed db - the store in the browser
 
Snapp
SnappSnapp
Snapp
 

Kürzlich hochgeladen

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

DoctypeHTML5 (Hyderabad) Presentation on Multimedia

  • 1. HTML5 Multimedia Canvas, Audio, Video and more..
  • 2. Agenda Canvas Audio Video SVG WebGL
  • 3. whoami /r Parashuram Work for a company that makes browsers Web Enthusiast – spends time writing code Worked on IndexedDB standards and demos http://nparashuram.com http://blog.nparashuram.com @nparashuram
  • 5. Pixel based drawing surface 2d context The drawing API Lines and Curves Fille and Gradients Image data, security context GPU accelerated, possible trace-JITed JS code Works well with Videos, WebWorkers Canvas
  • 6. Canvas - Code <canvas id = “myCanvas” width = “100px” height = “100px” style = “width:200px;height:200px”> Canvasnot supported </canvas> <script> varelem= document.getElementById('myCanvas'); </script>
  • 7. Canvas - Code varcontext = elem.getContext('2d'); context.fillRect(0, 0, 150, 100); context.moveTo(10, 10); context.lineTo(100, 10); context.stroke(); context.closePath(); context.drawImage(img_elem, dx, dy, dw, dh);
  • 8. Canvas - Code context.font = 'italic 30px sans-serif'; context.strokeText('Hello world!', 0, 50); context.fillText ('Hello world!', 0, 0); context.shadowColor = 'rgba(255, 0, 0, 0.5)'; context.shadowBlur = 4; context.shadowColor = 'rgba(255, 0, 0, 0.5)'; context.fillRect(20, 20, 150, 100); var g= context.createLinearGradient(sx, sy, dx, dy); context.fillStyle = g;
  • 9. Canvas - Demos http://canvaspaint.org/ http://nparashuram.com/seamcarving/index.html http://www.canvasdemos.com/type/games/ http://www.benjoffe.com/code/demos/canvascape/ http://caniuse.com/#search=canvas
  • 10. Video Native support to play video in browser Codecs (What data is stored) H.264 Theora VP8 Containers (How data is stored) MPEG4 Flash Ogg WebM Should be Served with correct MIME-TYPE Fallback mechanism
  • 11. Video - Code <video poster="star.png" autoplay loop preload controls > <sourcesrc="movie.webm" type='video/webm; codecs="vp8, vorbis"' /> <sourcesrc="movie.mp4" type='video/mp4;codecs="avc1.42E01E,mp4a.40.2"'/> Video tag not supported. Use Flash Tags here or Download <a href="movie.webm">here</a>. <video>
  • 12. Video - Code video.play(); video.pause() video.playbackRate = 0.8; video.addTrack(kind, label, language) onPlay, canplaythrough, progress, stalled, loadeddata, loadedmetadata, waiting,
  • 13. Video - Demos http://html5demos.com/video http://html5demos.com/two-videos http://sublimevideo.net/demo http://caniuse.com/video
  • 14. Audio Native support for sound Controls, API similar to Video Play audio files, control playback Audio Data API – work in progress
  • 15. Audio - Code <audiocontrols preload="auto" autobuffer>   <sourcesrc="elvis.mp3" /> <sourcesrc="elvis.ogg" />  <!-- now include flash fall back --> </audio>
  • 16. Audio - Demos http://www.jplayer.org/latest/demo-01/# http://tinyurl.com/4v8yu42 http://apm.ircam.fr/page/audio-tag/
  • 17. SVG XML Based Scalable Vector Graphics Embed inline in HTML Scalable Images Elements scriptable on DOM SVG in CSS as background images SVG Filters for Video
  • 18. SVG - Code <svgxmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width='300px' height='300px'> <title> Small SVG example </title> <circle cx='120' cy='150' r='60' style='fill: gold;'> <animateattributeName='r' from='2' to='80' begin='0' dur='3' repeatCount='indefinite' /> </circle> <polyline points='120 30, 25 150, 290 150' stroke-width='4’ stroke='brown' style='fill: none;' /> <text x='60' y='250' fill='blue'> Hello, World! </text> </svg>
  • 19. SVG - Demo http://svg-edit.googlecode.com/svn/branches/2.4/editor/svg-editor.html http://slides.html5rocks.com/#inline-svg http://caniuse.com/svg-html5
  • 20. WebGL 3D Graphics API Based on OpenGL ES 2.0 On Canvas element Learning WebGL Demos http://www.ambiera.com/coppercube/webgldemos.html http://www.khronos.org/webgl/wiki/Demo_Repository
  • 21. Demos http://www.craftymind.com/factory/html5video/CanvasVideo.html https://developer.mozilla.org/samples/video/chroma-key/index.xhtml http://people.mozilla.com/~prouget/demos/DynamicContentInjection/play.xhtml http://media.chikuyonok.ru/ambilight/ http://9elements.com/io/projects/html5/canvas/ http://www.canvasdemos.com/