views:

2198

answers:

3

Hi Al,

I need to make a page which displays a video. Firefox and and Opera support the OGG format, no problem there. Chrome is ... "stupid" and does not recognize OGG.

Does Chrome on Windows know how to handle WMV? I already have them encoded, and no I cannot recode new videos since the media is limited in spaced (CDROM).

My code currently looks like this (and not working in chrome)

<video controls>
<source codecs="theora, vorbis" media="video/ogg" src="video.ogv" />
<source media="video/x-ms-wmv" src="video.wmv" />
Please install a new browser, or just get out
</video>

Note that I am missing a codec entry, does anyone know what I need to put there?

A: 

Chrome handles wmv. Chrome and HTML5 handles H.263 (or is it H.264? I forgot).

EDIT: Obviously, Chrome can handle wmv with a plugin, not with a codec and HTML5, and that's what I meant by my comment.

Rob
+1  A: 

To the best of my knowledge, Chrome doesn't support WMV. Opera, Firefox and Chrome support Ogg Theora+Vorbis, while Chrome and Safari support MPEG-4 H.264+AAC.

Your markup needs a bit of fixing. There is no codecs attribute, use the type attribute instead. Also, you usually don't need the media attribute at all. Here's your cleaned up markup:

<video controls>
  <source type="video/ogg; codecs=theora,vorbis" src="video.ogv">
  <source src="video.wmv">
  Your browser doesn't support video, you may download the
  video instead: <a href="video.ogv">Ogg</a>
</video>

The only browser that might be able to play WMV is Opera on Linux (if you happen to have the right GStreamer plugins installed). That's not very useful, so you should probably just not use WMV with <video> at all.

You might find this useful reading: Everything you need to know about HTML5 video and audio.

Disclaimer: I work on <video> for Opera.

foolip