Download
User Rating: 4/5 ( 1 votes)
jQuery tubular is a jQuery plugin that lets you set a YouTube video as your page background. Just attach it to your page wrapper element, set some options, and you're on your way.
Tubular does one thing well. It takes a single video from YouTube at injects it as a full-screen background on a website. It scales the video, offsets the video and provides some basic controls for the video.
Source: seanmccambridge.com
1. INCLUDE JS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.tubular.1.0.js"></script>
2. JAVASCRIPT
$().ready(function() {
$('#wrapper').tubular({videoId: 'idOfYourVideo'}); // where idOfYourVideo is the YouTube ID.
});
3. OPTIONS
-
ratio: 16/9 // usually either 4/3 or 16/9 -- tweak as needed
-
videoId: 'ZCAnLxRvNNc' // toy robot in space is a good default, no?
-
mute: true
-
repeat: true
-
width: $(window).width() // no need to override
-
wrapperZIndex: 99
-
playButtonClass: 'tubular-play'
-
pauseButtonClass: 'tubular-pause'
-
muteButtonClass: 'tubular-mute'
-
volumeUpClass: 'tubular-volume-up'
-
volumeDownClass: 'tubular-volume-down'
-
increaseVolumeBy: 10 // increment value; volume range is 1-100
-
start: 0 // starting position in seconds