Am tasked with building an ASP.NET 4.0 Web Forms site to support playback of YouTube videos. Will build it as a HTML5 site but am trying to weave my way through the maze of video formats/codecs.
I do not want to use plugins and I want it to have cross-browser support:
- IE9/IE8/IE7
- Firefox
- Chrome
- Safari
Majority of traffic will be IE. For the other browsers, latest versions will suffice.
I’m looking to embed the videos directly. Really just need to know how to cater for the different browsers without use of plugins (incl. Google Frame).
Can anyone provide some guidance/direction?
UPDATE
Per Stilgar’s answer, there probably will be no advantage gained to creating this as HTML5
If you only need to embed videos from youtube you don’t need to care about codecs and browser support. You only need to render the Youtube embed code on your page which is just an iframe. The user can get the html by clicking share > embed on youtube or you can generate it programatically when the user pastes an URL to an youtube video. The code looks like this:
If you do this youtube will provide a player for the user. The player will be based on the user’s settings IN YOUTUBE. For example if the user has selected HTML5 videos on youtube he will get an HTML5 player for his browser. If the user has opted in for Flash or is using an older browser youtube will serve the Flash player. Also some videos (those with ads) are only available with Flash.
Basically even if you want to do something else you can’t. That’s how Youtube works and you want to embed their videos not serve your own. However I don’t see why you will want something different from what they provide. They make their best to support every browser in the best way.
And just FYI the video tag is supported on the latest version of all browsers and is not supported in IE8 and IE7. There are two codecs (with 2 formats) that are important right now these are H.264(mp4) and VP8 (webm)
Safari (including Safari on iOS) and IE9+ (including IE on Windows Phone) support H.264
Chrome, Firefox and Opera support VP8
If you want to support all browsers via the video tag you need to provide both encodings and encode the video twice.
If you want to support IE7 and IE8 your only option is a plugin (be it Flash, Silverlight or just regular old Media Player Plugin that comes by default)