# Slider with video background

**URL:** <https://forum.bricksbuilder.io/t/slider-with-video-background/21974>\
**Category:** How To\
**Created:** [April 18, 2024, 3:34am UTC](https://forum.bricksbuilder.io/t/slider-with-video-background/21974 "2024-04-18T03:34:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sinanisler](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/sinanisler/32/34468_2.png) [@sinanisler](https://forum.bricksbuilder.io/u/sinanisler)\
**Post date:** [April 19, 2024, 9:02am UTC](https://forum.bricksbuilder.io/t/slider-with-video-background/21974/3 "2024-04-19T09:02:13Z")

</div>

that is a common problem for all builders 🙂

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;

> **[Automatic Video Play/Pause Based on Visibility › Sinan Isler | WordPress...](https://sinanisler.com/codex/automatic-video-play-pause-based-on-visibility/)**
>
> This JavaScript code automatically manages the play and pause state of videos on a webpage based on their visibility. When the webpage loads, it sets up an observer to monitor multiple videos inside elements with the class '.smallvideo'. The observer...

---

_[View the full topic](https://forum.bricksbuilder.io/t/slider-with-video-background/21974)._
