Honestly, I (still) have yet to do a lot with HTML5. But, I did implement its video player a few weeks ago because I wanted the video to be available on the iPad. It was much easier than I thought it would be, but I thought I’d share because converting my file to the proper format did take some googling, which I’d like to spare you.

THE VIDEO TAG

Controls says that you want to use the browser’s built in controls.—If you really wanted to, you could design your own video player and hook up all the controls yourself.

The width and height parameters do exactly what they suggest. It controls the width and height of your video.

The src parameter is the source of your video. In this case, we’re calling a video called “my_greatness” that’s mp4 encoded.

The poster parameter is a still image (jpg of gif) that shows before the user clicks play.

And just in case you were wondering, here’s a list of items that support the video element:

IE 9.0+

Firefox 3.5+

Safari 3.0+

Chrome 3.0+

Opera 5.0+

iPhone 1.0+

Android 2.0+

FILE FORMATS = THE FRUSTRATING PART

The frustrating thing about HTML5 video is that different browsers support different formats. Yeah patents and such!

MPEG 4 (.mp4 or .m4v) is based on Apple’s QuickTime. So, no surprise here, Safari likes.

Theora (.ogv) is open source, which Firefox likes.

I think Chrome plays nicely with everyone.

MPEG 4 wasn’t hard to convert to. A while back, I purchased a license for Xilisoft Video Converter. —It’s a cheap, simple program that I was able to recommend to a client that needed to convert a lot of videos to .swfs. It allowed them to create overlays and perform a few other minor editing commands without purchasing Flash. You can convert videos to just about any format you want…except Theora.

What’s a developer to do? This is the Googling part I mentioned earlier.

Theora.org has a download listed on their site: ffmpeg2theora. Once you download it to your computer, double click to install. Then, open up Terminal. I know. Scary. But, I promise, it’s easier than you think! I typically avoid the terminal because I know a mistyped character could wreck havock on my computer, but really…it’s not that bad!

Then, type ffmpeg2theora [space]

Find the file in Finder that you want to convert. I used an .mov, but it should support some other options. Click and drag the file from Finder to the terminal window. It will auto-magically generate the path for you.

Then, type [space] -o [space] new file path and name

You should be looking at something like this:

Then, once you hit enter, you’ll see the Terminal start processing the file for you:

As soon as it’s done, the new file will appear with the name in the place you specified. In my case, the desktop. See that wasn’t that hard!

FILE FORMATS = THE COOL PART

The cool thing about HTML5 video is that it degrades nicely. So, if I’m in Safari, it will play my .mp4 file. If I’m in Firefox, it will play my .ogv file. If my browser likes neither of those options, I can even get it to play a .swf.