Book Image

HTML5 Multimedia Development Cookbook

Book Image

HTML5 Multimedia Development Cookbook

Overview of this book

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 (16 chapters)
HTML5 Multimedia Development Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Crossbrowser video support with vid.ly and jQuery


Supporting most browsers requires encoding a video into multiple formats, then serving up the right one to a browser. In this recipe we will use an online video display library named vid.ly (http://www.vid.ly) to prepare and share a video on a page reliably across multiple browsers and make the background color change over time.

Getting ready

You will need a video to upload to http://www.vid.ly. Some browsers do not allow files to be served locally, so you may also want a location where you can upload your files and test pages.

How to do it...

Type <!DOCTYPE html> <html lang="en"> <head>, then begin adding style declarations by typing <style type="text/css"> h2{color:#303;}.

Style a div to contain featured content: #featured {position:relative; padding: 40px; width: 480px; background-color:#000000; outline: #333 solid 10px; }.

Type video {padding: 3px;background-color:black;} to create the style for the video tag, then...