This is a bit crazy, but I got a project where I couldn't use JS.
I have an mp4 that needs only to be played after the CSS animation is finished. To be better explained, I need to hide the cover image, then play the video behind it.
Is there a way to play mp4 from CSS/HTML only?
HTML
<div class="chute-background-image" style="background-image: url(./fg_bg.png);"></div>
<div class="winning-video">
<video>
<source src="./room.mp4" type="video/mp4">
</video>
</div>
CSS
.chute-background-image {
opacity: 1;
animation: hide 1s linear forwards;
}
@keyframes hide {
0% {
opacity: 1;
display: block;
}
99% {
opacity: 0;
display: block;
}
100% {
opacity: 0;
display: none;
}
}