!function(e){jQuery.fn.QCslider=function(t){var i,a,l,d=jQuery(this),n={},r=1,s=0;function o(){var t=n.items.panel.eq(s);if(t.hasClass("video")){var a=t.attr("data-video"),d="player"+s,o=t.attr("data-muted"),v=t.attr("data-type");if("youtube"===v){t.html('<div class="include"><div id="'+d+'"></div></div>'),o="true"===o?1:0,i=new YT.Player(d,{videoId:a,playerVars:{allowfullscreen:!0,wmode:"transparent",cc_load_policy:0,iv_load_policy:0,modestbranding:0,theme:"white",origin:"https://www.youtube.com",disablekb:1,branding:0,autohide:0,showinfo:0,autoplay:1,controls:0,mute:o,border:0,html5:1,rel:0,fs:0},events:{onReady:function(e){"true"===o&&(e.target.mute(),e.target.setVolume(0));e.target.playVideo()},onStateChange:function(e){e.data===YT.PlayerState.PLAYING&&(l=setInterval(h,50));e.data==YT.PlayerState.ENDED&&(clearInterval(l),t.html('<div class="include"><div id="'+d+'"></div></div>'),u(r))}}});var p=n.items.panel.eq(s).width(),m=n.items.panel.eq(s).height();function h(){var t=i.playerInfo.currentTime/i.playerInfo.duration*100;e("#barra").width(t+"%")}i.setSize({width:p,height:m})}else if("video"===v){"true"===o?t.html('<div class="include"><video src="'+a+'" preload="auto" muted autoplay="true" poster="" id="'+d+'"></video></div>'):t.html('<div class="include"><video src="'+a+'" preload="auto" autoplay="true" poster="" id="'+d+'"></video></div>'),e("#"+d).bind("timeupdate",(function(){var t=e("#"+d)[0].currentTime/e("#"+d)[0].duration*100;e("#barra").width(t+"%")})),e("#"+d).on("ended",(function(){t.html(" "),e("#"+d).unbind("timeupdate"),u(r)}))}}else e("#barra").animate({width:"100%"},settings.duration,"linear",c)}function c(){e("#barra").css("width",0);var t=n.items.panel,i=e("#slider-controls li");r>=lengthSlider&&(r=0,s=lengthSlider-1),i.removeClass("active").eq(r).addClass("active"),t.eq(s).fadeOut("slow"),t.eq(r).fadeIn("slow"),s=r,r+=1,o()}function u(t){e("#barra").stop().css("width",0);var i=n.items.panel,a=e("#slider-controls li");n.items.panel.eq(s).hasClass("video")&&(vidp="player"+s,vtyp=n.items.panel.eq(s).attr("data-type"),"youtube"===vtyp?n.items.panel.eq(s).html('<div class="include"><div id="'+vidp+'"></div></div>'):"video"===vtyp&&n.items.panel.eq(s).html('<div class="include"></div>')),t>=lengthSlider?t=0:t<0&&(t=lengthSlider-1),a.removeClass("active").eq(t).addClass("active"),i.eq(s).fadeOut("slow"),i.eq(t).fadeIn("slow"),s=t,r=t+1,o()}return n.el=d,n.items={panel:n.el.find("li")},lengthSlider=n.items.panel.length,a={start:0,duration:8e3},settings=jQuery.extend(a,t),function(){var t="",i=document.createElement("script");i.src="https://www.youtube.com/iframe_api";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(i,a),o();for(var d=0;d<lengthSlider;d++)t+=0==d?'<li class="active"></li>':"<li></li>";e("#slider-controls").html(t).on("click","li",(function(t){var i=e(this);s!==i.index()&&u(i.index())})),e("#rht-control").on("click",(function(e){if("youtube"===n.items.panel.eq(s).attr("data-type")){clearInterval(l);var t=n.items.panel.eq(s);let e="player"+s;t.html('<div class="include"><div id="'+e+'"></div></div>')}u(r)})),e("#lft-control").on("click",(function(e){if("youtube"===n.items.panel.eq(s).attr("data-type")){clearInterval(l);var t=n.items.panel.eq(s);let e="player"+s;t.html('<div class="include"><div id="'+e+'"></div></div>')}u(s-1)}))}(),n}}(jQuery);