答案 0 :(得分:2)
这应该有效:或者至少让你走上正确的道路:一旦编译好了吗?我不知道。还要确保您的视频分辨率足以填满空间。 编辑:必须删除离子内容才能使其正确扩展:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<link href="http://code.ionicframework.com/1.0.0/css/ionic.min.css" rel="stylesheet">
<script src="http://code.ionicframework.com/1.0.0/js/ionic.bundle.js"></script>
</head>
<body ng-app="app">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Awesome App</h1>
</ion-header-bar>
<video autoplay loop poster="" id="bgvid">
<source src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" type="video/webm">
<source src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" type="video/mp4">
</video>
</ion-pane>
</body>
</html>
CSS:
#bgvid {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
-o-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(http://video.webmfiles.org/big-buck-bunny_trailer.webm) no-repeat;
background-size: cover;
}