/******************************************** * revolution 5.4.2 extension - video functions * @version: 2.1.6 (15.05.2017) * @requires jquery.themepunch.revolution.js * @author themepunch *********************************************/ !function(a){"use strict";function f(a){return void 0==a?-1:jquery.isnumeric(a)?a:a.split(":").length>1?60*parseint(a.split(":")[0],0)+parseint(a.split(":")[1],0):a}var b=jquery.fn.revolution,c=b.is_mobile(),d=b.is_android(),e={alias:"video min js",name:"revolution.extensions.video.min.js",min_core:"5.4.5",version:"2.1.6"};jquery.extend(!0,b,{preloadaudio:function(a,c){if("stop"===b.compare_version(e).check)return!1;a.find(".tp-audiolayer").each(function(){var a=jquery(this),d={};0===a.find("audio").length&&(d.src=void 0!=a.data("videomp4")?a.data("videomp4"):"",d.pre=a.data("videopreload")||"",void 0===a.attr("id")&&a.attr("audio-layer-"+math.round(199999*math.random())),d.id=a.attr("id"),d.status="prepared",d.start=jquery.now(),d.waittime=1e3*a.data("videopreloadwait")||5e3,"auto"!=d.pre&&"canplaythrough"!=d.pre&&"canplay"!=d.pre&&"progress"!=d.pre||(void 0===c.audioqueue&&(c.audioqueue=[]),c.audioqueue.push(d),b.managevideolayer(a,c)))})},preloadaudiodone:function(a,b,c){b.audioqueue&&b.audioqueue.length>0&&jquery.each(b.audioqueue,function(b,d){a.data("videomp4")!==d.src||d.pre!==c&&"auto"!==d.pre||(d.status="loaded")})},resetvideo:function(a,d,e){var g=a.data();switch(g.videotype){case"youtube":g.player;try{if("on"==g.forcerewind){var i=f(a.data("videostartat"));1===g.bgvideo||a.find(".tp-videoposter").length;void 0!=g.player&&(i=-1==i?0:i,g.player.seekto(i),g.player.pausevideo())}}catch(a){}0==a.find(".tp-videoposter").length&&1!==g.bgvideo&&!0!==e&&punchgs.tweenlite.to(a.find("iframe"),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout});break;case"vimeo":var l=$f(a.find("iframe").attr("id"));try{if("on"==g.forcerewind){var i=f(g.videostartat);1===g.bgvideo||a.find(".tp-videoposter").length;i=-1==i?0:i,l.api("seekto",i),l.api("pause")}}catch(a){}0==a.find(".tp-videoposter").length&&1!==g.bgvideo&&!0!==e&&punchgs.tweenlite.to(a.find("iframe"),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout});break;case"html5":if(c&&1==g.disablevideoonmobile)return!1;var n="html5"==g.audio?"audio":"video",o=a.find(n),p=o[0];if(punchgs.tweenlite.to(o,.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout}),"on"==g.forcerewind&&!a.hasclass("videoisplaying"))try{var i=f(g.videostartat);p.currenttime=-1==i?0:i}catch(a){}("mute"==g.volume||b.lasttogglestate(a.videomutetoggledby)||!0===d.globalmute)&&(p.muted=!0)}},isvideomuted:function(a,b){var c=!1,d=a.data();switch(d.videotype){case"youtube":try{c=d.player.ismuted()}catch(a){}break;case"vimeo":try{$f(a.find("iframe").attr("id"));"mute"==d.volume&&(c=!0)}catch(a){}break;case"html5":var g="html5"==d.audio?"audio":"video";a.find(g)[0].muted&&(c=!0)}return c},mutevideo:function(a,b){var c=a.data();switch(c.videotype){case"youtube":try{c.player.mute()}catch(a){}break;case"vimeo":try{var e=$f(a.find("iframe").attr("id"));a.data("volume","mute"),e.api("setvolume",0)}catch(a){}break;case"html5":var f="html5"==c.audio?"audio":"video";a.find(f)[0].muted=!0}},unmutevideo:function(a,b){if(!0!==b.globalmute){var c=a.data();switch(c.videotype){case"youtube":try{c.player.unmute()}catch(a){}break;case"vimeo":try{var e=$f(a.find("iframe").attr("id"));a.data("volume","1"),e.api("setvolume",1)}catch(a){}break;case"html5":var f="html5"==c.audio?"audio":"video";a.find(f)[0].muted=!1}}},stopvideo:function(a,b){var c=a.data();switch(b.leaveviewportbasedstop||(b.lastplayedvideos=[]),b.leaveviewportbasedstop=!1,c.videotype){case"youtube":try{var d=c.player;if(2===d.getplayerstate()||5===d.getplayerstate())return;d.pausevideo(),c.youtubepausecalled=!0,settimeout(function(){c.youtubepausecalled=!1},80)}catch(a){console.log("issue at youtube video pause:"),console.log(a)}break;case"vimeo":try{$f(a.find("iframe").attr("id")).api("pause"),c.vimeopausecalled=!0,settimeout(function(){c.vimeopausecalled=!1},80)}catch(a){console.log("issue at vimeo video pause:"),console.log(a)}break;case"html5":var f="html5"==c.audio?"audio":"video",g=a.find(f),h=g[0];void 0!=g&&void 0!=h&&h.pause()}},playvideo:function(a,c){cleartimeout(a.data("videoplaywait"));var d=a.data();switch(d.videotype){case"youtube":if(0==a.find("iframe").length)a.append(a.data("videomarkup")),i(a,c,!0);else if(void 0!=d.player.playvideo){var e=f(a.data("videostartat")),h=d.player.getcurrenttime();1==a.data("nextslideatend-triggered")&&(h=-1,a.data("nextslideatend-triggered",0)),-1!=e&&e>h&&d.player.seekto(e),!0!==d.youtubepausecalled&&d.player.playvideo()}else a.data("videoplaywait",settimeout(function(){!0!==d.youtubepausecalled&&b.playvideo(a,c)},50));break;case"vimeo":if(0==a.find("iframe").length)a.append(a.data("videomarkup")),i(a,c,!0);else if(a.hasclass("rs-apiready")){var j=a.find("iframe").attr("id"),k=$f(j);void 0==k.api("play")?a.data("videoplaywait",settimeout(function(){!0!==d.vimeopausecalled&&b.playvideo(a,c)},50)):settimeout(function(){k.api("play");var b=f(a.data("videostartat")),c=a.data("currenttime");1==a.data("nextslideatend-triggered")&&(c=-1,a.data("nextslideatend-triggered",0)),-1!=b&&b>c&&k.api("seekto",b)},510)}else a.data("videoplaywait",settimeout(function(){!0!==d.vimeopausecalled&&b.playvideo(a,c)},50));break;case"html5":var l="html5"==d.audio?"audio":"video",m=a.find(l),n=m[0];if(1!=m.parent().data("metaloaded"))g(n,"loadedmetadata",function(a){b.resetvideo(a,c),n.play();var d=f(a.data("videostartat")),e=n.currenttime;1==a.data("nextslideatend-triggered")&&(e=-1,a.data("nextslideatend-triggered",0)),-1!=d&&d>e&&(n.currenttime=d)}(a));else{n.play();var e=f(a.data("videostartat")),h=n.currenttime;1==a.data("nextslideatend-triggered")&&(h=-1,a.data("nextslideatend-triggered",0)),-1!=e&&e>h&&(n.currenttime=e)}}},isvideoplaying:function(a,b){var c=!1;return void 0!=b.playingvideos&&jquery.each(b.playingvideos,function(b,d){a.attr("id")==d.attr("id")&&(c=!0)}),c},removemediafromlist:function(a,b){n(a,b)},preparecoveredvideo:function(a,c,d){var e=d.find("iframe, video"),f=a.split(":")[0],g=a.split(":")[1],h=d.closest(".tp-revslider-slidesli"),i=h.width()/h.height(),j=f/g,k=i/j*100,l=j/i*100;i>j?punchgs.tweenlite.to(e,.001,{height:k+"%",width:"100%",top:-(k-100)/2+"%",left:"0px",position:"absolute"}):punchgs.tweenlite.to(e,.001,{width:l+"%",height:"100%",left:-(l-100)/2+"%",top:"0px",position:"absolute"}),e.hasclass("resizelistener")||(e.addclass("resizelistener"),jquery(window).resize(function(){cleartimeout(e.data("resizelistener")),e.data("resizelistener",settimeout(function(){b.preparecoveredvideo(a,c,d)},30))}))},checkvideoapis:function(a,b,c){location.protocol;if((void 0!=a.data("ytid")||a.find("iframe").length>0&&a.find("iframe").attr("src").tolowercase().indexof("youtube")>0)&&(b.youtubeapineeded=!0),(void 0!=a.data("ytid")||a.find("iframe").length>0&&a.find("iframe").attr("src").tolowercase().indexof("youtube")>0)&&0==c.addedyt){b.youtubestarttime=jquery.now(),c.addedyt=1;var e=document.createelement("script");e.src="https://www.youtube.com/iframe_api";var f=document.getelementsbytagname("script")[0],g=!0;jquery("head").find("*").each(function(){"https://www.youtube.com/iframe_api"==jquery(this).attr("src")&&(g=!1)}),g&&f.parentnode.insertbefore(e,f)}if((void 0!=a.data("vimeoid")||a.find("iframe").length>0&&a.find("iframe").attr("src").tolowercase().indexof("vimeo")>0)&&(b.vimeoapineeded=!0),(void 0!=a.data("vimeoid")||a.find("iframe").length>0&&a.find("iframe").attr("src").tolowercase().indexof("vimeo")>0)&&0==c.addedvim){b.vimeostarttime=jquery.now(),c.addedvim=1;var h=document.createelement("script"),f=document.getelementsbytagname("script")[0],g=!0;h.src="https://secure-a.vimeocdn.com/js/froogaloop2.min.js",jquery("head").find("*").each(function(){"https://secure-a.vimeocdn.com/js/froogaloop2.min.js"==jquery(this).attr("src")&&(g=!1)}),g&&f.parentnode.insertbefore(h,f)}return c},managevideolayer:function(a,d,h,j){if("stop"===b.compare_version(e).check)return!1;var k=a.data(),m=k.videoattributes,n=k.ytid,o=k.vimeoid,p="auto"===k.videopreload||"canplay"===k.videopreload||"canplaythrough"===k.videopreload||"progress"===k.videopreload?"auto":k.videopreload,q=k.videomp4,r=k.videowebm,s=k.videoogv,t=k.allowfullscreenvideo,u=k.videocontrols,v="http",w="loop"==k.videoloop?"loop":"loopandnoslidestop"==k.videoloop?"loop":"",x=void 0!=q||void 0!=r?"html5":void 0!=n&&string(n).length>1?"youtube":void 0!=o&&string(o).length>1?"vimeo":"none",y="html5"==k.audio?"audio":"video",z="html5"==x&&0==a.find(y).length?"html5":"youtube"==x&&0==a.find("iframe").length?"youtube":"vimeo"==x&&0==a.find("iframe").length?"vimeo":"none";switch(w=!0===k.nextslideatend?"":w,k.videotype=x,z){case"html5":"controls"!=u&&(u="");var y="video";"html5"==k.audio&&(y="audio",a.addclass("tp-audio-html5"));var a=d.fallbacks.allowhtml5autoplayonandroid?"muted playsinline":"",b="<"+y+" "+a+' style="object-fit:cover;background-size:cover;visible:hidden;width:100%; height:100%" class="" '+w+' preload="'+p+'">';"auto"==p&&(d.mediapreload=!0),void 0!=r&&"firefox"==b.get_browser().tolowercase()&&(b=b+''),void 0!=q&&(b=b+''),void 0!=s&&(b=b+''),b=b+"";var c="";"true"!==t&&!0!==t||(c='
'),"controls"==u&&(b=b+'
'+c+"
"),a.data("videomarkup",b),a.append(b),(c&&1==a.data("disablevideoonmobile")||b.isie(8))&&a.find(y).remove(),a.find(y).each(function(c){var e=this,f=jquery(this);f.parent().hasclass("html5vid")||f.wrap('
'),1!=f.parent().data("metaloaded")&&g(e,"loadedmetadata",function(a){l(a,d),b.resetvideo(a,d)}(a))});break;case"youtube":v="https","none"==u&&(m=m.replace("controls=1","controls=0"),-1==m.tolowercase().indexof("controls")&&(m+="&controls=0")),!0!==k.videoinline&&"true"!==k.videoinline&&1!==k.videoinline||(m+="&playsinline=1");var d=f(a.data("videostartat")),e=f(a.data("videoendat"));-1!=d&&(m=m+"&start="+d),-1!=e&&(m=m+"&end="+e);var f=m.split("origin="+v+"://"),g="";f.length>1?(g=f[0]+"origin="+v+"://",self.location.href.match(/www/gi)&&!f[1].match(/www/gi)&&(g+="www."),g+=f[1]):g=m;var h="true"===t||!0===t?"allowfullscreen":"";a.data("videomarkup",'');break;case"vimeo":v="https",a.data("videomarkup",'')}var i=c&&"on"==a.data("noposteronmobile");if(void 0!=k.videoposter&&k.videoposter.length>2&&!i)0==a.find(".tp-videoposter").length&&a.append('
'),0==a.find("iframe").length&&a.find(".tp-videoposter").click(function(){if(b.playvideo(a,d),c){if(1==a.data("disablevideoonmobile"))return!1;punchgs.tweenlite.to(a.find(".tp-videoposter"),.3,{autoalpha:0,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find("iframe"),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout})}});else{if(c&&1==a.data("disablevideoonmobile"))return!1;0!=a.find("iframe").length||"youtube"!=x&&"vimeo"!=x||(a.append(a.data("videomarkup")),i(a,d,!1))}"none"!=a.data("dottedoverlay")&&void 0!=a.data("dottedoverlay")&&1!=a.find(".tp-dottedoverlay").length&&a.append('
'),a.addclass("haslistener"),1==a.data("bgvideo")&&punchgs.tweenlite.set(a.find("video, iframe"),{autoalpha:0})}});var g=function(a,b,c){a.addeventlistener?a.addeventlistener(b,c,{capture:!1,passive:!0}):a.attachevent(b,c,{capture:!1,passive:!0})},h=function(a,b,c){var d={};return d.video=a,d.videotype=b,d.settings=c,d},i=function(a,d,e){var g=a.data(),i=a.find("iframe"),l="iframe"+math.round(1e5*math.random()+1),o=g.videoloop,p="loopandnoslidestop"!=o;if(o="loop"==o||"loopandnoslidestop"==o,1==a.data("forcecover")){a.removeclass("fullscreenvideo").addclass("coverscreenvideo");var q=a.data("aspectratio");void 0!=q&&q.split(":").length>1&&(console.log("i"),b.preparecoveredvideo(q,d,a))}if(1==a.data("bgvideo")){var q=a.data("aspectratio");void 0!=q&&q.split(":").length>1&&(console.log("ak"),b.preparecoveredvideo(q,d,a))}if(i.attr("id",l),e&&a.data("startvideonow",!0),1!==a.data("videolistenerexist"))switch(g.videotype){case"youtube":var r=new yt.player(l,{events:{onstatechange:function(c){var e=a.closest(".tp-simpleresponsive"),q=(g.videorate,a.data("videostart"),k());if(c.data==yt.playerstate.playing)punchgs.tweenlite.to(a.find(".tp-videoposter"),.3,{autoalpha:0,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find("iframe"),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout}),"mute"==a.data("volume")||b.lasttogglestate(a.data("videomutetoggledby"))||!0===d.globalmute?r.mute():(r.unmute(),r.setvolume(parseint(a.data("volume"),0)||75)),d.videoplaying=!0,m(a,d),p?d.c.trigger("stoptimer"):d.videoplaying=!1,d.c.trigger("revolution.slide.onvideoplay",h(r,"youtube",a.data())),b.togglestate(g.videotoggledby);else{if(0==c.data&&o){var s=f(a.data("videostartat"));-1!=s&&r.seekto(s),r.playvideo(),b.togglestate(g.videotoggledby)}q||0!=c.data&&2!=c.data||!("on"==a.data("showcoveronpause")&&a.find(".tp-videoposter").length>0||1===a.data("bgvideo")&&a.find(".rs-fullvideo-cover").length>0)||(1===a.data("bgvideo")?punchgs.tweenlite.to(a.find(".rs-fullvideo-cover"),.1,{autoalpha:1,force3d:"auto",ease:punchgs.power3.easeinout}):punchgs.tweenlite.to(a.find(".tp-videoposter"),.1,{autoalpha:1,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find("iframe"),.1,{autoalpha:0,ease:punchgs.power3.easeinout})),-1!=c.data&&3!=c.data&&(d.videoplaying=!1,d.tonpause=!1,n(a,d),e.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",h(r,"youtube",a.data())),void 0!=d.currentlayervideoisplaying&&d.currentlayervideoisplaying.attr("id")!=a.attr("id")||b.untogglestate(g.videotoggledby)),0==c.data&&1==a.data("nextslideatend")?(j(),a.data("nextslideatend-triggered",1),d.c.revnext(),n(a,d)):(n(a,d),d.videoplaying=!1,e.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",h(r,"youtube",a.data())),void 0!=d.currentlayervideoisplaying&&d.currentlayervideoisplaying.attr("id")!=a.attr("id")||b.untogglestate(g.videotoggledby))}},onready:function(b){var d=g.videorate;a.data("videostart");if(a.addclass("rs-apiready"),void 0!=d&&b.target.setplaybackrate(parsefloat(d)),a.find(".tp-videoposter").unbind("click"),a.find(".tp-videoposter").click(function(){c||r.playvideo()}),a.data("startvideonow")){g.player.playvideo();var h=f(a.data("videostartat"));-1!=h&&g.player.seekto(h)}a.data("videolistenerexist",1)}}});a.data("player",r);break;case"vimeo":for(var w,s=i.attr("src"),t={},u=s,v=/([^&=]+)=([^&]*)/g;w=v.exec(u);)t[decodeuricomponent(w[1])]=decodeuricomponent(w[2]);s=void 0!=t.player_id?s.replace(t.player_id,l):s+"&player_id="+l;try{s=s.replace("api=0","api=1")}catch(a){}s+="&api=1",i.attr("src",s);var r=a.find("iframe")[0],y=(jquery("#"+l),$f(l));y.addevent("ready",function(){if(a.addclass("rs-apiready"),y.addevent("play",function(c){a.data("nextslidecalled",0),punchgs.tweenlite.to(a.find(".tp-videoposter"),.3,{autoalpha:0,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find("iframe"),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout}),d.c.trigger("revolution.slide.onvideoplay",h(y,"vimeo",a.data())),d.videoplaying=!0,m(a,d),p?d.c.trigger("stoptimer"):d.videoplaying=!1,"mute"==a.data("volume")||b.lasttogglestate(a.data("videomutetoggledby"))||!0===d.globalmute?y.api("setvolume","0"):y.api("setvolume",parseint(a.data("volume"),0)/100||.75),b.togglestate(g.videotoggledby)}),y.addevent("playprogress",function(b){var c=f(a.data("videoendat"));if(a.data("currenttime",b.seconds),0!=c&&math.abs(c-b.seconds)<.3&&c>b.seconds&&1!=a.data("nextslidecalled"))if(o){y.api("play");var e=f(a.data("videostartat"));-1!=e&&y.api("seekto",e)}else 1==a.data("nextslideatend")&&(a.data("nextslideatend-triggered",1),a.data("nextslidecalled",1),d.c.revnext()),y.api("pause")}),y.addevent("finish",function(c){n(a,d),d.videoplaying=!1,d.c.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",h(y,"vimeo",a.data())),1==a.data("nextslideatend")&&(a.data("nextslideatend-triggered",1),d.c.revnext()),void 0!=d.currentlayervideoisplaying&&d.currentlayervideoisplaying.attr("id")!=a.attr("id")||b.untogglestate(g.videotoggledby)}),y.addevent("pause",function(c){("on"==a.data("showcoveronpause")&&a.find(".tp-videoposter").length>0||1===a.data("bgvideo")&&a.find(".rs-fullvideo-cover").length>0)&&(1===a.data("bgvideo")?punchgs.tweenlite.to(a.find(".rs-fullvideo-cover"),.1,{autoalpha:1,force3d:"auto",ease:punchgs.power3.easeinout}):punchgs.tweenlite.to(a.find(".tp-videoposter"),.1,{autoalpha:1,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find("iframe"),.1,{autoalpha:0,ease:punchgs.power3.easeinout})),d.videoplaying=!1,d.tonpause=!1,n(a,d),d.c.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",h(y,"vimeo",a.data())),void 0!=d.currentlayervideoisplaying&&d.currentlayervideoisplaying.attr("id")!=a.attr("id")||b.untogglestate(g.videotoggledby)}),a.find(".tp-videoposter").unbind("click"),a.find(".tp-videoposter").click(function(){if(!c)return y.api("play"),!1}),a.data("startvideonow")){y.api("play");var e=f(a.data("videostartat"));-1!=e&&y.api("seekto",e)}a.data("videolistenerexist",1)})}else{var z=f(a.data("videostartat"));switch(g.videotype){case"youtube":e&&(g.player.playvideo(),-1!=z&&g.player.seekto());break;case"vimeo":if(e){var y=$f(a.find("iframe").attr("id"));y.api("play"),-1!=z&&y.api("seekto",z)}}}},j=function(){document.exitfullscreen?document.exitfullscreen():document.mozcancelfullscreen?document.mozcancelfullscreen():document.webkitexitfullscreen&&document.webkitexitfullscreen()},k=function(){try{if(void 0!==window.fullscreen)return window.fullscreen;var a=5;return jquery.browser.webkit&&/apple computer/.test(navigator.vendor)&&(a=42),screen.width==window.innerwidth&&math.abs(screen.height-window.innerheight) '),a.find("video, .tp-poster, .tp-video-play-button").click(function(){a.hasclass("videoisplaying")?q.pause():q.play()})),1==a.data("forcecover")||a.hasclass("fullscreenvideo")||1==a.data("bgvideo"))if(1==a.data("forcecover")||1==a.data("bgvideo")){r.addclass("fullcoveredvideo");var u=a.data("aspectratio")||"4:3";b.setsize(e),b.preparecoveredvideo(u,e,a)}else r.addclass("fullscreenvideo");var v=a.find(".tp-vid-play-pause")[0],w=a.find(".tp-vid-mute")[0],x=a.find(".tp-vid-full-screen")[0],y=a.find(".tp-seek-bar")[0],z=a.find(".tp-volume-bar")[0];void 0!=v&&g(v,"click",function(){1==q.paused?q.play():q.pause()}),void 0!=w&&g(w,"click",function(){0==q.muted?(q.muted=!0,w.innerhtml="unmute"):(q.muted=!1,w.innerhtml="mute")}),void 0!=x&&x&&g(x,"click",function(){q.requestfullscreen?q.requestfullscreen():q.mozrequestfullscreen?q.mozrequestfullscreen():q.webkitrequestfullscreen&&q.webkitrequestfullscreen()}),void 0!=y&&(g(y,"change",function(){var a=q.duration*(y.value/100);q.currenttime=a}),g(y,"mousedown",function(){a.addclass("seekbardragged"),q.pause()}),g(y,"mouseup",function(){a.removeclass("seekbardragged"),q.play()})),g(q,"canplaythrough",function(){b.preloadaudiodone(a,e,"canplaythrough")}),g(q,"canplay",function(){b.preloadaudiodone(a,e,"canplay")}),g(q,"progress",function(){b.preloadaudiodone(a,e,"progress")}),g(q,"timeupdate",function(){var b=100/q.duration*q.currenttime,c=f(a.data("videoendat")),d=q.currenttime;if(void 0!=y&&(y.value=b),0!=c&&-1!=c&&math.abs(c-d)<=.3&&c>d&&1!=a.data("nextslidecalled"))if(s){q.play();var g=f(a.data("videostartat"));-1!=g&&(q.currenttime=g)}else 1==a.data("nextslideatend")&&(a.data("nextslideatend-triggered",1),a.data("nextslidecalled",1),e.just_called_nextslide_at_htmltimer=!0,e.c.revnext(),settimeout(function(){e.just_called_nextslide_at_htmltimer=!1},1e3)),q.pause()}),void 0!=z&&g(z,"change",function(){q.volume=z.value}),g(q,"play",function(){a.data("nextslidecalled",0);var c=a.data("volume");c=void 0!=c&&"mute"!=c?parsefloat(c)/100:c,d||(!0===e.globalmute?q.muted=!0:q.muted=!1,c>1&&(c/=100),"mute"==c?q.muted=!0:void 0!=c&&(q.volume=c)),a.addclass("videoisplaying");var f="html5"==l.audio?"audio":"video";m(a,e),t&&"audio"!=f?(e.videoplaying=!0,e.c.trigger("stoptimer"),e.c.trigger("revolution.slide.onvideoplay",h(q,"html5",l))):(e.videoplaying=!1,"audio"!=f&&e.c.trigger("starttimer"),e.c.trigger("revolution.slide.onvideostop",h(q,"html5",l))),punchgs.tweenlite.to(a.find(".tp-videoposter"),.3,{autoalpha:0,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find(f),.3,{autoalpha:1,display:"block",ease:punchgs.power3.easeinout});var g=a.find(".tp-vid-play-pause")[0],i=a.find(".tp-vid-mute")[0];void 0!=g&&(g.innerhtml="pause"),void 0!=i&&q.muted&&(i.innerhtml="unmute"),b.togglestate(l.videotoggledby)}),g(q,"pause",function(c){var d="html5"==l.audio?"audio":"video";!k()&&a.find(".tp-videoposter").length>0&&"on"==a.data("showcoveronpause")&&!a.hasclass("seekbardragged")&&(punchgs.tweenlite.to(a.find(".tp-videoposter"),.3,{autoalpha:1,force3d:"auto",ease:punchgs.power3.easeinout}),punchgs.tweenlite.to(a.find(d),.3,{autoalpha:0,ease:punchgs.power3.easeinout})),a.removeclass("videoisplaying"),e.videoplaying=!1,n(a,e),"audio"!=d&&e.c.trigger("starttimer"),e.c.trigger("revolution.slide.onvideostop",h(q,"html5",a.data()));var g=a.find(".tp-vid-play-pause")[0];void 0!=g&&(g.innerhtml="play"),void 0!=e.currentlayervideoisplaying&&e.currentlayervideoisplaying.attr("id")!=a.attr("id")||b.untogglestate(l.videotoggledby)}),g(q,"ended",function(){j(),n(a,e),e.videoplaying=!1,n(a,e),"audio"!=o&&e.c.trigger("starttimer"),e.c.trigger("revolution.slide.onvideostop",h(q,"html5",a.data())),!0===a.data("nextslideatend")&&q.currenttime>0&&(1==!e.just_called_nextslide_at_htmltimer&&(a.data("nextslideatend-triggered",1),e.c.revnext(),e.just_called_nextslide_at_htmltimer=!0),settimeout(function(){e.just_called_nextslide_at_htmltimer=!1},1500)),a.removeclass("videoisplaying")})},m=function(a,c){void 0==c.playingvideos&&(c.playingvideos=new array),a.data("stopallvideos")&&void 0!=c.playingvideos&&c.playingvideos.length>0&&(c.lastplayedvideos=jquery.extend(!0,[],c.playingvideos),jquery.each(c.playingvideos,function(a,d){b.stopvideo(d,c)})),c.playingvideos.push(a),c.currentlayervideoisplaying=a},n=function(a,b){void 0!=b.playingvideos&&jquery.inarray(a,b.playingvideos)>=0&&b.playingvideos.splice(jquery.inarray(a,b.playingvideos),1)}}(jquery);