Skip to content

Instantly share code, notes, and snippets.

@dudelis
Created April 1, 2019 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dudelis/245d871deb898b17aa6f3ffc6640b946 to your computer and use it in GitHub Desktop.
Save dudelis/245d871deb898b17aa6f3ffc6640b946 to your computer and use it in GitHub Desktop.
K2: Video Background
const html = '<div id="k2-background-video" class="bg-video"><video class="bg-video__content" autoplay muted loop><source src="https://github.com/dudelis/K2Devs/raw/master/k2-ui-features/k2-video-background/video.mp4" type="video/mp4"><source src="https://github.com/dudelis/K2Devs/raw/master/k2-ui-features/k2-video-background/video.webm" type="video/webm">Your browser is not supported</video></div>';
$('.runtime-content').prepend(html);
.bg-video {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: -1;
opacity: .40;
overflow: hidden;
}
.bg-video__content {
height: 100%;
width: 100%;
object-fit: cover;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment