html5视频标签没有播放mp4 - IIS [英] html5 video tag not playing mp4 - IIS

查看:251
本文介绍了html5视频标签没有播放mp4 - IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是我无法通过视频标签获取mp4视频。

The problem I am having is that I am unable to get mp4 videos to run via a video tag.

服务器是Win7 Ultimate上的IIS 7.5。

The server is IIS 7.5 on Win7 Ultimate.

文件中的htm相当简单且香草:

The htm in the file is rather simple and vanilla:

<video width="360" height="240"  controls="controls" >
    <source src="test.mp4" type="video/mp4" />
</video>

在Internet Explorer中,标签呈现一个带红叉的黑框。

In "Internet Explorer" the tag renders a black box with a red cross.

在Firefox中,标签呈现为灰色框,带有浅灰色十字和找不到支持格式和MIME类型的视频。

In Firefox the tag renders as a grey box with a light-grey cross and the words "No video with supported format and MIME type found.".

我知道你在想什么 - 添加MIME类型。我做了这两种不同的方式却没有成功;首先我尝试在IIS中添加MIME类型,然后我尝试通过web.config添加

I know what you're thinking - add the MIME type. I have done this two different ways with no success; first I tried adding the MIME type in IIS, and then I have tried adding via the web.config with

<staticContent>  
  <remove fileExtension=".mp4" />
  <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
</staticContent>

这些都没有区别。我还将.mp4文件直接键入地址坏,IE和Firefox都可以播放。此外,我已经去过在IE和Firefox中使用视频标签的网站,他们播放视频就好了。

Neither of these made a difference. I have also typed the .mp4 file directly into the address bad and both IE and firefox are able to play it. Furthermore I have gone to websites that have use 'video' tag in both IE and firefox and they play the videos just fine.

有人可以帮我解释为什么这不会玩,以及我可以做些什么来玩它?

Can somebody please assist me in why this wont play, and what I can do to get it to play?

谢谢

推荐答案

按照建议绝对检查Chrome / Safari。 Firefox不支持通过HTML5视频播放MP4文件。你需要一个WEBM文件或一个后备flash播放器来支持Firefox(我假设Leanback会这样做)。

Definitely check Chrome/Safari as suggested. Firefox doesn't support MP4 files through HTML5 video. You need a WEBM file or a fallback flash player to support Firefox (which I'm assuming Leanback does).

总的来说,这听起来像是你的IE9版本的问题,并且可能仅限于您的机器。 leanback播放器的视频是否适用于IE9?或 videojs.com 上的视频?我已经多次在IE9中测试过后者了。

Overall it sounds like an issue with your version of IE9, and might be limited to your machine. Does the leanback player's video work in IE9 for you? Or the video on videojs.com? I've tested the latter myself in IE9 multiple times.

否则你的mp4文件中可能存在IE9无法支持的损坏。我在另一个问题中更多地解释了

Otherwise there could be corruption in your mp4 file that IE9 can't support. I explained this more in another question.

这篇关于html5视频标签没有播放mp4 - IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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