Background video play on hover - only works on first CMS video

Yep @vincent . So far I used some custom javascript that another member of WF community (@Daniel_Schultheiss ) shared in a similar topic. But as I said it only plays the first video on the collection list…

<script>
  $(document).ready(function() {       
     $('.videobgjs').each(function(i, obj) {
         $(this).on("mouseover", function() { hoverVideo(i); });
         $(this).on("mouseout", function() { hideVideo(i); });
     });
  });

  function hoverVideo(i) {  
    $('.thevideo')[i].play(); 
  }

  function hideVideo(i) {
	$('.thevideo')[i].currentTime = 0; 
    	$('.thevideo')[i].pause(); 
  }
  
</script>

I’ll try to figure something out. Speak with some js dev maybe. If I find a good solution I’ll post in here. If not I would have to change my layout.