mp4视频无法在IE9中播放

mp4视频无法在IE9中播放

本文介绍了HTML5 - mp4视频无法在IE9中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HTML5 < video> 标签在IE9中播放mp4视频。我添加了MIME类型到IIS 7,所以如果我浏览 http://localhost/video.mp4 它既在Chrome和IE9中播放,也在HTML5中播放,Chrome会播放视频尽管在HTML中。以下是代码:

 < html> 
< body>
< video src =video.mp4width =400height =300preload controls>
< / video>
< / body>
< / html>

有什么想法?

p>

更新:

在Firefox 5.0中尝试了相同的文件,也就是说,只有Chrome能够播放mp4视频。

解决方案

结束使用支持所有浏览器。



但要让视频在IE9中运行和Chrome我只是添加了html5 doc类型并使用了mp4:

 <!DOCTYPE html> 
< html>
< body>
< video src =video.mp4width =400height =300preload controls>
< / video>
< / body>
< / html>


I have an mp4 video that I want to play in IE9 using HTML5 <video> tag. I added the MIME type to IIS 7 so if I browse http://localhost/video.mp4 it plays in both Chrome and IE9 but not in HTML5, Chrome plays the video in HTML though. Here's the code:

<html>
<body>
  <video src="video.mp4" width="400" height="300" preload controls>
  </video>
</body>
</html>

Any ideas?

Thanks

UPDATE:

Tried the same file in Firefox 5.0 and it didn't work either, only Chrome is able to play the mp4 video.

解决方案

Ended up using http://videojs.com/ to support all browsers.

But to get the video working in IE9 and Chrome I just added html5 doc type and used mp4:

<!DOCTYPE html>
<html>
<body>
  <video src="video.mp4" width="400" height="300" preload controls>
  </video>
</body>
</html>

这篇关于HTML5 - mp4视频无法在IE9中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 09:32