HTML5 video tag in chrome - wmv

前端 未结 2 508
盖世英雄少女心
盖世英雄少女心 2021-01-05 08:38

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.

Do

相关标签:
2条回答
  • 2021-01-05 09:00

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

    0 讨论(0)
  • 2021-01-05 09:04

    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.

    0 讨论(0)
提交回复
热议问题