直接查看WebM或OGG文件可在Firefox中使用,但不能在Chrome中使用 [英] Directly viewing WebM or OGG file works in Firefox but not in Chrome
问题描述
我遇到了让本地视频用于HTML5视频元素的问题。
I'm having an issue with getting local videos working for the HTML5 Video element.
如果我尝试直接在Firefox中查看本地OGG或WebM文件16.0.2它可以工作,但在chrome 22中它不起作用!
If I try and view a local OGG or WebM file directly, in Firefox 16.0.2 it works, but in chrome 22 it does not work!
但是,如果我在另一个网络服务器上查看OGG文件,它可以正常工作。
However, if I view an OGG file on another webserver, it works correctly.
例如此文件
http://www.quackit.com/video/pass-countdown.ogg
正常工作对我来说,但如果我把它保存到我自己的服务器上
Works correctly for me, but if I save it onto my own server as
http://test.jammaloo.com/pass.ogg
然后它适用于Firefox,但Chrome无法播放。
Then it works in Firefox, but Chrome will not play it.
我认为mimetype设置正确,任何人都可以帮我追踪这个问题吗?
I believe the mimetype is being set correctly, can anyone help me track down the issue?
推荐答案
- 首先尝试添加对更多视频类型的支持
链接 - http://www.htmlgoodies.com/html5/client/how-to-embed-video-using-html5.html
video id =sampleMoviewidth =640height =360preload controls
video id="sampleMovie" width="640" height="360" preload controls
<source src="HTML5Sample_H264.mov" type='video/mp4;' />
<source src="HTML5Sample_Ogg.ogv" type='video/ogg;' />
<source src="HTML5Sample_WebM.webm" type='video/webm;' />
video
video
- 再次检查.htaccess文件的内容类型 - 为webm添加mime类型,ogg,mp4
链接 - http://docs.sublimevideo.net/troubleshooting
链接 - http:// www.htaccess-guide.com/adding-mime-types/
这些解决了我在HTML5视频标签中播放视频的问题。希望它也能帮到你。
These solved my problem of playing video in HTML5 video tag. Hope it helps you too.
当我在CHROME中检查时,你的内容没有加载正确的TYPE
As i checked in the CHROME your content is not getting loaded with correct "TYPE"
如果适用(并且没有任何效果),您可以使用 - http://www.longtailvideo.com/players
If applicable (and nothing works) you can use- http://www.longtailvideo.com/players
这篇关于直接查看WebM或OGG文件可在Firefox中使用,但不能在Chrome中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!