Slider with video background

Hi, I have a nested hero slider where one of the slides has a video background, now this slide is not the first slide but if you select autoplay it starts paying as soon as the page loads in the background, so when the slider gets to that slide the video is done. Does anyone know how to make it so that the video starts playing once the slide is active so you see the video from start to finish?

I’ve also encounted this issue and have not yet found a solution - my only workaround is to use a slider plugin, so I would also be interested if it’s possible.

that is a common problem for all builders :slight_smile:

I coded this for my client project. I tested this for normal video element not video background keep it mind. but should work fine just make the class selection correct.

depending on visibility on the viewport video plays or pauses here;

1 Like

Thank you this works like a charm, I learned a new function IntersectionObserver, I love it.

1 Like