You are previewing HTML5 Multimedia Development Cookbook.
O'Reilly logo
HTML5 Multimedia Development Cookbook

Book Description

Recipes for practical, real-world HTML5 multimedia driven development.

  • Use HTML5 to enhance JavaScript functionality. Display videos dynamically and create movable ads using JQuery.

  • Set up the canvas environment, process shapes dynamically and create interactive visualizations.

  • Enhance accessibility by testing browser support, providing alternative site views and displaying alternate content for non supported browsers.

In Detail

HTML5 is the most significant new advancement the web has seen in many years. HTML5 adds many new features including the video, audio, and canvas elements, as well as the integration of SVG. This cookbook is packed full of recipes that will help you harness HTML5’s next generation multimedia features. HTML5 is the future.

Whether you’re a seasoned pro or a total newbie, this book gives you the recipes that will serve as your practical guide to creating semantically rich websites and apps using HTML5. Get ready to perform a quantum leap harnessing HTML5 to create powerful, real world applications.

Many of the new key features of HTML5 are covered, with self-contained practical recipes for each topic. Forget hello world. These are practical recipes you can utilize straight away to create immersive, interactive multimedia applications. Create a stylish promo page in HTML5. Use SVG to replace text dynamically. Use CSS3 to control background size and appearance. Use the Canvas to process images dynamically. Apply custom playback controls to your video.

Table of Contents

  1. HTML5 Multimedia Development Cookbook
    1. HTML5 Multimedia Development Cookbook
    2. Credits
    3. Foreword
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Structuring for Rich Media Applications
      1. Introduction
      2. Setting up an HTML5 test area
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. WebKit rendering engine
          2. Gecko rendering engine
          3. Trident rendering engine
        5. See also
      3. Using the header tag for logos and site titles
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Use <header> elsewhere
          2. Content, not position
          3. Semantic naming
        5. See also
      4. Creating a table of contents using the nav tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Use <nav> elsewhere
          2. More semantic = more gooder
          3. Still evolving
        5. See also
      5. Using section tags to structure areas of a page
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Section doesn't equal div
          2. Section guidelines
          3. Still evolving
        5. See also
      6. Aligning graphics using the aside tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Not all <section>s are alike
          2. Tip to remember
          3. Aside from <aside>
        5. See also
      7. Displaying multiple sidebars using the aside tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Pull quotes good for <aside>
          2. Remember to validate
        5. See also
      8. Implementing the footer tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. This happens usually
          2. Flexible footer content
          3. More flexible footer content
        5. See also
      9. Applying the outline algorithm
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Are you sure?
          2. An exception
          3. Remember accessibility
        5. See also
      10. Creating a stylish promo page in HTML5
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Try sans shiv
          2. Mobile first
          3. IE evil?
        5. See also
    9. 2. Supporting the Content
      1. Introduction
      2. Structuring a blog article
        1. Getting ready
        2. How to do it...
          1. Put your code on a diet?
        3. How it works...
        4. There's more...
          1. Validation as an aid, not a crutch
          2. Eric Meyer's funny
          3. Where to find validators
        5. See also
      3. Highlighting text using the mark element
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. <Mark> long and prosper
          2. Waiting for browsers
          3. Is "future proof" a word?
        5. See also
      4. Using the time element
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Odd rules
          2. <time>'s Time will come
          3. Always remember SEO
        5. See also
      5. Specifying the pubdate of an article
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Still waiting on browsers
          2. Extra credit
          3. Let's end confusion
        5. See also
      6. Displaying comment blocks using the article element
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Blog comments
          2. Value comments
          3. Opportunity's yours
        5. See also
      7. Adding fonts dynamically with @font-face
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Don't steal
          2. Firefox note
          3. Paul Irish rocks
        5. See also
      8. Adding drop-shadow effects to fonts
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Browser support
          2. With great power…
          3. A plea to all readers
        5. See also
      9. Applying gradient effects to fonts
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      10. Annotating visual elements using the figure and figcaption tags
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Grouping's good
          2. Semantics are valuable too
          3. <figure> vs <aside>
        5. See also
    10. 3. Styling with CSS
      1. Introduction
      2. Setting elements to display:block
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. No need to repeat and repeat and repeat and repeat and repeat
          2. Style once
          3. Echoes of the past
        5. See also
      3. Styling a nav block element
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Browser support
          2. Text-shadow is cool
        5. See also
      4. Using background-size to control background appearance
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Browser support
          2. Acceptable in IE
          3. Simple Scott simply rocks
        5. See also
      5. Adding rounded corners with border-radius
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Browser support
          2. Acceptable in IE
          3. Devin's Heaven goes to 11
        5. See also
      6. Including multiple background images
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Where's the content?
          2. Let's be Frank
        5. See also
      7. Adding a box shadow to images
        1. Getting ready
        2. How to do it...
        3. How it works...
          1. Browser support
          2. Ignorance is bliss
          3. Box-shadow for The Box
        4. See also
      8. Styling for Internet Explorer browsers
        1. Getting ready
        2. Border-radius
        3. Box-shadow
        4. Text-shadow
        5. Note
        6. See also
    11. 4. Creating Accessible Experiences
      1. Introduction
      2. Testing browser support
        1. How to do it...
        2. How it works...
        3. There's more...
          1. With an eye to the future
          2. What Modernizr really does
          3. Do it for the right reasons
        4. See also
      3. Adding skip navigation
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Full browser support
          2. Less equals more
        5. See also
      4. Adding meta tags
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Whatchu talkin' 'bout?
          2. It all comes back to SEO
          3. Did I do that?
        5. See also
      5. Using semantic descriptions in tags for screen readers
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Always improve
          2. Semantics for good SEO
          3. Greg finally learned
        5. See also
      6. Providing alternate site views
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Min-width
          2. My math teacher was right
          3. Is bigger always better?
        5. See also
      7. Using hgroup to create accessible header areas
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      8. Displaying alternate content for non-supported browsers
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      9. Using WAI-ARIA
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Still awaiting browser support
          2. That's how I role
          3. Accessibility first
        5. See also
    12. 5. Learning to Love Forms
      1. Introduction
      2. Displaying placeholder text
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Text only
          2. Embrace italics
          3. Browser support
        4. See also
      3. Adding autofocus to form fields
        1. How to do it...
        2. How it works...
        3. There's more...
          1. One per page
          2. Older browsers
          3. Browser support
        4. See also
      4. Styling forms using HTML5 and CSS3
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Older browsers
          2. Test, test, test
          3. About pseudo classes
        4. See also
      5. Using the e-mail input type
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Browser support
          2. No JavaScript
          3. Validation evolution
      6. Adding a URL using the URL input type
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Browser support
          2. No JavaScript
          3. What's next?
        4. See also
      7. Using the number tag
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Browser support
          2. No JavaScript
      8. Using the range tag
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Use caution
          2. No JavaScript
          3. Browser support
        4. See also
      9. Creating a search field
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Why fix perfection?
          2. Browser support
          3. Search results
        4. See also
      10. Creating a picker to display date and time
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Browser support
          2. If all else fails
        4. See also
    13. 6. Developing Rich Media Applications Using Canvas
      1. Introduction
      2. Setting up the canvas environment
        1. How to do it...
        2. How it works...
        3. There's more...
          1. He's smart
          2. What am I sayin'?
          3. What's next for <canvas>?
        4. See also
      3. Understanding the 2d rendering context
        1. How to do it...
        2. How it works...
        3. There's more...
          1. You can master <canvas>
          2. X, meet Y
          3. Respect my authority!
        4. See also
      4. Processing shapes dynamically
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Any way you want it
          2. Similar to tables?
          3. Be a square first
        4. See also
      5. Drawing borders for images using canvas
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Style first
          2. Many color values work
          3. I like big borders and I cannot lie
        4. See also
      6. Rounding corners
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Just like the Scholastic Aptitude Tests
          2. What about IE?
          3. We're laying a foundation
        4. See also
      7. Creating interactive visualizations
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Evil of two lessors
          2. What about fallback content?
          3. Take him up on his offer.
        4. See also
      8. Bouncing a ball
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Start again
          2. Don't box me in
          3. And that's one to grow on
        4. See also
      9. Creating fallback content
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Thanks, Mozilla
          2. How will we deal with accessibility?
          3. Are we ready for <canvas>?
    14. 7. Interactivity using JavaScript
      1. Introduction
      2. Playing audio files with JavaScript
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Controlling the appearance of audio clips with jQuery
        5. See also
      3. Using the drag-and-drop API with text
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Create a canvas-based tic-tac-toe game
          2. Show responsive messages as the user plays
        5. See also
      4. Crossbrowser video support with vid.ly and jQuery
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Displaying video dynamically using jQuery
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. More interactive explosions using video and canvas
          2. What's with all the explosions?
          3. Chroma key background replacement in real time
        5. See also
      6. Movable video ads using jQuery
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Have HTML element, will travel
        5. See also
      7. Controlling the display of images using Easel.js and the canvas tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      8. Animating a sequence of images using Easel.js and the canvas tag
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Pirates Love Daisies and so should you
          2. The return of old school computer animation techniques
        5. See also
      9. Random animation with audio using the canvas tag and JavaScript
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Visualizing your audio with cutting edge browsers
          2. Pushing the implementation of audio in HTML5
        5. See also
    15. 8. Embracing Audio and Video
      1. Introduction
      2. Saying no to Flash
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Some good news
          2. Video with style
          3. Cover your assets
        4. See also
      3. Understanding audio and video file formats
        1. How it works...
        2. There's more...
          1. Audio file formats
          2. File format agnosticism
          3. Can we stop the madness one day?
      4. Displaying video for everybody
        1. How to do it...
        2. How it works...
        3. There's more...
          1. A mime is a terrible thing to waste
          2. External "Video for Everybody"
          3. Be flexible with your approach
        4. See also
      5. Creating accessible audio and video
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Always consider accessibility
          2. Browser support
          3. See more
        4. See also
      6. Crafting a slick audio player
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Style and substance
          2. Being careful with details
        4. See also
      7. Embedding audio and video for mobile devices
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Vimeo offers much more
          2. Coming full circle
        4. See also
    16. 9. Data Storage
      1. Introduction
      2. Testing browsers for data storage support
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Mobile testing
          2. Adobe browser lab
          3. Free cross-browser and OS testing with BrowserShots
      3. Using browser developer tools to monitor web storage
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Use a Firebug addon even if you don't use Firefox
          2. Safari developer tools are native to the Safari browser
      4. Setting and getting a session storage variable
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. One browser, one session
        5. See also
      5. Setting and getting a local storage variable
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      6. Converting local storage strings to numbers using parseInt
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Storing and retrieving arrays in localStorage
      7. Creating a Web SQL Database
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Web SQL may be replaced by SQLite
      8. Using a Web SQL database
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Save script code in a separate file
          2. Guard against SQL injection on production servers
        5. See also
      9. Creating a cache manifest for offline storage
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Displaying the current location using geolocation and geo.js
        1. Getting ready
        2. How to do it...
        3. How it works...