;(function($,window,document,navigator){"use strict";var pluginName="vide",defaults={volume:1,playbackRate:1,muted:true,loop:true,autoplay:true,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").load(onLoad);$("").load(onLoad);$("").load(onLoad);$("").load(onLoad);};function Vide(element,path,options){this.element=$(element);this._defaults=defaults;this._name=pluginName;if(typeof path==="string"){path=path.replace(/\.\w*$/,"");}else if(typeof path==="object"){for(var i in path){path[i]=path[i].replace(/\.\w*$/,"");}}this.settings=$.extend({},defaults,options);this.path=path;this.init();}Vide.prototype.init=function(){var that=this;this.wrapper=$("
");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});var poster=this.path;if(typeof this.path==="object"){if(this.path.poster){poster=this.path.poster;}else{if(this.path.mp4){poster=this.path.mp4;}else if(this.path.webm){poster=this.path.webm;}else if(this.path.ogv){poster=this.path.webm;}}}if(this.settings.posterType==="detect"){findPoster(poster,$.proxy(this.setPoster,this));}else{this.setPoster(poster+"."+this.settings.posterType);}if(this.element.css("position")==="static"){this.element.css("position","relative");}this.element.prepend(this.wrapper);if(!iOS&&!android){if(typeof this.path==="object"){var sources="";if(this.path.mp4){sources+="