PHP Classes

File: public/public/modules/theme-business/js/vendor/jquery.vide.min.js

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   LaraCMS   public/public/modules/theme-business/js/vendor/jquery.vide.min.js   Download  
File: public/public/modules/theme-business/js/vendor/jquery.vide.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: LaraCMS
Content management system based on Laravel
Author: By
Last change:
Date: 2 years ago
Size: 4,476 bytes
 

Contents

Class file image Download
!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(e.jQuery)}(this,function(f){"use strict";var h="vide",n={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""},m="Not implemented";function s(e){for(var t,o,i,n,s={},r=e.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(","),a=0,p=r.length;a<p&&(-1===(o=r[a]).search(/^(http|https|ftp):\/\//)&&-1!==o.search(":"));a++)t=o.indexOf(":"),i=o.substring(0,t),"string"==typeof(n=(n=o.substring(t+1))||void 0)&&(n="true"===n||"false"!==n&&n),"string"==typeof n&&(n=isNaN(n)?n:+n),s[i]=n;return null==i&&null==n?e:s}function i(e,t,o){if(this.$element=f(e),"string"==typeof t&&(t=s(t)),o?"string"==typeof o&&(o=s(o)):o={},"string"==typeof t)t=t.replace(/\.\w*$/,"");else if("object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(t[i]=t[i].replace(/\.\w*$/,""));this.settings=f.extend({},n,o),this.path=t;try{this.init()}catch(e){if(e.message!==m)throw e}}i.prototype.init=function(){var e,t,o,i,n=this,s=n.path,r=s,a="",p=n.$element,c=n.settings,d=function(e){for(var t,o=(e=""+e).split(/\s+/),i="50%",n="50%",s=0,r=o.length;s<r;s++)"left"===(t=o[s])?i="0%":"right"===t?i="100%":"top"===t?n="0%":"bottom"===t?n="100%":"center"===t?0===s?i="50%":n="50%":0===s?i=t:n=t;return{x:i,y:n}}(c.position),u=c.posterType;function l(){i(this.src)}t=n.$wrapper=f("<div>").addClass(c.className).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-color":c.bgColor,"background-repeat":"no-repeat","background-position":d.x+" "+d.y}),"object"==typeof s&&(s.poster?r=s.poster:s.mp4?r=s.mp4:s.webm?r=s.webm:s.ogv&&(r=s.ogv)),"detect"===u?(i=function(e){t.css("background-image","url("+e+")")},f('<img src="'+(o=r)+'.gif">').on("load",l),f('<img src="'+o+'.jpg">').on("load",l),f('<img src="'+o+'.jpeg">').on("load",l),f('<img src="'+o+'.png">').on("load",l)):"none"!==u&&t.css("background-image","url("+r+"."+u+")"),"static"===p.css("position")&&p.css("position","relative"),p.prepend(t),e="object"==typeof s?(s.mp4&&(a+='<source src="'+s.mp4+'.mp4" type="video/mp4">'),s.webm&&(a+='<source src="'+s.webm+'.webm" type="video/webm">'),s.ogv&&(a+='<source src="'+s.ogv+'.ogv" type="video/ogg">'),n.$video=f("<video>"+a+"</video>")):n.$video=f('<video><source src="'+s+'.mp4" type="video/mp4"><source src="'+s+'.webm" type="video/webm"><source src="'+s+'.ogv" type="video/ogg"></video>');try{e.prop({autoplay:c.autoplay,loop:c.loop,volume:c.volume,muted:c.muted,defaultMuted:c.muted,playbackRate:c.playbackRate,defaultPlaybackRate:c.playbackRate,playsInline:!0})}catch(e){throw new Error(m)}e.css({margin:"auto",position:"absolute","z-index":-1,top:d.y,left:d.x,"-webkit-transform":"translate(-"+d.x+", -"+d.y+")","-ms-transform":"translate(-"+d.x+", -"+d.y+")","-moz-transform":"translate(-"+d.x+", -"+d.y+")",transform:"translate(-"+d.x+", -"+d.y+")",visibility:"hidden",opacity:0}).on("canplaythrough."+h,function(){n.resize()}).on("playing."+h,function(){e.css({visibility:"visible",opacity:1}),t.css("background-image","none")});var g=window.navigator.userAgent;(g.match(/iPad/i)||g.match(/iPhone/i))&&c.autoplay&&1==c.muted&&(e.css({visibility:"visible",opacity:1}),t.css("background-image","none")),p.on("resize."+h,function(){c.resizing&&n.resize()}),t.append(e)},i.prototype.getVideoObject=function(){return this.$video[0]},i.prototype.resize=function(){var e,t,o,i,n,s,r;this.$video&&(e=this.$wrapper,i=(o=(t=this.$video)[0]).videoHeight,n=o.videoWidth,(s=e.height())/i<(r=e.width())/n?t.css({width:r+2,height:"auto"}):t.css({width:"auto",height:s+2}))},i.prototype.destroy=function(){delete f[h].lookup[this.index],this.$video&&this.$video.off(h),this.$element.off(h).removeData(h),this.$wrapper.remove()},f[h]={lookup:[]},f.fn[h]=function(e,t){var o;return this.each(function(){(o=f.data(this,h))&&o.destroy(),(o=new i(this,e,t)).index=f[h].lookup.push(o)-1,f.data(this,h,o)}),this},f(document).ready(function(){var e=f(window);e.on("resize."+h,function(){for(var e,t=f[h].lookup.length,o=0;o<t;o++)(e=f[h].lookup[o])&&e.settings.resizing&&e.resize()}),e.on("unload."+h,function(){return!1}),f(document).find("[data-vide-bg]").each(function(e,t){var o=f(t),i=o.data(h+"-options"),n=o.data(h+"-bg");o[h](n,i)})})});