简体   繁体   English

HTML5视频标记中的MP4无法在Internet Explorer中播放

[英]MP4 in HTML5 Video Tag Not Playing in Internet Explorer

Can anybody tell me why this is working for Firefox and Chrome, but not for IE9, 10, or 11? 任何人都可以告诉我为什么这适用于Firefox和Chrome,但不适用于IE9,10或11? It's giving me the typical black screen with a small white square containing a red X. 它给了我一个典型的黑色屏幕,一个带有红色X的小白色方块。

<!DOCTYPE html>
<html>
<head>
    <title>HTML5 Video Player Test</title>
</head>
<body>
    <video style="position:fixed; top:0px; left:0px; height:100%; width:100%;" autoplay controls>
      <source src="./videos/video.mp4" type="video/mp4">
      <source src="./videos/video.ogg" type="video/ogg">
    </video>
</body>
</html>

Things I have already tried: - Adding the MIME type to .htaccess - Re-encoding to make sure the MP4 are properly H264. 我已经尝试过的事情: - 将MIME类型添加到.htaccess - 重新编码以确保MP4正确H264。 - video.js didn't help at all. - video.js根本没用。

I have also tried just using 'File' > 'Open' and opened the MP4 locally on my machine using IE, and it plays just fine like that, so I think the video should be properly encoded and everything for IE. 我也尝试过使用'文件'>'打开'并使用IE在我的机器上本地打开MP4,它播放就好了,所以我认为视频应该是正确的编码和IE的一切。

对于IE9,使用meta标签

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM