html5视频在本地显示但不能在线显示
这是我第一次尝试使用html5来显示视频。我可以在本地机器和 wamp 上观看视频,代码没有问题。
然而今天我将视频页面在线加载到我的子域之一,例如 abc.mysite.com 视频就消失了。我去检查firebugs,代码的源部分是灰色的。
有人可以引导我找到使该视频在线播放的正确方向吗? cpanel中有什么东西或者我需要配置什么才能使html5在线吗?非常感谢。
这是代码
<div id="item1" class="item">
<div class="content">
<a href="#item2" class="panel">
<video id="my_Video" width="100%" height="100%" preload="auto" autoplay loop>
//below is where greyed out on firebugs!!
<source src="_video/abc12296_Animation.mp4" type="video/mp4" />
<source src="_video/abc12296_Animation.webm" type="video/webm" />
<source src="_video/abc12296_Animation.ogv" type="video/ogg" />
<p>Your browser does not support HTML5 video.</p>
//finished grey out!
</video>
</a>
</div>
</div>
<script>
$("#my_Video").bind("ended", function(){
this.play();
});
</script>
this is the first time I'm trying to use html5 to display a video. I could view the video on my local machine and wamp, no problem with the code.
However today I loaded the video page online to one of my subdomains eg abc.mysite.com The video is simply disappeared. I went to check firebugs, the source part of the code is greyed out.
Can someone please lead me to the right direction to make this video work online? Is there anything in cpanel or something I need to configure to make html5 online? Thanks very much.
Here is the code
<div id="item1" class="item">
<div class="content">
<a href="#item2" class="panel">
<video id="my_Video" width="100%" height="100%" preload="auto" autoplay loop>
//below is where greyed out on firebugs!!
<source src="_video/abc12296_Animation.mp4" type="video/mp4" />
<source src="_video/abc12296_Animation.webm" type="video/webm" />
<source src="_video/abc12296_Animation.ogv" type="video/ogg" />
<p>Your browser does not support HTML5 video.</p>
//finished grey out!
</video>
</a>
</div>
</div>
<script>
$("#my_Video").bind("ended", function(){
this.play();
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个类似的问题,我必须通过我的服务器上的 .htaccess 注册 mime 类型(mp4 以前不起作用)。
.htaccess-file:
检查此处:http://blog.j6consultants.com.au/2011/01/10/cross-browser-html5-video-running-under-iis-7-5/
had a similiar issue, and i had to register the mime types via .htaccess on my server (mp4 didn t work before).
.htaccess-file:
check here: http://blog.j6consultants.com.au/2011/01/10/cross-browser-html5-video-running-under-iis-7-5/
只是一个想法,但是您的服务器是否阻止下划线前缀文件夹?
如果您输入完整的 URL(即 http://abc.mysite.com),您可以直接访问视频吗/_videos/abc12296_Animation.mp4)?
此外,某些服务器可能不会提供这些特定的文件类型,除非您指定并告诉服务器如何处理它。您能否提供有关您正在使用的主机的更多信息?
编辑因为我无法对主要问题发表评论。 aletzo 所说的区分大小写是指某些服务器(通常是 Linux)区分大小写,因此 FILE.gif 与 file.gif 不同,而其他服务器(通常是 Windows)不关心大小写,而 FILE.gif 和 file.gif 不区分大小写。实际上指的是同一个文件。
Just an idea but does your server block underscore prefixed folders?
Can you access the videos directly if you type the full URL (i.e. http://abc.mysite.com/_videos/abc12296_Animation.mp4)?
Also some servers may not serve those specific file types unless you specify you want to and tell the server how to handle it. Can you provide more information on the host you are using?
Edit Since I cannot post comments on the main question. What aletzo is talking about with case sensitivity is that some servers (Linux usually) are case sensitive so FILE.gif is different than file.gif and other servers (usually Windows) do not care about case and FILE.gif and file.gif are actually referring to the same file.