Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html 5 video tag and codecs problem

Tags:

html5-video

I have a mkv file. It's video codec is avc and audio codec is ac3.

How can i put it into a html5 video tag?

I use the

<source src="01.mkv" type="video/x-matroska" codecs="a_ac3, avc">

but in safari 5 or chorome4 it doesn't works.

like image 306
Alex Chen Avatar asked Jun 14 '10 06:06

Alex Chen


1 Answers

Your <source> tag is malformed. You need to put the codec information inside the value of the type attribute instead, eg:

<source src="01.mkv" type='video/x-matroska; codecs="a_ac3, avc"'>

The type attribute contains a full MIME specification, and codecs is an optional parameter for some MIME types. There is no separate codecs attribute on the <video> tag.

like image 79
Remy Lebeau Avatar answered Sep 26 '22 10:09

Remy Lebeau