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.
精彩评论