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

Testing browsers for data storage support


Knowing how to test quickly whether a browser supports a data storage method you want to use will make developing pages and applications easier. In this recipe, we will create a script that queries a browser's DOM to test for support of different data storage methods.

Getting ready

You will need access to a modern browser such as Firefox 3.6, or the latest versions of a popular browser such as Google Chrome, Opera, Safari, or Internet Explorer.

How to do it...

First, we are going to create a simple html page. Open an HTML editing program or a text editor, and enter the starting code for a basic HTML5 page:

<!doctype html><html lang="en"><head><title>Client-side Storage Test for HTML5</title>
<meta charset="utf-8">

The look of the test page now needs to be styled. We will use <style> tags within the <head> tags HTML page, but you could also place them in a separate CSS file.

<style>
#results { background...