1(function($,window,document,navigator){"use strict";var pluginName="vide",defaults={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect"};var iOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),android=/Android/i.test(navigator.userAgent);$[pluginName]={lookup:[]};var parseOptions=function(str){var obj={},clearedStr,arr;clearedStr=str.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",");arr=clearedStr.split(",");var i,len,val;for(i=0,len=arr.length;i<len;i++){arr[i]=arr[i].split(":");val=arr[i][1];if(!val){val=undefined} 2if(typeof val==="string"||val instanceof String){val=val==="true"||(val==="false"?!1:val)} 3if(typeof val==="string"||val instanceof String){val=!isNaN(val)?+val:val} 4obj[arr[i][0]]=val} 5return obj};var parsePosition=function(str){str=""+str;var args=str.split(/\s+/),x="50%",y="50%";for(var i=0,len=args.length,arg;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}}} 6return{x:x,y:y}};var findPoster=function(path,callback){var onLoad=function(){callback(this.src)};$("<img src='"+path+".gif'>").load(onLoad);$("<img src='"+path+".jpg'>").load(onLoad);$("<img src='"+path+".jpeg'>").load(onLoad);$("<img src='"+path+".png'>").load(onLoad)};function Vide(element,path,options){this.element=$(element);this._defaults=defaults;this._name=pluginName;path=path.replace(/\.\w*$/,"");this.settings=$.extend({},defaults,options);this.path=path;this.init()} 7Vide.prototype.init=function(){var that=this;this.wrapper=$("<div>");var position=parsePosition(this.settings.position);this.wrapper.css({"position":"absolute","z-index":-1,"top":0,"left":0,"bottom":0,"right":0,"overflow":"hidden","-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});if(this.settings.posterType==="detect"){findPoster(this.path,function(url){that.wrapper.css("background-image","url("+url+")")})}else{this.wrapper.css("background-image","url("+this.path+"."+this.settings.posterType+")")} 8if(this.element.css("position")==="static"){this.element.css("position","relative")} 9this.element.prepend(this.wrapper);if(!iOS&&!android){this.video=$("<video>"+"<source src='"+this.path+".mp4' type='video/mp4'>"+"<source src='"+this.path+".webm' type='video/webm'>"+"<source src='"+this.path+".ogv' type='video/ogg'>"+"</video>");this.video.css("visibility","hidden");this.video.prop({autoplay:this.settings.autoplay,loop:this.settings.loop,volume:this.settings.volume,muted:this.settings.muted,playbackRate:this.settings.playbackRate});this.wrapper.append(this.video);this.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+")","transform":"translate(-"+position.x+", -"+position.y+")"});this.video.bind("loadedmetadata."+pluginName,function(){that.video.css("visibility","visible");that.resize()});$(this.element).bind("resize."+pluginName,function(){that.resize()})}};Vide.prototype.getVideoObject=function(){return this.video?this.video[0]:null};Vide.prototype.resize=function(){if(!this.video){return} 10var videoHeight=this.video[0].videoHeight,videoWidth=this.video[0].videoWidth;var wrapperHeight=this.wrapper.height(),wrapperWidth=this.wrapper.width();if(wrapperWidth/videoWidth>wrapperHeight/videoHeight){this.video.css({"width":wrapperWidth+2,"height":"auto"})}else{this.video.css({"width":"auto","height":wrapperHeight+2})}};Vide.prototype.destroy=function(){this.element.unbind(pluginName);if(this.video){this.video.unbind(pluginName)} 11delete $[pluginName].lookup[this.index];this.element.removeData(pluginName);this.wrapper.remove()};$.fn[pluginName]=function(path,options){var instance;this.each(function(){instance=$.data(this,pluginName);if(instance){instance.destroy()} 12instance=new Vide(this,path,options);instance.index=$[pluginName].lookup.push(instance)-1;$.data(this,pluginName,instance)});return this};$(document).ready(function(){$(window).bind("resize."+pluginName,function(){for(var len=$[pluginName].lookup.length,instance,i=0;i<len;i++){instance=$[pluginName].lookup[i];if(instance){instance.resize()}}});$(document).find("[data-"+pluginName+"-bg]").each(function(i,element){var $element=$(element),options=$element.data(pluginName+"-options"),path=$element.data(pluginName+"-bg");if(!options){options={}}else{options=parseOptions(options)} 13$element[pluginName](path,options)})})})(window.jQuery,window,document,navigator)
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.