Continuing the discussion from Make a Background Video Play Once (No Loop):
Hi @stevo2989 I come across same issue I have to solve and it is a simple task to do. I have add to WF “background video” element it’s
id hero-video than I have pointed to its first child that is
<video> element it self. This allowed me to remove attribute loop from
<video> element. Now bg video plays only once.
const heroVideo = document.getElementById('hero-video').children heroVideo.removeAttribute("loop")
Hello, I have tried both recommended techniques to no avail.
Read-only website: Webflow - HarfangWeb
I have tried with and without Webflow.push();
I don’t know what else to try. Can you help me out?
hi @Simon_Loiselle and welcome. You have to place your code in
before body end section and it should work. I have tried on your live page and it worked for me.
const heroVideo = document.getElementById('backgroundVideo').children // console.log(heroVideo) heroVideo.removeAttribute("loop")
You do not need
push. If this animation is only on your homepage just place this code into you page settings