Firefox不会使用HTML5播放.webm和.ogv视频 [英] Firefox won't play .webm and .ogv videos with HTML5
问题描述
我为我的网站准备了三种视频格式:
/assets/video/background-purple.ogg
/assets/video/background-purple.webm
/assets/video/background-purple.mp4
在网站上 http://tekhy.net/
我使用< video>标签播放视频:
< video webkit-playsinline autoplay =autoplayloop =trueposter =/资产/视频/ transparent.png>
< source src =/ assets / video / background-purple.oggtype =video / ogg>
< source src =/ assets / video / background-purple.mp4type =video / mp4>
< source src =/ assets / video / background-purple.webmtype =video / webm>
< / video>
我已经将我的视频的正确mimetype设置为 .htaccess
:
AddType video / mp4 .mp4 .m4v
AddType video / webm .webm
AddType video / ogg .ogv .ogg
在Google Chrome和Chromium中, Firefox移动工作得很好。在Firefox每晚21.0a运作良好。
但是在基本操作系统Luna的Firefox 18.0.1上无法正常工作。
Firebug告诉我,它无法解码webm和ogg / ogv media (火狐atm不支持mp4)。
我也试过background-purple.ogv type =video / ogv,但问题仍然存在。谷歌/ On2的VP8视频(VP80) >
Planar 4:2:0 YUV
目前我真的不知道如何解决这个问题。
任何建议?
看来我找到了一个解决方案:
我将我的ogv编解码器从VP8切换到了Theora,现在Firefox可以正确播放视频了。
我使用以下代码作为源代码:
< source src =/ assets / video / background-purple.ogvtype =video / ogg>
MIMEtype是:
AddType video / ogg .ogv .ogg
编解码器是:
Xiph.org的Theora Video(theo)
我想也可以用.webm,但是我没有测试过。
I prepared 3 video formats for my site:
/assets/video/background-purple.ogg
/assets/video/background-purple.webm
/assets/video/background-purple.mp4
on the site http://tekhy.net/
I use <video> tag for play the video:
<video webkit-playsinline autoplay="autoplay" loop="true" poster="/assets/video/transparent.png">
<source src="/assets/video/background-purple.ogg" type="video/ogg">
<source src="/assets/video/background-purple.mp4" type="video/mp4">
<source src="/assets/video/background-purple.webm" type="video/webm">
</video>
And I've setted the correct mimetype for my videos into .htaccess
:
AddType video/mp4 .mp4 .m4v
AddType video/webm .webm
AddType video/ogg .ogv .ogg
In Google Chrome and Chromium all works well, on Firefox Mobile works well too. On Firefox Nightly 21.0a works well. But on Firefox 18.0.1 on Elementary OS Luna it won't work.
Firebug tells me that it can't decode webm and ogg/ogv media (mp4 is not supported by Firefox atm).
I've tried also with background-purple.ogv type="video/ogv" but the problem remain.
My webm video is:
Google/On2's VP8 Video (VP80)
Planar 4:2:0 YUV
Currently I've really not idea on how solve this problem. Any suggestion?
Seems I've found a solution:
I switched my ogv codec from VP8 to Theora and now Firefox can play video correctly.
I used this code for the source:
<source src="/assets/video/background-purple.ogv" type="video/ogg">
The MIMEtype is:
AddType video/ogg .ogv .ogg
And the codec is:
Xiph.org's Theora Video (theo)
I guess it could work also for .webm but I've not tested it.
这篇关于Firefox不会使用HTML5播放.webm和.ogv视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!