Firefox 11中如何播放HTML5视频不一致? [英] How come HTML5 video plays inconsistently in Firefox 11?

查看:105
本文介绍了Firefox 11中如何播放HTML5视频不一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主页上有以下的HTML5视频代码,它在Firefox 11中显得很奇怪。

 < video width = 900height =508autoplay =autoplaycontrols =controls> 
< source type =video / webmsrc =http://www.mysite.com/MovieClip.webm>< / source>
< source type =video / mp4src =http://www.mysite.com/MovieClip.mp4>< / source>
< / video>

当我的网站加载主页时,我在视频的位置看到以下错误消息:
找不到支持格式和MIME类型的视频。

但是,当我打开媒体路径 http://www.mysite.com/MovieClip.webm直接在一个新的选项卡中加载媒体就可以了(使用内部的Firefox HTML5视频播放器)!

然后,当我回到我的主页并刷新页面时,它现在加载视频就好了!任何想法,为什么发生这种情况,如何解决?

感谢提前!

解决方案

确保您的Web服务器配置为以MIME类型video / webm的形式提供WebM视频。您可以通过telnet到您的Web服务器并发出HEAD请求来快速手动检查是否属于这种情况:

  telnet www。 mysite.com 80 

[after connection ...]

  HEAD /MovieClip.webm HTTP / 1.1 
主机:www.mysite.com

然后用2回车完成请求。 HTTP响应头应该包含一个Content-Type:行。如果没有显示video / webm,Firefox将不会接受您的WebM文件。


I have the following HTML5 video code on my homepage and it acts strange in Firefox 11.

<video width="900" height="508" autoplay="autoplay" controls="controls">
    <source type="video/webm" src="http://www.mysite.com/MovieClip.webm"></source>
    <source type="video/mp4" src="http://www.mysite.com/MovieClip.mp4"></source>
</video>

When the homepage on my site loads, I see in the place of the video the following error message: "No video with supported format and MIME type found."

However, when I open up the media path "http://www.mysite.com/MovieClip.webm" directly, in a new tab, it loads the media just fine (using the internal Firefox HTML5 video player)!

Then, right afterwards when I go back to my homepage and refresh the page, it now loads the video just fine! Any ideas on why this is happening and how to fix?

Thanks in advance!

解决方案

Be certain that your web server is configured to deliver WebM video as MIME type "video/webm". You can quickly and manually check if this is the case by telnetting to your web server and issuing a HEAD request:

telnet www.mysite.com 80

[after connection...]

HEAD /MovieClip.webm HTTP/1.1
Host: www.mysite.com

And finish the request with 2 carriage returns. The HTTP response header should contain a "Content-Type:" line. If it doesn't say "video/webm", Firefox won't accept your WebM file.

这篇关于Firefox 11中如何播放HTML5视频不一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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