PageSourceSearch

https://www.superiorinstall.net/javascripts/jquery.vide.js?v=2

js superiorinstall.net collected 2026-10-08 07:42:26 UTC 6,592 bytes, 24 lines download raw bytes

1if(typeof loaded1a1d55f35153a7b4f664130a01d20e9c=="undefined"){var loaded1a1d55f35153a7b4f664130a01d20e9c=!0;!(function(root,factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){factory(require('jquery'))}else{factory(root.jQuery)}})(this,function($){'use strict';var PLUGIN_NAME='vide';var DEFAULTS={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:'50% 50%',posterType:'detect',resizing:!0,bgColor:'transparent',className:''};var NOT_IMPLEMENTED_MSG='Not implemented';function parseOptions(str){var obj={};var delimiterIndex;var option;var prop;var val;var arr;var len;var i;arr=str.replace(/\s*:\s*/g,':').replace(/\s*,\s*/g,',').split(',');for(i=0,len=arr.length;i<len;i++){option=arr[i];if(option.search(/^(http|https|ftp):\/\//)!==-1||option.search(':')===-1){break}
2delimiterIndex=option.indexOf(':');prop=option.substring(0,delimiterIndex);val=option.substring(delimiterIndex+1);if(!val){val=undefined}
3if(typeof val==='string'){val=val==='true'||(val==='false'?!1:val)}
4if(typeof val==='string'){val=!isNaN(val)?+val:val}
5obj[prop]=val}
6if(prop==null&&val==null){return str}
7return obj}
8function parsePosition(str){str=''+str;var args=str.split(/\s+/);var x='50%';var y='50%';var len;var arg;var i;for(i=0,len=args.length;i<len;i++){arg=args[i];if(arg==='left'){x='0%'}else if(arg==='right'){x='100%'}else if(arg==='top'){y='0%'}else if(arg==='bottom'){y='100%'}else if(arg==='center'){if(i===0){x='50%'}else{y='50%'}}else{if(i===0){x=arg}else{y=arg}}}
9return{x:x,y:y}}
10function findPoster(path,callback){var onLoad=function(){callback(this.src)};$('<img src="'+path+'.gif">').on('load',onLoad);$('<img src="'+path+'.jpg">').on('load',onLoad);$('<img src="'+path+'.jpeg">').on('load',onLoad);$('<img src="'+path+'.png">').on('load',onLoad)}
11function Vide(element,path,options){this.$element=$(element);if(typeof path==='string'){path=parseOptions(path)}
12if(!options){options={}}else if(typeof options==='string'){options=parseOptions(options)}
13if(typeof path==='string'){path=path.replace(/\.\w*$/,'')}else if(typeof path==='object'){for(var i in path){if(path.hasOwnProperty(i)){path[i]=path[i].replace(/\.\w*$/,'')}}}
14this.settings=$.extend({},DEFAULTS,options);this.path=path;try{this.init()}catch(e){if(e.message!==NOT_IMPLEMENTED_MSG){throw e}}}
15Vide.prototype.init=function(){var vide=this;var path=vide.path;var poster=path;var sources='';var $element=vide.$element;var settings=vide.settings;var position=parsePosition(settings.position);var posterType=settings.posterType;var $video;var $wrapper;$wrapper=vide.$wrapper=$('<div>').addClass(settings.className).css({position:'absolute','z-index':-1,top:0,left:0,bottom:0,right:0,overflow:'hidden','background-color':settings.bgColor}).prepend('<div class="poster" style="position:absolute;top:0;left:0;right:0;bottom:0;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;background-repeat: no-repeat;background-position:'+position.x+' '+position.y+';opacity:'+settings.opacity+';z-index:-2;"></div>');if(typeof path==='object'){if(path.poster){poster=path.poster}else{if(path.mp4){poster=path.mp4}else if(path.webm){poster=path.webm}else if(path.ogv){poster=path.ogv}}}
16if(posterType==='detect'){findPoster(poster,function(url){$wrapper.find(".poster").css('background-image','url('+url+')')})}else if(posterType!=='none'){$wrapper.find(".poster").css('background-image','url('+poster+'.'+posterType+')')}
17if($element.css('position')==='static'){$element.css('position','relative')}
18$element.prepend($wrapper);if(typeof path==='object'){if(path.mp4){sources+='<source src="'+path.mp4+'.mp4" type="video/mp4">'}
19if(path.webm){sources+='<source src="'+path.webm+'.webm" type="video/webm">'}
20if(path.ogv){sources+='<source src="'+path.ogv+'.ogv" type="video/ogg">'}
21$video=vide.$video=$('<video playsinline>'+sources+'</video>')}else{$video=vide.$video=$('<video playsinline>'+'<source src="'+path+'.mp4" type="video/mp4">'+'<source src="'+path+'.webm" type="video/webm">'+'<source src="'+path+'.ogv" type="video/ogg">'+'</video>')}
21
22try{$video.prop({autoplay:settings.autoplay,loop:settings.loop,volume:settings.volume,muted:settings.muted,defaultMuted:settings.muted,playbackRate:settings.playbackRate,defaultPlaybackRate:settings.playbackRate})}catch(e){throw new Error(NOT_IMPLEMENTED_MSG)}
23$video.css({margin:'auto',position:'absolute','z-index':-1,top:position.y,left:position.x,'-webkit-transform':'translate(-'+position.x+', -'+position.y+')','-ms-transform':'translate(-'+position.x+', -'+position.y+')','-moz-transform':'translate(-'+position.x+', -'+position.y+')',transform:'translate(-'+position.x+', -'+position.y+')',opacity:0}).one('canplaythrough.'+PLUGIN_NAME,function(){vide.resize()}).one('playing.'+PLUGIN_NAME,function(){$video.css({visibility:'visible',opacity:settings.opacity});$wrapper.find(".poster").css('background-image','none')});$element.on('resize.'+PLUGIN_NAME,function(){if(settings.resizing){vide.resize()}});$wrapper.append($video)};Vide.prototype.getVideoObject=function(){return this.$video[0]};Vide.prototype.resize=function(){if(!this.$video){return}
24var $wrapper=this.$wrapper;var $video=this.$video;var video=$video[0];var videoHeight=video.videoHeight;var videoWidth=video.videoWidth;var wrapperHeight=$wrapper.height();var wrapperWidth=$wrapper.width();if(wrapperWidth/videoWidth>wrapperHeight/videoHeight){$video.css({width:wrapperWidth+2,height:'auto'})}else{$video.css({width:'auto',height:wrapperHeight+2})}};Vide.prototype.destroy=function(){delete $[PLUGIN_NAME].lookup[this.index];this.$video&&this.$video.off(PLUGIN_NAME);this.$element.off(PLUGIN_NAME).removeData(PLUGIN_NAME);this.$wrapper.remove()};$[PLUGIN_NAME]={lookup:[]};$.fn[PLUGIN_NAME]=function(path,options){var instance;this.each(function(){instance=$.data(this,PLUGIN_NAME);instance&&instance.destroy();instance=new Vide(this,path,options);instance.index=$[PLUGIN_NAME].lookup.push(instance)-1;$.data(this,PLUGIN_NAME,instance)});return this};$(document).ready(function(){var $window=$(window);$window.on('resize.'+PLUGIN_NAME,function(){for(var len=$[PLUGIN_NAME].lookup.length,i=0,instance;i<len;i++){instance=$[PLUGIN_NAME].lookup[i];if(instance&&instance.settings.resizing){instance.resize()}}});$window.on('unload.'+PLUGIN_NAME,function(){return!1});$(document).find('[data-'+PLUGIN_NAME+'-bg]').each(function(i,element){var $element=$(element);var options=$element.data(PLUGIN_NAME+'-options');var path=$element.data(PLUGIN_NAME+'-bg');$element[PLUGIN_NAME](path,options)})})})}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.