HTML5 and CSS3, Second Edition

(singke) #1
To ensure that web servers know how to handle our video files, we need to
add the proper MIME types to our server. This varies by platform, but if we
were using Apache, we’d create a new .htaccess file in the same folder as our
new web page that defines the MIME types for the videos, like this:

html5_video/.htaccess
AddTypevideo/ogg .ogv
AddTypevideo/mp4 .mp4
AddTypevideo/webm.webm

If you’re serving videos from Amazon S3, you can set the content-type header
for each video. And if you’re using Microsoft’s Internet Information Server,
you just use its interface to edit the MIME types for your site.

Once we upload these files to our web server and configure the MIME types,
our videos will play in a wide variety of browsers, and our users will see a
video player similar to the one shown in the following figure.

We still can’t reach users of Internet Explorer 8 and older. We’ll need to use
Flash to make that work.

Figure 22—Our video displayed using Chrome’s native HTML5 video player


Chapter 7. Embedding Audio and Video • 142


Download from Wow! eBook <www.wowebook.com> report erratum • discuss

Free download pdf