Book Image

Responsive Media in HTML5

By : Alex Libby
Book Image

Responsive Media in HTML5

By: Alex Libby

Overview of this book

Table of Contents (12 chapters)
Responsive Media in HTML5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Catering to fallback support


So far, we've produced HTML5-formatted video content and seen how to embed it in our pages. There may be occasions, though, when we are working on a device that doesn't support a certain type of video format.

While support for HTML5 video is improving all the time, we're still at a stage where not every platform supports the same formats. This leaves us with two choices. We can either try to incorporate a different format, or we can simply set the content to degrade gracefully. We've looked at providing different formats, so let's switch track and see how we can gracefully degrade our content using Modernizr as the basis for our test. The following steps will guide us through the process of content degrading:

  1. Let's begin by adding the following code to a new file and save it as modernizr.html:

    <!DOCTYPE html>
    <html class="no-js">
    <head>
      <meta charset="utf-8"/>
      <title> Demo: Detecting support with Modernizr</title>
      <meta...