Monday, 30 May 2011

HTML5 Video embedding

Managed to successfully embed a video into my site with the html5 video tag. The code itself is very simple, just using a video tag, and adding in the link to the video. However, there are a number of issues with web browsers not agreeing upon one standardised video format, so in order to make the video play in most of the browsers available (those with html5 support), you currently have to change the file format of the video by using a converting software (Miro is a decent, free, open-sourced software that does the job beautifully), and converting the video to different formats (generally, theora ogg for Firefox, and mp4 for Safari). Then you link both videos as a source within the tag and the browser will choose the one it can play.

One issue I did encounter with the html5 video tag is when playing them in Firefox. My site host (and I found this to be a common problem when researching for solutions, so it must be pretty standardised for all webhosts) didn't have the .ogv file format specified, so the video wasn't working in Firefox. The solution was to go into my control panel, and add a MIME type for ogv (Application/ogg, extensions ogg ogv).

Also, I found that html5 only embeds the video, but doesn't have any functions such as playlists, so I wasn't able to make a playlist as I had originally intended (I learned that I could've probably used javascript, but that was beyond the scope of my project).

0 comments:

Post a Comment