!function(i){OUVideo=function(t){this.id=t.id,this.type=t.type,this.aspectRatio=t.aspectRatio,this.lightbox=t.lightbox,this.overlay=t.overlay,this.comp=i("."+this.id),this.selector=t.selector,this._init()},OUVideo.prototype={_init:function(){this.lightbox?this._initLightbox():this.overlay&&this._inlinePlay()},_inlinePlay:function(){if(this.comp.find(".ou-video-iframe").length>0){var t=this.comp.find(".ou-video-iframe");t.is("[data-src]")?(t.attr("src",t.attr("data-src").replace("&autoplay=1","")),t.attr("src",t.attr("src").replace("autoplay=1",""))):(t.attr("src",t.attr("src").replace("&autoplay=1","")),t.attr("src",t.attr("src").replace("autoplay=1","")))}this.comp.find(".ou-video-image-overlay").on("click",i.proxy(function(){if(this.comp.find(".ou-video-image-overlay").fadeOut(800,function(){this.remove()}),this.comp.find(".ou-video-player").length>0)this.comp.find(".ou-video-player")[0].play();else{var i=this.comp.find(".ou-video-iframe").attr("src");i&&this.comp.find(".ou-video-iframe").attr("src",i);var t=this.comp.find(".ou-video-iframe")[0].src.replace("&autoplay=0",""),o=(t=t.replace("autoplay=0","")).split("#");t=o[0]+"&autoplay=1",void 0!==o[1]&&(t+="#"+o[1]),this.comp.find(".ou-video-iframe")[0].src=t}},this))},_initLightbox:function(){var t=this.id,o=this.selector,a={modal:!1,baseClass:"fancybox-"+t,buttons:["close"],wheel:!1,touch:!1,hideOnOverlayClick:!0,afterLoad:function(a,e){if(!i(".fancybox-"+t).find(".ou-video-player").length){i(".fancybox-"+t).addClass("fancybox"+o);var c=i(".fancybox-"+t).find(".ou-video-iframe")[0].src.replace("&autoplay=0",""),r=(c=c.replace("autoplay=0","")).split("#");c=r[0]+"&autoplay=1",void 0!==r[1]&&(c+="#"+r[1]),i(".fancybox-"+t).find(".ou-video-iframe")[0].src=c}}},e="ouv-ar-"+this.aspectRatio;this.comp.find(".ou-video-image-overlay").on("click",function(t){t.stopPropagation(),i.fancybox.open(i('<div class="'+e+' fancybox-content"></div>').html(i(this).find(".ou-video-lightbox-content").html()),a)})}}}(jQuery);