Stop Background Video from Looping

I used the jQuery you suggested to disable looping but it is not working. I made sure to target the right video but no luck. It keeps looping :frowning:

jQuery:
jQuery(document).ready(function($){
setTimeout(function(){$(’#bg-smoke-beach video.x-mejs’).prop(‘loop’, false);},5000);
});

Site:
https://estoestulum.com/beta/

FYI
I ended up hiding the video once it has played once. It’s not an elegant solution but it works. Could not disable loop for the life of me.

		var video = $('#bg-smoke-beach video.x-mejs');
		video.on('ended', function(){console.log('ended')
			video.attr('style','display:none !important');
		 });

Hello Rima,

Thanks for writing in! Please remove the JS code and use this one instead:

jQuery( function($) {

  function no_bg_loop () {
         $('video').prop('loop', false);
  }

  $(document).ready( no_bg_loop );

  $(window).load ( no_bg_loop );

  no_bg_loop();

} );

We would love to know if this has worked for you. Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.