HTML5视频无法在IE9中播放

时间:2013-02-22 21:02:36

标签: html5 video internet-explorer-9

网址:http://carolpolis.com/#media

HTML

<video width="auto" height="200px" poster="images/WithCourage.jpg" controls>
<source src="media/WithCourage.mp4" type="video/mp4">
<source src="media/WithCourage.webm" type="video/webm">
<source src="media/WithCourage.ogv" type="video/ogg">
Your browser does not support the video tag.
</video>

的.htaccess

AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/mp4 .mp4
AddType video/webm .webm
AddType application/x-shockwave-flash swf

文档类型

<!DOCTYPE HTML>

视频在Firefox和Chrome中完美播放但在IE9中我只看到“海报”图像而没有媒体控件。它似乎知道它们是视频,但是当我右击它们并按“播放”时没有任何反应。

非常感谢您的帮助! 梅雷迪思

3 个答案:

答案 0 :(得分:2)

mp4视频的编码不正确。

根据this question的答案,我将您网站上的某个视频转换为使用基线(3)编码配置文件,并使视频在IE10中的html页面上运行。

答案 1 :(得分:0)

尝试使用绝对网址,如:

<video width="auto" height="200px" poster="images/WithCourage.jpg" preload controls>
<source src="http://carolpolis.com/media/WithCourage.mp4" type="video/mp4">
<source src="http://carolpolis.com/media/WithCourage.webm" type="video/webm">
<source src="http://carolpolis.com/media/WithCourage.ogv" type="video/ogg">
Your browser does not support the video tag.
</video>

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

答案 2 :(得分:0)

浪费了这个问题很多时间。我发现返回内容类型的问题(使用fiddler2)是错误的。我尝试使用web.config修复它但没有任何帮助。所以我为视频文件编写了特定的操作,问题解决了

public ActionResult GetVideoFile(string id = "")
{
    string dir = Server.MapPath("/Content/MyVideoFiles");
    string path = System.IO.Path.Combine(dir, id);
    if ((System.IO.File.Exists(path))) {
        return File(path, "video/mp4");
    }
    return null;
}