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

Displaying video dynamically using jQuery


The video element gives us the power to treat videos like images and manipulate them in fun and exciting ways.

Getting ready

You will need a video available in multiple file formats (which are provided in the chapter code for this book). A server to which to upload your files is recommended, as not all browsers play files locally in a predictable way.

How to do it...

First, we have to prepare an HTML5 page in which to place it. Type the opening tags for our page: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Video Explosion</title>.

Open up the stylesheet.css file from the downloaded code files or create a new file with the same name.

Type the following for the body style: body {background: white;color:#333333; }, then style a div tag as shown: div {float:left; border:1px solid #444444;padding:5px;margin:5px; background:#999999;}.

The first unique div we need to create and style is #featured...