Documentation | v1.0
YouTube Video Background Documentation


If you have any questions that are beyond the scope of this help file, please feel free to email via email marcoscgdev@gmail.com.


Installation

Step 1. Include jquery (insert into your page's head tag)

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>
		

Step 2. Include the plugin javascript file

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>
		

Step 3. Include the plugin stylesheet file

			<!-- Change path/to with your custom css path -->
			<link rel="stylesheet" href="path/to/yt-video-background.min.css">
		

Configuration

Step 1. Place an empty div where you want the background

	<div class="video-background"></div>

Step 2. Configure the background

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.

And... That's all!