Whenever I try to play the video set as the background of the div, it only starts playing if I refresh the page with Chrome dev tools open.
HTML:
<div id="videoDiv">
<div id="videoBlock">
<img src="" id="vidSub">
<video preload="preload" id="vid1" autoplay="autoplay" loop="loop">
<source src="images/solPromo.mp4" type="video/mp4"></source>
</video>
CSS:
#vid1 {
display: none;
}
#vidSub {
display:block;
width:100%;
height:auto;
max-width:100%;
}
@media only screen and (min-width: 992px) {
#vid1 {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding-top: 480px;
z-index: 1;
}
#vidSub {
display: none;
}
}
#videoDiv {
width: 100%;
max-width:992px;
margin:auto;
display:block;
position: relative;
z-index: 2;
background: transparent;
}
Initially, I thought the issue might be with the z-index property, so I tried switching them around, but unfortunately, it didn't have any impact on the video loading without the dev tools open.