开发者

What is the syntax for the source element’s type attribute in HTML5?

Can someone explain, in s开发者_运维百科imple terms, the syntax for the type attribute and codecs parameter for the <source> element in HTML5?


Yes! Mark Pilgrim can!

  • http://diveintohtml5.ep.io/video.html#markup (scroll down a bit for the type attribute on <source> elements)

In short:

  • the first part of type is the video container file’s format (e.g. WebM, MP4)
  • the second part (the codecs bit) lists the audio and video codecs used to encode the audio and video within the video container file

(If the terms “codec” and “container file” aren’t clear, Pilgrim’s got you covered there too: video containers and video codecs.)

To work out what values you should use for video formats not covered by Pilgrim, see http://wiki.whatwg.org/wiki/Video_type_parameters.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜