1
我想將視頻背景添加到我的HTML文檔。我在Youtbue上看到了關於如何做到這一點的教程..我複製了所有內容並將其添加到我的文檔中,使用視頻等必要文件,但問題在於它無法加載我的視頻。這裏是我的文檔的完整代碼:爲什麼背景視頻不顯示
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Video Background</title>
<style>
video#bgvid{
min-width:100%;
min-height:100%;
width:auto;
height:auto;
background: url(the_desert-wide2.png) no-repeat top center; /* replace **image link** with your own file*/
background-size:cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
</style>
</head>
<body>
<video id="bgvid" autoplay poster="img/bg.png"> <!-- replace **image link** with your own file -->
<source src="video.ogv" type="video/ogv" /><!-- replace **video link** with your own file -->
<source src="video.webm" type="video/webm" /><!-- replace **video link** with your own file -->
<source src="video.mp4" type="video/mp4" /><!-- replace **video link** with your own file -->
</video>
</body>
</html>
基本上視頻完全不顯示,取而代之的是bg.png
文件出現。我打開該文件在Opera,火狐,Chrome和IE,但沒有顯示:(
所以你知道我應該怎麼辦加載視頻?感謝!