Html 5视频标签和编解码器问题 [英] Html 5 video tag and codecs problem

查看:199
本文介绍了Html 5视频标签和编解码器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个mkv文件。它的视频编解码器是avc,音频编解码器是ac3。

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

如何将它放入html5视频标签?

How can i put it into a html5 video tag?

我使用

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

但在safari 5或chorome4中它不起作用。

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

推荐答案

您的< source> 标记格式错误。您需要将编解码器信息放在类型属性的值中,例如:

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"'>

类型属性包含完整的MIME规范和编解码器是某些MIME类型的可选参数。 < video> 标记上没有单独的编解码器属性。

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.

这篇关于Html 5视频标签和编解码器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆