Video on the web

There was a lot of debate about codecs and the HTML video tag not so long ago. There were many people upset with h264 since distributors (such as browser vendors) will have to pay royalties, because the codec’s software algorithms are patented by the MPEGLA. This is of course a problem for smaller web browsers vendors; many people were angry at the MPEGLA and browser vendors that defaulted to using this codec (these being Apple and Microsoft).

Flash

It is also become “cool” to be a Flash hater. Though while I abhor websites which are completely Flash; Flash is great for things such as videos, audio players and games. Flash also works absolutely fine with the most popular platforms with the exception of iOS.

It is also much, much faster for complex animations on older browsers than JavaScript, these people are likely to be running older machines and I seen some JavaScript animations cause the processor usage to spike.

Yes it is owned by Adobe, but it is a solution that works and is freely available for overwhelming majority of platforms.

Possible Scenarios

There are 4 possible scenarios when dealing with support for the video tag.

  • There is no browser support (<IE 9, Safari Windows without QuickTime installed).
  • Theora Video Codec Support (>Firefox  3.5, Chrome, Opera )
  • Mp4/h264 support (Safari MacOSX, Safari Windows with QuickTime installed, iOS devices)
  • WebM (IE with WebM installed, Firefox > 4.0, Chrome, Opera)

To cover all scenarios you need to encode to 3 file formats and Flash video. So you are going to be using possibly 4 times as much storage space as you need to. Hard disk space on hosted environments is quite expensive compared to a home computer and popping in a Terabyte of extra storage isn’t cheap. So what is one to do?

Take the ideological approach

The h264 codec is patented and of course this caused quite a bit of a stir. Google then released WebM and every new major browser supports it except IE9 which support h264. Most people who use alternatives to IE and Safari, keep their browser up to date, they are likely to have WebM support. Now YouTube are supporting WebM, I suspect that many will forget about Theora entirely.

You could support say WebM as this is the open source codec and not support IE at all. I don’t support this approach, it is sending a message to your visitors that you care more about their browser choice than their experience on your site.

This is okay if it is going to be a you and your circle of friends using the site or if you are trying to make some sort of Idealogical point.

Just use Flash

The overwhelming majority of people browsing the web have the Flash Plugin installed. You could just op to use a Flash video player on your site. However you will be alienating iOS users and people that don’t have the plugin installed. If you have a low number of users that can’t or don’t have the plugin installed, this is a good option.

Take the third party approach

You could host your video on either YouTubeVimeo or another third party video hosting and use an embedding script. This is a good option for a personal website or smaller commercial websites.

However this may not be an option if you are a larger website because with the terms of service you essentially give up some of your rights over this content, to some organisation this may not be an option.

e.g.From section 6C on YouTube’s Terms of Service:

For clarity, you retain all of your ownership rights in your Content. However, by submitting Content to YouTube, you hereby grant YouTube a worldwide, non-exclusive, royalty-free, sublicenseable and transferable license to use, reproduce, distribute, prepare derivative works of, display, and perform the Content in connection with the Service and YouTube’s (and its successors’ and affiliates’) business, including without limitation for promoting and redistributing part or all of the Service (and derivative works thereof) in any media formats and through any media channels. You also hereby grant each user of the Service a non-exclusive license to access your Content through the Service, and to use, reproduce, distribute, display and perform such Content as permitted through the functionality of the Service and under these Terms of Service. The above licenses granted by you in video Content you submit to the Service terminate within a commercially reasonable time after you remove or delete your videos from the Service. You understand and agree, however, that YouTube may retain, but not display, distribute, or perform, server copies of your videos that have been removed or deleted. The above licenses granted by you in user comments you submit are perpetual and irrevocable.

Quite a mouthful; however YouTube are basically saying, once you submit Content to us, it is as much YouTube’s as it yours as long as we are using it on Youtube. Oh and btw any YouTube user can view the content and we can keep the content forever on our servers. This also includes things such as comments as well as the video itself.

It’s ultimately up to you or your organisation whether you are prepared to give up some rights to your content in exchange for possibly extra exposure and YouTube doing all the hard work.

Also be prepared that the embedding is most likely to be a Flash Video.

Look at your user statistics

When I was working in my previous job, most of our users were using IE7 or 8, and Firefox on Windows. There were  small number of Chrome users and Safari users, users of alternative operating systems such as Linux distributions were almost non-existant and almost all our mobile traffic was from iPhones.

The browsers that 99% of our visitors used support Flash except for iOS devices. This I expect is a common case, however it is best to check you user statistics. The decision at my previous place of work was quite simple, serve h264 and Flash video because it saves on storage.

The ideal

The ideal scenario is that you have lots of server storage and you can afford to encode many times. However I wouldn’t bother with encoding to the Theora codec, for the reasons mentioned above.

Server vs Client side detection

For the vast majority of cases, client side detection is going to be fine. You can quite easily roll your own, however JavaScript Libraries such as Modernizr are excellent and do all of the hardwork for you.

You can use device feature detection libraries such as WURFL, which have a database of device capabilities and finds these based on the browser’s user agent. However for detecting video this is overkill and honestly if the phone isn’t good enough for some basic JavaScript then it probably can’t play video anyway. Tools such as WURFL are best used as part of a progressive enhancement strategy.

Conclusion

I think that Flash video will be around for quite a while yet and I think it is a good solution that works most of the time.  Think about your users and choose wisely on how you serve video to your viewers. Any decent web statistics package will be able to break down who your users are and what they are doing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>