Does HTML5 <video> playback support the .avi format?

前端 未结 4 437
再見小時候
再見小時候 2020-11-29 05:12

I am wondering if the HTML5 tag now supports playback of .avi format video files.

相关标签:
4条回答
  • 2020-11-29 05:25

    The HTML specification never specifies any content formats. That's not its job. There's plenty of standards organizations that are more qualified than the W3C to specify video formats.

    That's what content negotiation is for.

    • The HTML specification doesn't specify any image formats for the <img> element.
    • The HTML specification doesn't specify any style sheet languages for the <style> element.
    • The HTML specification doesn't specify any scripting languages for the <script> element.
    • The HTML specification doesn't specify any object formats for the <object> and embed elements.
    • The HTML specification doesn't specify any audio formats for the <audio> element.

    Why should it specify one for the <video> element?

    0 讨论(0)
  • 2020-11-29 05:43

    Short answer: No. Use WebM or Ogg instead.

    This article covers just about everything you need to know about the <video> element, including which browsers support which container formats and codecs.

    0 讨论(0)
  • 2020-11-29 05:46

    The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate.

    http://en.wikipedia.org/wiki/HTML5_video

    0 讨论(0)
  • 2020-11-29 05:49

    There are three formats with a reasonable level of support: H.264 (MPEG-4 AVC), OGG Theora (VP3) and WebM (VP8). See the wiki linked by Sam for which browsers support which; you will typically need at least one of those plus Flash fallback.

    Whilst most browsers won't touch AVI, there are some browser builds that expose all the multimedia capabilities of the underlying OS to <video>. These browser will indeed be able to play AVI, as long as they have matching codecs installed (AVI can contain about a million different video and audio formats). In particular Safari on OS X with QuickTime, or Konqi with GStreamer.

    Personally I think this is an absolutely disastrous idea, as it exposes a very large codec codebase to the net, a codebase that was mostly not written to be resistant to network attacks. One of the worst drawbacks of media player plugins was the huge number of security holes they made available to every web page exploit. Let's not make this mistake again.

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