2010-06-14 18 views
6

Ich habe eine MKV-Datei. Es ist Video-Codec AVC und Audio-Codec ist AC3.Html 5 Video-Tag und Codecs Problem

Wie kann ich es in ein HTML5-Video-Tag einfügen?

Ich benutze die

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

aber in Safari 5 oder chorome4 es nicht funktioniert.

Antwort

9

Ihr Tag <source> ist falsch formatiert. Sie müssen die Codec Informationen innerhalb des Wertes des type Attributs statt setzen, zum Beispiel:

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

Das type Attribut enthält eine vollständige MIME-Spezifikation und codecs ist ein optionaler Parameter für einig MIME-Typen. Es gibt kein separates Attribut codecs auf dem Tag.

0

<source ist nicht das HTML5-Video-Tag der obersten Ebene, dasheißt. Sie können mehr herausfinden from this tutorial. Verwenden Sie <source> innerhalb von <video>?

+1

Ich weiß, ich nur Quellcode aus meinem Code einfügen. –