HTML5视频不能在Firefox中播放 [英] HTML5 video not playing in Firefox

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

问题描述

我已经将文件转换为三种不同的格式:mp4,web和ogv。根据 caniuse firefox据说支持ogg和webm,但没有什么玩。



我使用 Miro Converter 转换文件,根据其他人应该工作得很好。我相信Chrome会拿起webm文件(如果我右键点击 - >在新标签中打开,它会显示我的webm文件),这非常棒。



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



我有一个静态图像作为背景。视频是假设显示在上面,所以如果它没有移动,你可以告诉它不工作。

任何想法?

$ b

它发送 内容类型:text / plain



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



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

  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


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.

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.

URL to the site: 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.

Any ideas?

解决方案

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

It send Content-Type: text/plain

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.

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

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天全站免登陆