If you have any questions that are beyond the scope of this help file, please feel free to email via email marcoscgdev@gmail.com.
If your page already has jquery included then you can skip this step.
<!-- Include jquery (required by this plugin) --> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
It has to be after the jquery plugin.
<!-- Change path/to with your custom js path --> <script type="text/javascript" src="path/to/yt-video-background.min.js"></script>
<!-- Change path/to with your custom css path --> <link rel="stylesheet" href="path/to/yt-video-background.min.css">
<div class="video-background"></div>
This plugin needs to be configured in order to use it. Configuration can be done by placing (and editing) the following code after the main javascript plugin insertion (see the step 2).
$('.video-background') is a reference to the previous created div.
<script type="text/javascript"> $('.video-background').youtubeBackground({ videoId: 'zofBinqC2F4', // Your desired YouTube video id backgroundColor: '#212121', // Overlay background color backgroundImage: 'https://i.ytimg.com/vi/ITpIv6Efz8Y/maxresdefault.jpg', // Background image for mobile devices because it does not support youtube video background opacity: 0.6 // Video opacity. Set to 1 if you do not want opacity }); </script>
See the demo page to clarify any queries you may have.