Rewind and replay background video when scrolled into view

For Webflow background video component, use this site footer code to rewind the looping video when user scrolls it into view:

$.getScript('', function() {
  const vids = document.getElementsByTagName('video');
  if(vids.length === 0) return;, function(myVideo) {
    VisSense.VisMon.Builder(VisSense(myVideo, {
      fullyvisible: 0.8
    .on('fullyvisible', function() {
      myVideo.currentTime = 0;;
    .on('hidden', function() {

Also, feel free to contact me for further custom code help and/or customization of third-party plugins

This is really useful. I want to be able to trigger it only on certain videos though. I have set up a page with 3x background videos (all set to restart when scrolled into view thanks to the above code).

How would I go about specifying? Let’s say I wanted RED & BLUE to restart, but GREEN to just play and loop constantly?

1 Like