我有 3 个视频副本:
Raw AVI
Encoded .mp4 (h.264 video and mp3 audio)
Encoded .ogv, encoded with oggtheora
我的 HTML 5 播放器在 Firefox 14、Chrome 19 和 Opera 12 中运行,但是在 Internet Explorer 9 中却失败了,您猜对了。据我所知,应该拾取并播放 h.264 文件事实并非如此。
<video class="vid" width="550" height="400" controls>
<source src="test/charlie.mp4" type="video/mpeg" />
<source src="test/charlie.ogv" type="video/ogg" />
Nope.
</video>
有什么想法吗?
请拍下这张照片以表达我的谢意
对于询问然后删除评论的人:
htdocs/html5$ ls
index.php test
htdocs/html5/test$ ls
charlie.avi charlie.mp4 charlie.ogv
最佳答案
您是否尝试过使用 type="video/mp4"
而不是 type="video/mpeg"
?
<video class="vid" width="550" height="400" controls>
<source src="test/charlie.mp4" type="video/mp4" />
<source src="test/charlie.ogv" type="video/ogg" />
Nope.
</video>
我以前使用 IE9 时从来没有遇到过问题,可以从这里来。
关于Internet Explorer 中的 HTML5 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11210237/