Streaming live at 10am (PST)

Stop background video loop

Hello all,

I have tried two solutions I have found online to stop the background video loop, but all in vain.

First code:

**<script type="text/javascript">**
**    $(document).ready(function() {           **
**            $("videoID").removeAttr("loop");**
**    });**
**</script>**

Second code:

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

Both codes don’t seem to work, even after I have check the video ID matches the code.

Hoping someone figured it out.

Thanks!

1 Like

Hello @dlimonchik

Here’s a similar script, but maybe will work

Click on your BG video element > open settings > set an ID for the video

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

Paste the code before the closing body tag

Piter :webflow_heart:

Assuming you gave the background video element a custom ID of ‘Video’:

<script type="text/javascript">
document.getElementById( 'Video' ).getElementsByTagName( 'video' )[0].removeAttribute("loop");;
</script>
1 Like