Hello,
is it possible to prevent the background row videos to autoplay? Our approach is to speed up the page load by first showing the poster image and start playing the bg video only after the page is fully loaded.
I had a look into: \js\fl-builder-layout.js
and see this initial creation of the video element: videoTag = $( '<video autoplay loop muted playsinline></video>' );
Is there any chance to remove the autoplay by JS in my theme? I suspect it’s not possible to prevent the autoplay after the bg video is initiated right now ?!
My first try:
(function($){ $( window ).load( function(){ if ( $('.fl-bg-video').length > 0) { $('.fl-bg-video').each(function(i,el){ var player = $(el).find('video').get(0); player.pause(); }); } }); })(jQuery);
But this try is only a hacky and bad approach
My second try would be to overwrite the /includes/row-video.php
template by creating an own video element with the corresponding js code in my theme.
Is there a better way of realizing this?