简体   繁体   English

HTML5视频无法在Firefox 3.6中播放

[英]HTML5 video not playing in Firefox 3.6

I have the following code to play HTML5 video on website: 我有以下代码在网站上播放HTML5视频:

<video autoplay loop poster="">

    <source src="http://www.domain.com/uploads/videos/video.mp4" type="video/mp4;">
    <source src="http://www.domain.com/uploads/videos/video.webm" type="video/webm"/>
    <source src="http://www.domain.com/uploads/videos/video.ogg" type="video/ogg"/>

    <p> Your browser does not support HTML5 video. Please upgrade to a modern browser to view the video.</p>

</video>

I tried this on Firefox 3.6 and it shows a blank page instead of playing the video. 我在Firefox 3.6上尝试了此操作,它显示空白页面而不是播放视频。 Is there a way to fix this? 有没有办法解决这个问题? Thanks. 谢谢。

Firefox 3.6 does support HTML 5 video , so the behaviour you are experiencing is correct. Firefox 3.6 确实支持HTML 5视频 ,因此您遇到的行为是正确的。

Use JavaScript to detect when no sources have loaded and provide alternatives with DOM manipulation. 使用JavaScript来检测何时未加载任何源,并提供DOM操作的替代方法。

Your server is probably serving it as application/octet-stream. 您的服务器可能将其作为应用程序/八位位组流使用。

Check your content types are correct: 检查您的内容类型是否正确:

.ogg application/ogg
.ogv video/ogg
.mp4 video/mp4

I don't know your server setup but if you are using apache add this to your .htaccess: 我不知道您的服务器设置,但是如果您使用的是apache,请将其添加到您的.htaccess文件中:

AddType application/ogg .ogg
AddType video/ogg .ogv
AddType video/mp4 .mp4 .m4v
AddType video/webm .webm

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

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