开发者

HTML5 video tag in chrome - wmv

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 cann开发者_运维百科ot 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?


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.


Chrome handles wmv with a plugin, but not with a codec in HTML5. Chrome and HTML5 handles H.264.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜