Youtube Video Background With Mobile Fallback - yt-video-background.js

File Size: 15.5 KB
Views Total: 2606
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Youtube Video Background With Mobile Fallback - yt-video-background.js

Yet another jQuery based Youtube video background plugin with a graceful fallback to a specified background image on mobile devices.

See also:

How to use it:

1. Load the stylesheet yt-video-background.css for the basic styling of the Youtube video background.

<link rel="stylesheet" href="dist/css/yt-video-background.min.css">

2. Load jQuery JavaScript library and the JavaScript yt-video-background.js at the end of the document.

<script src="" 
<script src="dist/js/yt-video-background.min.js"></script>

3. Create a container to hold the Youtube video player.

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

4. Call the function youtubeBackground on the container element and specify the Youtube ID. Done.

  videoId: 'yxGXmjAkE5M'

5. Customize the color of the background overlay.

  backgroundColor: '#000000'

6. Customize the opacity of the Youtube video.

  opacity: 0.7

7. Specify the path to the fallback image when you run the script on mobile devices.

  backgroundImage: 'bg.jpg'

This awesome jQuery plugin is developed by marcoscgdev. For more Advanced Usages, please check the demo page or visit the official website.