« Web, HTML, Tech Forum

using a video with sound for a loading screen?

hey y'all, i wanted to know if it's possible to use a video with audio for the loading/warning screen? this is the code i used


<style>
body:before {
content: " ";
height: 100vh;
width: 100vw;
display: block;
position: fixed; 
top: 0; 
left: 0; 
z-index: 100;
background-image: url('url here');
background-size: cover;
background-repeat: no-repeat;
background-position:center;
animation: yourAnimation 3s ease 0s 1 normal forwards;
pointer-events: none;
}
@keyframes yourAnimation { 0.0%{ opacity: 1;} 75%{ opacity: 1; } 100%{ opacity: 0;} } 
</style>

it works with gifs but is there a way it could work with a video??


Report Topic

2 Replies

Sort Replies:

Reply by Abigblueworld

posted

No. A video can be paused and played, a gif can't. Thus, it would be a mess.


Permalink Report Reply

Reply by Britney Unrivaled

posted

ok ty, i'm gonna stick with gifs then!! thank u for letting me know 🌺


Permalink Report Reply