html5视频显示在本地,但不在线 [英] The html5 video shows at local but not online
问题描述
这是我第一次尝试使用html5来显示视频。我可以在我的本地计算机和wamp上查看视频,没有问题的代码。
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.
但是今天我加载视频页面在线我的一个子域,如abc.mysite .com视频消失了。我去检查firebugs,代码的源代码部分是灰色的。
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.
有人可以带我去正确的方向,使这个视频在线吗?在cpanel有什么或我需要配置使html5在线?非常感谢。
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.
以下是代码
<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>
推荐答案
有一个类似的问题, mime类型通过我的服务器上的.htaccess(mp4以前工作)。
had a similiar issue, and i had to register the mime types via .htaccess on my server (mp4 didn t work before).
.htaccess文件:
.htaccess-file:
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/mp4 .mov
AddType video/webm .webm
请在这里检查: http://blog.j6consultants.com.au/2011/01/10/cross-browser-html5- video-running-under-iis-7-5 /
这篇关于html5视频显示在本地,但不在线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!