Streaming live at 10am (PST)

Make a Background Video Play Once (No Loop)

Hi All,

Is there a way to make a background video play just once? This doesn’t work for me:

Thanks.

Niall

The code you need for this is as follows

<script type="text/javascript">
document.getElementById('Video').removeAttribute("data-loop");
</script>

Thanks for response. This doesn’t work for me unfortunately. Still looping.

Can you share your read only and webflow staging webflow domain please?

https://hummingbird-site.webflow.io/

https://preview.webflow.com/preview/hummingbird-site?utm_source=hummingbird-site&preview=dbcda7ae174fd64f182e8b268309f79f

Thanks

Here’s a new code:

<script>
Webflow.push(function() {
  document.getElementById('video').querySelector('video').removeAttribute('loop');
});
</script>
3 Likes

Thanks a million. That worked :slight_smile:

1 Like

I’m glad I could help.

Hi, I’m having the same issue but for some reason the code doesn’t seem to work for me. Would it be possible to let me know where I’m going wrong https://preview.webflow.com/preview/marketingmatters2?utm_medium=preview_link&utm_source=dashboard&utm_content=marketingmatters2&preview=8e8a9cde734a09777a13aa19fd2aa73a&mode=preview

Thanks

You’re missing the ID ‘video’:

2 Likes

Hello @aaronocampo I have followed your instructions in regard to the script and ID for video background but it is still looping, any thoughts? TY!!!