HTML5 视频无法在 Firefox 中播放 [英] HTML5 video not playing in Firefox

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

问题描述

我已将文件转换为三种不同的格式:mp4、web 和 ogv.根据 caniuse 的说法,firefox 应该同时支持 ogg 和 webm,但没有播放.

I've converted the file to three different formats: mp4, web, and ogv. According to caniuse firefox supposedly supports both ogg and webm, but nothing is playing.

我使用 Miro Converter 转换了文件,据其他人说这应该可以正常工作.我相信 Chrome 会选择 webm 文件(如果我右键单击 -> 在新选项卡中打开,它会向我显示 webm 文件),这很棒.

I converted the files using Miro Converter, according to other people this should work just fine. I believe Chrome picks up the webm file (if i rightclick -> open in new tab, it shows me the webm file), which is great.

网址:http://dev.fristil.se/hbh/

我有一张静态图片作为背景.视频应该显示在它上面,所以如果它没有移动,你就可以看出它没有工作.

I have a static image as a background. The video is suppose to display above it, so if it's not moving you can tell it's not working.

有什么想法吗?

推荐答案

您的服务器没有为文件发送正确的 MIME 类型.

Your server is not sending the correct mime type for the file.

它发送 Content-Type: text/plain

HTML5 视频可以在 Safari、Chrome 和 IE 9 中播放,但不能在 Firefox 或 IE 7-8 中播放.如果您修复 MIME 类型的问题,它将在 Firefox 中播放.

The HTML5 video may play in Safari, Chrome and IE 9 but not Firefox or IE 7-8. If you fix the MIME-type issue, it will play in Firefox.

如果您使用的是 Apache 网络服务器或 Apache 的某些衍生物,则可以在站点范围的 httpd.conf.htaccess 中使用 AddType 指令> 文件在您存储视频文件的目录中.(如果您使用其他网络服务器,请查阅您服务器的文档,了解如何为特定文件类型设置 Content-Type HTTP 标头.)

If you’re using the Apache web server or some derivative of Apache, you can use an AddType directive in your site-wide httpd.conf or in an .htaccess file in the directory where you store your video files. (If you use some other web server, consult your server’s documentation on how to set the Content-Type HTTP header for specific file types.)

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

AddType audio/mpeg .mp3
AddType audio/ogg .ogg
AddType audio/mp4 .m4a
AddType audio/wav /wav

您在这里有同样的问题:视频文件 .ogv 在 Firefox 中本地播放,而不是从服务器和更详细的答案:https://stackoverflow.com/a/6145629/1081079

You have same question here: Video file .ogv plays locally in Firefox, but not from server and more detailed answer: https://stackoverflow.com/a/6145629/1081079

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

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