'Stop background video loop' hack suddenly stopped working

Continuing the discussion from Stop a background video:

I recently implemented this successfully but it suddenly stopped working.

@samliew and @mdiamond24, are your implementations of this still working?

Thanks

Read-only link:
https://preview.webflow.com/preview/planet-reed?preview=ab08f7e58e998448bfdda11a0e3608b1

Published link:
http://planet-reed.webflow.io/

Specific page with issue:
http://planet-reed.webflow.io/vault

04

Welcome to the Webflow forum!

Could you please edit Screenshot_2017-08-16_140811 and provide ALL the necessary details in your post so we can take a look at your site/issue?

In future if you want faster replies and more accurate answers, I suggest including all the details listed in the link above before someone has to ask.

Hope to hear from you soon. Thanks!

Apologies. Done. Also included url of the specific page related to this issue. Cheers.

I am also experiencing this issue on sites I have previously used the same code on. Now it is not working.

Here’s the new code:

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

Replace Vaultvideo with the ID of the background video component.

Thanks @samliew, all working again.

Hey, I tried to load the script into the code area, set my ID and then published to the test but it still plays in a loop for the video.

The goal is to have it run the video and end on the very last screen of the video. Is that possible?

I’m a bit surprise with Webflow. For all the great features and controls that the software offers, they greatly lack on very basic video control options.

1 Like

Code is good and It’s working on all my sites. I know the ID element is case sensitive so only thing I can suggest is looking to see if you are using a capital V in the ID. Sorry I can’t be more help.

I’ve only got one instance of this code and it’s working well.

I have solved this issue using some other jquery code. Check this link

Hi everyone, sorry for bumping this old thread. Is this code still working for you all? I’ve tried the original and Sam’s new code but neither seem to be working. Any ideas?

https://aqualuce.webflow.io/

This is probably a stretch, but did you figure this out?

When I set an ID in the Background Video Settings and checked the code in my browser’s inspection pane, it’s apparent that the ID has been applied to the div element which holds the video, not the video element itself.

your queryselector should point to the tag name, called “video”