Logo v4.3.1
Image Description

No Results

  • Get Support
  • Preview Demo
Logo v4.3.1
  • Docs
  • Snippets
  • Documentation
  • Introduction
  • Getting started
  • Getting Started
  • Gulp
  • Customization
  • Credits
  • Changelog
  • Design & Graphics
  • Bootstrap Icons
  • Duotone Icons
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Spinners
  • Steps
  • Tab
  • Tables
  • Text Highlight
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Scrollspy
  • Basic forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • File Attachments
  • Drag’ n’ Drop File Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Input Mask
  • Step Forms (Wizards)
  • Range Slider (noUiSlider)
  • Add Field
  • Toggle Password
  • Count Characters
  • Toggle Switch
  • Toggle State
  • Switch
  • Media
  • Fullscreen Lightbox
  • Video Background
  • Video Player
  • Swiper
  • Others
  • Maps (Leaflet)
  • Chart.js
  • Circles.js (Pie Chart)
  • Sticky Block
  • Countdown
  • Sorting (Shuffle.js)
  • Go To
  • Show Animation
  • Typed.js
  • Utilities
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Rotations
  • Shadows
  • Sizing
  • Spacing
  • Z-index

Video Background

Creates responsive video or slideshow embeds based on the width of the parent by making an intrinsic ratio that scales on any device.

How to use

Copy-paste the stylesheet <link> into your <head> to load the CSS.

        
          <link rel="stylesheet" href="./assets/vendor/hs-video-bg/dist/hs-video-bg.min.css">
        
      

Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.

        
          <script src="./assets/vendor/hs-video-bg/dist/hs-video-bg.min.js"></script>
        
      

Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.

        
          <script>
            (function() {
              // INITIALIZATION OF VIDEO BACKGROUND
              // =======================================================
              $('.js-video-bg').each(function () {
                var videoBg = new HSVideoBg($(this)).init();
              });
            })()
          </script>
        
      

YouTube

  • Preview
  • HTML
              
                <!-- Video Bg -->
                <div class="video-bg">
                  <div class="js-video-bg video-bg-content"
                       data-hs-video-bg-options='{
                         "type": "you-tube",
                         "videoId": "d4eDWc8g0e0",
                         "ratio": 0.75
                       }'>
                  </div>
                </div>
                <!-- End Video Bg -->
              
            

Vimeo

  • Preview
  • HTML
              
                <!-- Video Bg -->
                <div class="video-bg">
                  <div class="js-video-bg video-bg-content"
                       data-hs-video-bg-options='{
                         "type": "vimeo",
                         "videoId": "412471131",
                         "ratio": 0.75
                       }'>
                  </div>
                </div>
                <!-- End Video Bg -->
              
            

HTML5

  • Preview
  • HTML
              
                <!-- Video Bg -->
                <div class="video-bg">
                  <div class="js-video-bg video-bg-content"
                       data-hs-video-bg-options='{
                         "videoId": "../assets/video/working-in-office"
                       }'>
                  </div>
                </div>
                <!-- End Video Bg -->
              
            

Methods

Parameters Description Default value

type

Type of video. Valid Values: you-tube, vimeo and default 'default'

videoId

For you-tube and vimeo video ID, for default - the relative path to the video files on the server null

isLoop

Determines whether the video will be played cyclically or once true

ratio

Determines the aspect ratio of the video 1.5