-
I just wanted to pass on how I set up a background video that runs automatically with a loop on my home page. This was prepared in Galatea, but should be cross-template.
I put my video in the Slideshow position, and made sure the position itself was set for flushed full-width content. Then I just used a plain old custom HTML particle and added the following code.
<div class="video-container">
<video autoplay loop muted poster="
www.whenigrowup.education/templates/rt_g...s/images/header1.jpg
">
<source src="
emailnet-my.sharepoint.com/personal/*****
“ type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="overlay-desc">
<a href=./give><img src=./images/WIGU/donate_btn2.png></a>
</div>
</div>
I put the actual video on sharepoint and am able to make it available to download/run as needed from there rather than locally. You can run it from Vimeo, but you have to have the right account for that these days. There are probably plenty of other options, too.
Note the ‘muted’ flag if you want it silent, and ’loop’ if you want that feature. The poster covers you for any lag time for the video to actually download enough to play.
In your custom scss file you need the following css:
/* VIDEO */
.video-container {
position: relative;
}
video {
height: auto;
vertical-align: middle;
width: 100%;
}
.overlay-desc {
background: transparent;
opacity: 0.8;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
Finally, I also used the hidden-phone class in the custom HTML black settings so that I don’t have phones trying to run the video. They get served a static image instead.
Hope that all makes sense!
You can see the finished product at:
www.whenigrowup.education
Allister
-
The following users have thanked you: Abfilm, MrT, Unay Santisteban