/
home
/
techb158
/
balacoffee.com
/
wp-content
/
plugins
/
coming-soon
/
public
/
js
/
/home/techb158/balacoffee.com/wp-content/plugins/coming-soon/public/js
mkdir
upload
Name
Size
Mode
Actions
animate-dynamic.js
19723
0644
edit
dl
rm
dynamic-text.js
33685
0644
edit
dl
rm
iframeResizer.contentWindow.js
34490
0644
edit
dl
rm
iframeResizer.contentWindow.min.js
13389
0644
edit
dl
rm
iframeResizer.js
32053
0644
edit
dl
rm
iframeResizer.min.js
12380
0644
edit
dl
rm
imagesloaded.pkgd.min.js
5594
0644
edit
dl
rm
img-previewer.js
23368
0644
edit
dl
rm
img-previewer.min.js
11271
0644
edit
dl
rm
isotope.pkgd.js
91398
0644
edit
dl
rm
jquery-numerator.js
4133
0644
edit
dl
rm
jquery-numerator.min.js
1906
0644
edit
dl
rm
jquery.animation.js
4940
0644
edit
dl
rm
jquery.animation.min.js
916
0644
edit
dl
rm
jquery.event.move.js
14530
0644
edit
dl
rm
jquery.lettering.js
1842
0644
edit
dl
rm
jquery.lettering.min.js
685
0644
edit
dl
rm
jquery.textillate.js
11188
0644
edit
dl
rm
jquery.textillate.min.js
5416
0644
edit
dl
rm
jquery.twentytwenty.js
5414
0644
edit
dl
rm
jquery.twentytwenty.min.js
5414
0644
edit
dl
rm
lightbox.js
20031
0644
edit
dl
rm
lightbox.min.js
10383
0644
edit
dl
rm
masonry.pkgd.js
63316
0644
edit
dl
rm
minimasonry.js
7493
0644
edit
dl
rm
sp-animateeffects.js
32333
0644
edit
dl
rm
sp-animateeffects.min.js
10720
0644
edit
dl
rm
sp-scripts.js
103407
0644
edit
dl
rm
sp-scripts.min.js
45640
0644
edit
dl
rm
toolbar.js
3660
0644
edit
dl
rm
tooltipster.bundle.min.js
39900
0644
edit
dl
rm
tsparticles.js
296710
0644
edit
dl
rm
tsparticles.min.js
140630
0644
edit
dl
rm
tubular.js
6974
0644
edit
dl
rm
xdLocalStorage.js
4439
0644
edit
dl
rm
Edit:
/home/techb158/balacoffee.com/wp-content/plugins/coming-soon/public/js/tubular.js
(6974B)
/* 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);
Save
cmd:
run