Video

Bootstrap Video

Bootstrap's video gallery is a component that compiles a number of media into one interactive collection presented in a basic or a more advanced lightbox.

It can be resized as desired, and thanks to Bootstrap's responsiveness, it will adjust to the screen size.

Examples of Bootstrap video use:

  • Trip video on a travel blog
  • Company promotional video as background

See the following Bootstrap video examples:

Note: This documentation is for an older version of Bootstrap (v.4). A newer version is available for Bootstrap 5. We recommend migrating to the latest version of our product - Material Design for Bootstrap 5.
Go to docs v.5


Responsive video

        
            

        <!-- 21:9 aspect ratio -->
        <div class="embed-responsive embed-responsive-21by9">
          <iframe class="embed-responsive-item" src="..."></iframe>
        </div>

        <!-- 16:9 aspect ratio -->
        <div class="embed-responsive embed-responsive-16by9">
          <iframe class="embed-responsive-item" src="..."></iframe>
        </div>

        <!-- 4:3 aspect ratio -->
        <div class="embed-responsive embed-responsive-4by3">
          <iframe class="embed-responsive-item" src="..."></iframe>
        </div>

        <!-- 1:1 aspect ratio -->
        <div class="embed-responsive embed-responsive-1by1">
          <iframe class="embed-responsive-item" src="..."></iframe>
        </div>

      
        
    

Video IFrame

YouTube IFrame

Vimeo IFrame

        
            

        <div class="embed-responsive embed-responsive-16by9">
          <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/v64KOxKVLVg" allowfullscreen></iframe>
        </div>

        <div class="embed-responsive embed-responsive-16by9">
          <iframe class="embed-responsive-item" src="https://player.vimeo.com/video/137857207" allowfullscreen></iframe>
        </div>

      
        
    



Full page video carousel

Click the button below to see a live preview.

Full Video Carousel

Video background MDB Pro component

Click the image below to see a live preview.

        
            

        <html lang="en" class="full-height">

        [ . . . ]

        <!--Main Navigation-->
        <header>

          <!--Navbar-->
          <nav class="navbar navbar-expand-lg navbar-dark fixed-top scrolling-navbar">
            <div class="container">
              <a class="navbar-brand" href="#"><strong>MDB</strong></a>
              <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent-7"
                aria-controls="navbarSupportedContent-7" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
              </button>
              <div class="collapse navbar-collapse" id="navbarSupportedContent-7">
                <ul class="navbar-nav mr-auto">
                  <li class="nav-item active">
                    <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="#">Link</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="#">Profile</a>
                  </li>
                </ul>
                <form class="form-inline">
                  <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
                </form>
              </div>
            </div>
          </nav>

          <!--Intro Section-->
          <section class="view intro-video">
            <video poster="https://mdbootstrap.com/img/Photos/Others/background.webp" playsinline autoplay muted loop>
              <source src="https://mdbootstrap.com/img/video/animation.mp4" type="video/mp4">
            </video>
            <div class="hm-gradient">
              <div class="full-bg-img">
                <div class="container flex-center">
                  <div class="row pt-5 mt-3">
                    <div class="col-lg-6 wow fadeIn mb-5 text-center text-lg-left">
                      <div class="white-text">
                        <h1 class="h1-responsive font-weight-bold wow fadeInLeft" data-wow-delay="0.3s">Lorem ipsum
                          dolor sit amet</h1>
                        <hr class="hr-light wow fadeInLeft" data-wow-delay="0.3s">
                        <p class="wow fadeInLeft" data-wow-delay="0.3s">Lorem ipsum dolor sit amet, consectetur
                          adipisicing elit. Rem repellendus quasi fuga nesciunt dolorum nulla magnam veniam sapiente,
                          fugiat! Commodi sequi non animi ea dolor molestiae, quisquam iste, maiores. Nulla.</p>
                        <br>
                        <a class="btn btn-outline-white wow fadeInLeft" data-wow-delay="0.3s">Just do it!</a>
                      </div>
                    </div>

                    <div class="col-lg-6 wow fadeIn">
                      <div class="embed-responsive embed-responsive-16by9 wow fadeInRight">
                        <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/IQyauRAxvjI"
                          allowfullscreen></iframe>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>

        </header>
        <!--Main Navigation-->

      
        
    
        
            

          .top-nav-collapse {
            background-color: #7d8488 !important;
        }
        .navbar:not(.top-nav-collapse) {
            background: transparent !important;
        }
        @media (max-width: 768px) {
            .navbar:not(.top-nav-collapse) {
                background: #7d8488 !important;
            }
        }
        .hm-gradient .full-bg-img {
            background: -moz-linear-gradient(45deg, rgba(242, 34, 50, 0.5), rgba(255, 187, 54, 0.6) 100%);
            background: -webkit-linear-gradient(45deg, rgba(242, 34, 50, 0.5), rgba(255, 187, 54, 0.6) 100%);
            background: linear-gradient(to 45deg, rgba(29, 236, 197, 0.4), rgba(96, 0, 136, 0.4) 100%);
        }
        @media (max-width: 740px) {
            .full-height,
            .full-height body,
            .full-height header,
            .full-height header .view {
                height: 700px;
            }
        }
      
        
    

Video with autoplay option

You can use any of webm ogv mp4 video formats within your HTML file.

Autoplay in Google Chrome

If you want to use a video with the autoplay option in Chrome you need to add muted in the video tag because Google Chrome block autoplay video with sound (even if it doesn't have any sound).

        
            

          <video class="video-fluid z-depth-1" autoplay loop controls muted>
            <source src="https://mdbootstrap.com/img/video/Sail-Away.mp4" type="video/mp4" />
          </video>

        
        
    
        
            

          .video-fluid {
            width: 100%;
            height: auto;
          }