<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Fullscreen Video</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css">
<style>
*{
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
.content {
margin: 0 auto;
width: 100%;
max-width: 960px;
padding: 0 15px;
}
h1 {
margin: 60px 0;
padding: 0;
font-size: 50px;
text-align: center;
}
p {
margin: 0 0 30px 0;
font-size: 30px;
line-height: 1.5;
}
.fullscreen-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
z-index: -100;
}
.fullscreen-bg__video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
@media (min-aspect-ratio: 16/9) {
.fullscreen-bg__video {
height: 300%;
top: -100%;
}
}
@media (max-aspect-ratio: 16/9) {
.fullscreen-bg__video {
width: 300%;
left: -100%;
}
}
@media (max-width: 767px) {
.fullscreen-bg {
background: url('../img/videoframe.jpg') center center/cover no-
repeat;
}
.fullscreen-bg__video {
display: none;
}
}
</style>
<div class="fullscreen-bg">
<video loop muted autoplay poster="img/videoframe.jpg" class="fullscreen-bg__video">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.mp4" type="video/mp4">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.ogv" type="video/ogg">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.webm" type="video/webm">
</video>
</div>
<div class="content">
<h1>Full screen HTML5 video background</h1>
<p>Lorem ipsum dolor sit amet, vix te quidam commodo placerat. Mei ne dicunt minimum disputationi, purto everti adolescens id cum, quis veritus cotidieque eum ex. Ea eirmod atomorum posidonium sed, splendide dissentiunt an mel. Dolorem suavitate voluptatibus pro no. No duo conceptam cotidieque.</p>
<img src="download.jpg"/>
</div>
</body>
versuchen Sie die absolute Position für das Bild und setzen Sie den entsprechenden Z-Index. – Panther
Ich habe versucht, das Standbild zeigt nicht – Andrewe3
Die von @Panther vorgeschlagene Lösung sollte funktionieren. Aktualisieren Sie Ihre Geige und zeigen Sie uns, warum es nicht angezeigt wird? Liegt es daran, dass auf eine falsche URL verwiesen wird? Gibt die Anfrage an die Bild-URL eine Art Fehler zurück? – Terry