Html 5视频标签和编解码器问题
我有一个 mkv 文件。它的视频编解码器是avc,音频编解码器是ac3。
如何将其放入 html5 视频标签中?
我使用
<source src="01.mkv" type="video/x-matroska" codecs="a_ac3, avc">
但在 safari 5 或 chorome4 中它不起作用。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的
标记格式不正确。您需要将编解码器信息放入
type
属性的值中,例如:type
属性包含完整的 MIME 规范,以及codecs
是某些 MIME 类型的可选参数。标记上没有单独的
codecs
属性。Your
<source>
tag is malformed. You need to put the codec information inside the value of thetype
attribute instead, eg:The
type
attribute contains a full MIME specification, andcodecs
is an optional parameter for some MIME types. There is no separatecodecs
attribute on the<video>
tag.<source
is not the top level HTML5 video tag, which is named<video>
. You can find out more from this tutorial. Are you using<source>
inside of<video>
?