Reputation: 14575
The HTML 5 source
element has a src
and a type
attribute, like this:
<source src='url' type='mime/type; codec="codec-name"' />
Where is a complete list of the MIME types for the type attribute, together with their corresponding valid codecs attribute values?
Upvotes: 12
Views: 14216
Reputation: 1
if you need a list of MIME types go to this link:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
Upvotes: 0
Reputation: 369
There is a great list of MIME types and their browser support along with the codecs at WHATWG Wiki.
The most common codecs used and supported for HTML5 video are:
So, you can set the <source>
for your video to read:
<source src="video.ogv" type='video/ogg; codecs="theora, vorbis"'>
<source src="video.webm" type='video/webm; codecs="vp8, vorbis"'>
<source src="video.mp4" type='video/mp4; codecs="vc1.42E01E, mp4a.40.2"'>
As you can see, the MP4 is the trickiest, as you have to know which codec you're using and the AVC level for the video stream. The one I list above is a common one, but not the only possible one.
Upvotes: 11