过去两天我关注了很多帖子。 Firefox 不会在 this link 上播放 OGV 文件,但在本地服务器上运行良好。该文件是 chmod 777
。
这是在 .htaccess
文件中:
SetEnv no-gzip dont-vary
RewriteRule . - [E=no-gzip:0]
<FilesMatch "^(?!.*\.ogg$|.*\.ogv$).+" >
<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE env=notogg true
FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
FilterChain COMPRESS
FilterProtocol COMPRESS change=yes;byteranges=no
</IfModule>
</FilesMatch>
AddType audio/ogg .oga .ogg
AddType video/ogg .ogv
AddType application/ogg .ogg
AddType video/webm .webm
AddType video/mp4 .mp4
我在页面顶部有这个:
<?php ini_set('zlib.output_compression', 'Off'); ?>
这是代码:
<video width="720" height="405" controls autoplay preload >
<source src="beautiful_soul_aw111.mp4" type='video/mp4' />
<source src="beautiful_soul_aw11.m4v" type='video/mp4' />
<source src="beautiful_soul_aw11.ogv" type='video/ogg' />
<source src="beautiful_soul_aw11.webm" type='video/webm' />
</video>
当我执行 phpinfo
时,我发现服务器忽略了我关闭 gzip 的请求。
我使用 curl 进行了检查,文件类型正确:
curl -I http://www.beautiful-soul.co.uk/collections/beautiful_soul_aw11.ogv
HTTP/1.1 200 OK
Date: Mon, 29 Aug 2011 18:44:03 GMT
Server: Apache/2
Last-Modified: Mon, 29 Aug 2011 17:44:49 GMT
ETag: "36976a8-4aba873976640"
Accept-Ranges: bytes
Content-Length: 57243304
Content-Type: video/ogg
当我查看页面并获取页面信息时,它显示如下:
Location: http://www.beautiful-soul.co.uk/collections/beautiful_soul_aw11.ogv
Type: video/ogg
Size: 8 KB (8192 bytes)
Dimensions: 0px × 0px
Associated Text: AC_FL_RunContent(...
我不知道为什么。
- 我的
.htaccess
文件将被忽略,GZIP 仍处于启用状态。 - 为什么找到 OGV 文件但仅以字节为单位下载且没有尺寸。
最佳答案
是的,很抱歉回复晚了。我重新安装/更新了 Firefox。这是通过取出 ogg 版本解决的
<video width="720" height="405" preload controls autoplay >
<source src="beautiful_soul_aw111.mp4" type='video/mp4' />
<source src="beautiful_soul_aw11.m4v" type='video/mp4' />
<!--<source src="beautiful_soul_aw11.ogv" type='video/ogg' />-->
<source src="beautiful_soul_aw11.webm" type='video/webm' />
</video>
它现在在所有浏览器中都能正常播放。
谢谢
安迪
关于html - OGV 文件未播放。 Mime 类型设置,选中 Curl,尝试在服务器上禁用 GZIP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7234608/