视频未在IE和Chrome中显示

时间:2014-02-07 10:39:41

标签: javascript html css google-chrome

这将是漫长的,但我会尽量保持尽可能短。 我面临的问题是我在我的网站中嵌入了一个视频,但有些如何只在firefox中工作我想让它在IE中工作并且Chrome作为页面的背景

的index.html

<!DOCTYPE html>
<html>
<head>

<script type="text/javascript" src="jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery/modernizr.custom.26584.js"></script>
<script type="text/javascript" src="jquery/swfobject.js"></script>
<script type="text/javascript" src="js/video_background.min.js"></script>

<video id="video_background" preload="auto" autoplay="true" loop="loop" muted="muted"
volume="0"> 

<source src="Cosmic cloud_h.264.mp4" type="video/mp4"> </video>
<source src="Cosmic cloud_h.264.flv" type="video/flv"> </video>
<source src="Cosmic cloud_h.264.ogv" type="video/ogv"> </video>
<source src="Cosmic cloud_h.264.webm" type="video/webm"> </video>
<title>title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="newcss.css"</head>
<body>
<script src="js/scripts.js"></script>
<script type="text/javascript">
   jQuery(document).ready(function($) {
         $("body").video_background({  format:"16:9",
                           mp4:"videos/Cosmic cloud_h.264.mp4" ,
                           flv:"videos/Cosmic cloud_h.264.flv" ,
                           webm:"videos/Cosmic cloud_h.264.webm" ,
                           ogv:"videos/Cosmic cloud_h.264.ogv" ,
                           formatMobile:"16:9",
                           mp4Mobile:"videos/mobile/Cosmic cloud_h.264.mp4" ,
                           flvMobile:"videos/mobile/Cosmic cloud_h.264.flv" ,
                           ogvMobile:"videos/mobile/Cosmic cloud_h.264.ogv" ,
                           webmMobile:"videos/mobile/Cosmic cloud_h.264.webm" ,
                           loop:"true",
                           autoplay:"true",
                           muted:"false"   });
   });
</script>
</body>
</html>
非常感谢你。

1 个答案:

答案 0 :(得分:0)

BigVideo jquery插件播放背景视频,使用起来非常简单。

http://dfcb.github.io/BigVideo.js/

它可以在您提到的浏览器中顺利运行。