25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2 lines
25 KiB

  1. (function(B){var l=jQuery.fn.revolution,C=l.is_mobile(),z=(l.is_android(),{alias:"Video Min JS",name:"revolution.extensions.video.min.js",min_core:"5.4.8",version:"2.2.2"});function h(e){return e==null?-1:jQuery.isNumeric(e)?e:1<e.split(":").length?60*parseInt(e.split(":")[0],0)+parseInt(e.split(":")[1],0):e}jQuery.extend(!0,l,{preLoadAudio:function(e,t){if(l.compare_version(z).check==="stop")return!1;e.find(".tp-audiolayer").each(function(){var a=jQuery(this),o={};a.find("audio").length===0&&(o.src=a.data("videomp4")!=null?a.data("videomp4"):"",o.pre=a.data("videopreload")||"",a.attr("id")===void 0&&a.attr("audio-layer-"+Math.round(199999*Math.random())),o.id=a.attr("id"),o.status="prepared",o.start=jQuery.now(),o.waittime=1e3*a.data("videopreloadwait")||5e3,o.pre!="auto"&&o.pre!="canplaythrough"&&o.pre!="canplay"&&o.pre!="progress"||(t.audioqueue===void 0&&(t.audioqueue=[]),t.audioqueue.push(o),l.manageVideoLayer(a,t)))})},preLoadAudioDone:function(e,t,a){t.audioqueue&&0<t.audioqueue.length&&jQuery.each(t.audioqueue,function(o,i){e.data("videomp4")!==i.src||i.pre!==a&&i.pre!=="auto"||(i.status="loaded")})},resetVideo:function(e,t,a,o){var i=e.data();switch(i.videotype){case"youtube":i.player;try{if(i.forcerewind=="on"){var n=(r=h(e.data("videostartat")))==-1,d=i.bgvideo===1||0<e.find(".tp-videoposter").length;i.player!=null&&(r=r==-1?0:r,i.player.seekTo(r),i.player.pauseVideo())}}catch{}e.find(".tp-videoposter").length==0&&i.bgvideo!==1&&a!==!0&&punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});break;case"vimeo":var f=e.data("vimeoplayer");try{if(i.forcerewind=="on"){var r=h(i.videostartat);n=r==-1,d=i.bgvideo===1||0<e.find(".tp-videoposter").length,((r=r==-1?0:r)!==0&&!n||d)&&f.pause().then(function(){f.setCurrentTime(r)})}}catch{}e.find(".tp-videoposter").length==0&&i.bgvideo!==1&&a!==!0&&punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});break;case"html5":if(C&&i.disablevideoonmobile==1)return!1;var y=i.audio=="html5"?"audio":"video",c=e.find(y),g=c[0];if(punchgs.TweenLite.to(c,.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),i.forcerewind=="on"&&!e.hasClass("videoisplaying"))try{r=h(i.videostartat),g.currentTime=r==-1?0:r}catch{}(i.volume=="mute"||l.lastToggleState(e.videomutetoggledby)||t.globalmute===!0)&&(g.muted=!0)}},isVideoMuted:function(e,t){var a=!1,o=e.data();switch(o.videotype){case"youtube":try{a=o.player.isMuted()}catch{}break;case"vimeo":try{o.volume=="mute"&&(a=!0)}catch{}break;case"html5":var i=o.audio=="html5"?"audio":"video";e.find(i)[0].muted&&(a=!0)}return a},muteVideo:function(e,t){var a=e.data();switch(a.videotype){case"youtube":try{a.player.mute()}catch{}break;case"vimeo":try{var o=e.data("vimeoplayer");e.data("volume","mute"),o.setVolume(0)}catch{}break;case"html5":var i=a.audio=="html5"?"audio":"video";e.find(i)[0].muted=!0}},unMuteVideo:function(e,t){if(t.globalmute!==!0){var a=e.data();switch(a.videotype){case"youtube":try{a.player.unMute()}catch{}break;case"vimeo":try{var o=e.data("vimeoplayer");e.data("volume","1"),o.setVolume(1)}catch{}break;case"html5":var i=a.audio=="html5"?"audio":"video";e.find(i)[0].muted=!1}}},stopVideo:function(e,t){var a=e.data();switch(t.leaveViewPortBasedStop||(t.lastplayedvideos=[]),t.leaveViewPortBasedStop=!1,a.videotype){case"youtube":try{var o=a.player;if(o.getPlayerState()===2||o.getPlayerState()===5)return;o.pauseVideo(),a.youtubepausecalled=!0,setTimeout(function(){a.youtubepausecalled=!1},80)}catch(f){console.log("Issue at YouTube Video Pause:"),console.log(f)}break;case"vimeo":try{e.data("vimeoplayer").pause(),a.vimeopausecalled=!0,setTimeout(function(){a.vimeopausecalled=!1},80)}catch(f){console.log("Issue at Vimeo Video Pause:"),console.log(f)}break;case"html5":var i=a.audio=="html5"?"audio":"video",n=e.find(i),d=n[0];n!=null&&d!=null&&d.pause()}},playVideo:function(e,t){clearTimeout(e.data("videoplaywait"));var a=e.data();switch(a.videotype){case"youtube":if(e.find("iframe").length==0)e.append(e.data("videomarkup")),O(e,t,!0);else if(a.player.playVideo!=null){var o=h(e.data("videostartat")),i=a.player.getCurrentTime();e.data("nextslideatend-triggered")==1&&(i=-1,e.data("nextslideatend-triggered",0)),o!=-1&&i<o&&a.player.seekTo(o),a.youtubepausecalled!==!0&&a.player.playVideo()}else e.data("videoplaywait",setTimeout(function(){a.youtubepausecalled!==!0&&l.playVideo(e,t)},50));break;case"vimeo":if(e.find("iframe").length==0)e.removeData("vimeoplayer"),e.append(e.data("videomarkup")),O(e,t,!0);else if(e.hasClass("rs-apiready")){var n,d=e.find("iframe").attr("id");e.data("vimeoplayer")?n=e.data("vimeoplayer"):(n=new Vimeo.Player(d),e.data("vimeoplayer",n)),n.getPaused()?setTimeout(function(){var c=h(e.data("videostartat")),g=e.data("currenttime");g||(g=0),e.data("nextslideatend-triggered")==1&&(g=-1,e.data("nextslideatend-triggered",0)),c!=-1&&g<c&&n.setCurrentTime(c),n.play()},510):e.data("videoplaywait",setTimeout(function(){a.vimeopausecalled!==!0&&l.playVideo(e,t)},50))}else e.data("videoplaywait",setTimeout(function(){a.vimeopausecalled!==!0&&l.playVideo(e,t)},50));break;case"html5":var f=a.audio=="html5"?"audio":"video",r=e.find(f),y=r[0];r.parent().data("metaloaded")!=1?w(y,"loadedmetadata",function(c){l.resetVideo(c,t),y.play();var g=h(c.data("videostartat")),b=y.currentTime;c.data("nextslideatend-triggered")==1&&(b=-1,c.data("nextslideatend-triggered",0)),g!=-1&&b<g&&(y.currentTime=g)}(e)):(y.play(),o=h(e.data("videostartat")),i=y.currentTime,e.data("nextslideatend-triggered")==1&&(i=-1,e.data("nextslideatend-triggered",0)),o!=-1&&i<o&&(y.currentTime=o))}},isVideoPlaying:function(e,t){var a=!1;return t.playingvideos!=null&&jQuery.each(t.playingvideos,function(o,i){e.attr("id")==i.attr("id")&&(a=!0)}),a},removeMediaFromList:function(e,t){P(e,t)},prepareCoveredVideo:function(e,t){if((!t.hasClass("tp-caption")||t.hasClass("coverscreenvideo"))&&(t.data("vimeoid")===void 0||t.data("vimeoplayerloaded")!==void 0)){var a={};a.ifr=t.find("iframe, video"),a.asp=t.data("aspectratio"),a.wa=a.asp.split(":")[0],a.ha=a.asp.split(":")[1],a.vd=a.wa/a.ha;var o=e.sliderType!=="carousel"?e.conw:t.closest(".tp-revslider-slidesli").width();if(o===0||e.conh===0)return l.setSize(e),clearTimeout(a.ifr.data("resizelistener")),void a.ifr.data("resizelistener",setTimeout(function(){l.prepareCoveredVideo(e,t)},100));var i=o/e.conh,n=i/a.vd*100,d=a.vd/i*100;i>a.vd?punchgs.TweenLite.set(a.ifr,{height:n+"%",width:"100%",top:-(n-100)/2+"%",left:"0px",position:"absolute"}):punchgs.TweenLite.set(a.ifr,{width:d+"%",height:"100%",left:-(d-100)/2+"%",top:"0px",position:"absolute"}),a.ifr.hasClass("resizelistener")||(a.ifr.addClass("resizelistener"),jQuery(window).resize(function(){l.prepareCoveredVideo(e,t),clearTimeout(a.ifr.data("resizelistener")),a.ifr.data("resizelistener",setTimeout(function(){l.prepareCoveredVideo(e,t)},90))}))}},checkVideoApis:function(e,t,a){if((e.data("ytid")!=null||0<e.find("iframe").length&&0<e.find("iframe").attr("src").toLowerCase().indexOf("youtube"))&&(t.youtubeapineeded=!0),(e.data("ytid")!=null||0<e.find("iframe").length&&0<e.find("iframe").attr("src").toLowerCase().indexOf("youtube"))&&a.addedyt==0){t.youtubestarttime=jQuery.now(),a.addedyt=1;var o=document.createElement("script");o.src="https://www.youtube.com/iframe_api";var i=document.getElementsByTagName("script")[0],n=!0;jQuery("head").find("*").each(function(){jQuery(this).attr("src")=="https://www.youtube.com/iframe_api"&&(n=!1)}),n&&i.parentNode.insertBefore(o,i)}if((e.data("vimeoid")!=null||0<e.find("iframe").length&&0<e.find("iframe").attr("src").toLowerCase().indexOf("vimeo"))&&(t.vimeoapineeded=!0),(e.data("vimeoid")!=null||0<e.find("iframe").length&&0<e.find("iframe").attr("src").toLowerCase().indexOf("vimeo"))&&a.addedvim==0){t.vimeostarttime=jQuery.now(),a.addedvim=1;var d=document.createElement("script");i=document.getElementsByTagName("script")[0],n=!0,d.src="https://player.vimeo.com/api/player.js",jQuery("head").find("*").each(function(){jQuery(this).attr("src")=="https://player.vimeo.com/api/player.js"&&(n=!1)}),n&&i.parentNode.insertBefore(d,i)}return a},manageVideoLayer:function(e,t,a,o){if(l.compare_version(z).check==="stop")return!1;var i=e.data(),n=i.videoattributes,d=i.ytid,f=i.vimeoid,r=i.videopreload==="auto"||i.videopreload==="canplay"||i.videopreload==="canplaythrough"||i.videopreload==="progress"?"auto":i.videopreload,y=i.videomp4,c=i.videowebm,g=i.videoogv,b=i.allowfullscreenvideo,L=i.videocontrols,T="http",x=i.videoloop=="loop"||i.videoloop=="loopandnoslidestop"?"loop":"",m=y!=null||c!=null?"html5":d!=null&&1<String(d).length?"youtube":f!=null&&1<String(f).length?"vimeo":"none",p=i.audio=="html5"?"audio":"video",u=m=="html5"&&e.find(p).length==0?"html5":m=="youtube"&&e.find("iframe").length==0?"youtube":m=="vimeo"&&e.find("iframe").length==0?"vimeo":"none";switch(x=i.nextslideatend===!0?"":x,i.videotype=m,u){case"html5":L!="controls"&&(L=""),p="video",i.audio=="html5"&&(p="audio",e.addClass("tp-audio-html5"));var v="";p==="video"&&(l.is_mobile()||l.isSafari11())&&(i.autoplay==="on"||i.autoplay==="true"||i.autoplay===!0?v="muted playsinline autoplay":i.videoinline!=1&&i.videoinline!=="true"&&i.videoinline!==1||(v+=" playsinline"));var s="<"+p+" "+v+' style="object-fit:cover;background-size:cover;visible:hidden;width:100%; height:100%" class="" '+x+' preload="'+r+'">';r=="auto"&&(t.mediapreload=!0),p==="video"?(c!=null&&l.get_browser().toLowerCase()=="firefox"&&(s=s+'<source src="'+c+'" type="video/webm" />'),y!=null&&(s=s+'<source src="'+y+'" type="video/mp4" />'),g!=null&&(s=s+'<source src="'+g+'" type="video/ogg" />')):p==="audio"&&(y!=null&&(s=s+'<source src="'+y+'" type="audio/mpeg" />'),g!=null&&(s=s+'<source src="'+g+'" type="audio/ogg" />')),s=s+"</"+p+">";var k="";b!=="true"&&b!==!0||(k='<div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-full-screen">Full-Screen</button></div>'),L=="controls"&&(s=s+'<div class="tp-video-controls"><div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-play-pause">Play</button></div><div class="tp-video-seek-bar-wrap"><input type="range" class="tp-seek-bar" value="0"></div><div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-mute">Mute</button></div><div class="tp-video-vol-bar-wrap"><input type="range" class="tp-volume-bar" min="0" max="1" step="0.1" value="1"></div>'+k+"</div>"),e.data("videomarkup",s),e.append(s),(C&&e.data("disablevideoonmobile")==1||l.isIE(8))&&e.find(p).remove(),e.find(p).each(function(N){var q,M=jQuery(this);M.parent().hasClass("html5vid")||M.wrap('<div class="html5vid" style="position:relative;top:0px;left:0px;width:100%;height:100%; overflow:hidden;"></div>'),M.parent().data("metaloaded")!=1&&w(this,"loadedmetadata",(E(q=e,t),void l.resetVideo(q,t)))});break;case"youtube":T="https",L=="none"&&(n=n.replace("controls=1","controls=0")).toLowerCase().indexOf("controls")==-1&&(n+="&controls=0"),(i.videoinline===!0||i.videoinline==="true"||i.videoinline===1||e.hasClass("rs-background-video-layer")||e.data("autoplay")==="on")&&(n+="&playsinline=1");var I=h(e.data("videostartat")),j=h(e.data("videoendat"));I!=-1&&(n=n+"&start="+I),j!=-1&&(n=n+"&end="+j);var S=n.split("origin="+T+"://"),_="";1<S.length?(_=S[0]+"origin="+T+"://",self.location.href.match(/www/gi)&&!S[1].match(/www/gi)&&(_+="www."),_+=S[1]):_=n;var H=b==="true"||b===!0?"allowfullscreen":"";e.data("videomarkup",'<iframe type="text/html" src="'+T+"://www.youtube-nocookie.com/embed/"+d+"?"+_+'" '+H+' width="100%" height="100%" style="opacity:0;width:100%;height:100%"></iframe>');break;case"vimeo":T="https",e.data("videomarkup",'<iframe src="'+T+"://player.vimeo.com/video/"+f+"?"+n+'" webkitallowfullscreen mozallowfullscreen allowfullscreen width="100%" height="100%" style="opacity:0;visibility:hidden;width:100%;height:100%"></iframe>')}var R=C&&e.data("noposteronmobile")=="on";if(i.videoposter!=null&&2<i.videoposter.length&&!R)e.find(".tp-videoposter").length==0&&e.append('<div class="tp-videoposter noSwipe" style="cursor:pointer; position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:3;background-image:url('+i.videoposter+'); background-size:cover;background-position:center center;"></div>'),e.find("iframe").length==0&&e.find(".tp-videoposter").click(function(){if(l.playVideo(e,t),C){if(e.data("disablevideoonmobile")==1)return!1;punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut})}});else{if(C&&e.data("disablevideoonmobile")==1)return!1;e.find("iframe").length!=0||m!="youtube"&&m!="vimeo"||(e.removeData("vimeoplayer"),e.append(e.data("videomarkup")),O(e,t,!1))}e.data("dottedoverlay")!="none"&&e.data("dottedoverlay")!=null&&e.find(".tp-dottedoverlay").length!=1&&e.append('<div class="tp-dottedoverlay '+e.data("dottedoverlay")+'"></div>'),e.addClass("HasListener"),e.data("bgvideo")==1&&(e.data("ytid")?punchgs.TweenLite.set(e.find("iframe"),{opacity:0}):punchgs.TweenLite.set(e.find("video, iframe"),{autoAlpha:0}))}});var w=function(e,t,a){e.addEventListener?e.addEventListener(t,a,{capture:!1,passive:!0}):e.attachEvent(t,a,{capture:!1,passive:!0})},V=function(e,t,a){var o={};return o.video=e,o.videotype=t,o.settings=a,o},A=function(e,t){if(t.data("bgvideo")==1||t.data("forcecover")==1){t.data("forcecover")===1&&t.removeClass("fullscreenvideo").addClass("coverscreenvideo");var a=t.data("aspectratio");a===void 0&&a.split(":").length<=1&&t.data("aspectratio","16:9"),l.prepareCoveredVideo(e,t)}},O=function(e,t,a){var o=e.data(),i=e.find("iframe"),n="iframe"+Math.round(1e5*Math.random()+1),d=o.videoloop,f=d!="loopandnoslidestop";if(d=d=="loop"||d=="loopandnoslidestop",A(t,e),i.attr("id",n),a&&e.data("startvideonow",!0),e.data("videolistenerexist")!==1)switch(o.videotype){case"youtube":var r=new YT.Player(n,{events:{onStateChange:function(v){var s=e.closest(".tp-simpleresponsive"),k=(o.videorate,e.data("videostart"),D());if(v.data==YT.PlayerState.PLAYING)punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),e.data("volume")=="mute"||l.lastToggleState(e.data("videomutetoggledby"))||t.globalmute===!0?r.mute():(r.unMute(),r.setVolume(parseInt(e.data("volume"),0)||75)),t.videoplaying=!0,Q(e,t),f?t.c.trigger("stoptimer"):t.videoplaying=!1,t.c.trigger("revolution.slide.onvideoplay",V(r,"youtube",e.data())),l.toggleState(o.videotoggledby);else{if(v.data==0&&d){var I=h(e.data("videostartat"));I!=-1&&r.seekTo(I),r.playVideo(),l.toggleState(o.videotoggledby)}k||v.data!=0&&v.data!=2||!(e.data("showcoveronpause")=="on"&&0<e.find(".tp-videoposter").length||e.data("bgvideo")===1&&0<e.find(".rs-fullvideo-cover").length)||(e.data("bgvideo")===1?punchgs.TweenLite.to(e.find(".rs-fullvideo-cover"),.1,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}):punchgs.TweenLite.to(e.find(".tp-videoposter"),.1,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.1,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),v.data!=-1&&v.data!=3&&(t.videoplaying=!1,t.tonpause=!1,P(e,t),s.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(r,"youtube",e.data())),t.currentLayerVideoIsPlaying!=null&&t.currentLayerVideoIsPlaying.attr("id")!=e.attr("id")||l.unToggleState(o.videotoggledby)),v.data==0&&e.data("nextslideatend")==1?(F(),e.data("nextslideatend-triggered",1),t.c.revnext(),P(e,t)):(P(e,t),t.videoplaying=!1,s.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(r,"youtube",e.data())),t.currentLayerVideoIsPlaying!=null&&t.currentLayerVideoIsPlaying.attr("id")!=e.attr("id")||l.unToggleState(o.videotoggledby))}},onReady:function(v){var s,k=l.is_mobile(),I=e.hasClass("tp-videolayer");if(k||l.isSafari11()){var j=I&&e.data("autoplay")!=="off";(e.hasClass("rs-background-video-layer")||j)&&(k&&I||(s=!0,r.setVolume(0),e.data("volume","mute"),r.mute(),clearTimeout(e.data("mobilevideotimr")),e.data("mobilevideotimr",setTimeout(function(){r.playVideo()},500))))}s||e.data("volume")!="mute"||(r.setVolume(0),r.mute());var S=o.videorate;if(e.data("videostart"),e.addClass("rs-apiready"),S!=null&&v.target.setPlaybackRate(parseFloat(S)),e.find(".tp-videoposter").unbind("click"),e.find(".tp-videoposter").click(function(){C||r.playVideo()}),e.data("startvideonow")){o.player.playVideo();var _=h(e.data("videostartat"));_!=-1&&o.player.seekTo(_)}e.data("videolistenerexist",1)}}});e.data("player",r);break;case"vimeo":for(var y,c=i.attr("src"),g={},b=c,L=/([^&=]+)=([^&]*)/g;y=L.exec(b);)g[decodeURIComponent(y[1])]=decodeURIComponent(y[2]);c=(c=g.player_id!=null?c.replace(g.player_id,n):c+"&player_id="+n).replace(/&api=0|&api=1/g,"");var T=l.is_mobile(),x=e.data("autoplay"),m=(e.data("volume"),T||l.isSafari11());e.hasClass("rs-background-video-layer"),(x=x==="on"||x==="true"||x===!0)&&m&&(c+="?autoplay=1&autopause=0&muted=1&background=1&playsinline=1",e.data({vimeoplaysinline:!0,volume:"mute"})),i.attr("src",c),r=e.find("iframe")[0],jQuery("#"+n),e.data("vimeoplayer")?u=e.data("vimeoplayer"):(u=new Vimeo.Player(n),e.data("vimeoplayer",u)),u.on("loaded",function(v){var s={};u.getVideoWidth().then(function(k){s.width=k,s.width!==void 0&&s.height!==void 0&&(e.data("aspectratio",s.width+":"+s.height),e.data("vimeoplayerloaded",!0),A(t,e))}),u.getVideoHeight().then(function(k){s.height=k,s.width!==void 0&&s.height!==void 0&&(e.data("aspectratio",s.width+":"+s.height),e.data("vimeoplayerloaded",!0),A(t,e))})}),e.addClass("rs-apiready"),u.on("play",function(v){e.data("nextslidecalled",0),punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),t.c.trigger("revolution.slide.onvideoplay",V(u,"vimeo",e.data())),t.videoplaying=!0,Q(e,t),f?t.c.trigger("stoptimer"):t.videoplaying=!1,e.data("vimeoplaysinline")||(e.data("volume")=="mute"||l.lastToggleState(e.data("videomutetoggledby"))||t.globalmute===!0?u.setVolume(0):u.setVolume(parseInt(e.data("volume"),0)/100||.75),l.toggleState(o.videotoggledby))}),u.on("timeupdate",function(v){var s=h(e.data("videoendat"));if(e.data("currenttime",v.seconds),s!=0&&Math.abs(s-v.seconds)<1&&s>v.seconds&&e.data("nextslidecalled")!=1)if(d){u.play();var k=h(e.data("videostartat"));k!=-1&&u.setCurrentTime(k)}else e.data("nextslideatend")==1&&(e.data("nextslideatend-triggered",1),e.data("nextslidecalled",1),t.c.revnext()),u.pause()}),u.on("ended",function(v){P(e,t),t.videoplaying=!1,t.c.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(u,"vimeo",e.data())),e.data("nextslideatend")==1&&(e.data("nextslideatend-triggered",1),t.c.revnext()),t.currentLayerVideoIsPlaying!=null&&t.currentLayerVideoIsPlaying.attr("id")!=e.attr("id")||l.unToggleState(o.videotoggledby)}),u.on("pause",function(v){(e.data("showcoveronpause")=="on"&&0<e.find(".tp-videoposter").length||e.data("bgvideo")===1&&0<e.find(".rs-fullvideo-cover").length)&&(e.data("bgvideo")===1?punchgs.TweenLite.to(e.find(".rs-fullvideo-cover"),.1,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}):punchgs.TweenLite.to(e.find(".tp-videoposter"),.1,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.1,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),t.videoplaying=!1,t.tonpause=!1,P(e,t),t.c.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(u,"vimeo",e.data())),t.currentLayerVideoIsPlaying!=null&&t.currentLayerVideoIsPlaying.attr("id")!=e.attr("id")||l.unToggleState(o.videotoggledby)}),e.find(".tp-videoposter").unbind("click"),e.find(".tp-videoposter").click(function(){if(!C)return u.play(),!1}),e.data("startvideonow")&&(u.play(),(p=h(e.data("videostartat")))!=-1&&u.setCurrentTime(p)),e.data("videolistenerexist",1)}else{var p=h(e.data("videostartat"));switch(o.videotype){case"youtube":a&&(o.player.playVideo(),p!=-1&&o.player.seekTo());break;case"vimeo":var u;a&&((u=e.data("vimeoplayer")).play(),p!=-1&&u.seekTo(p))}}},F=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},D=function(){try{if(window.fullScreen!==void 0)return window.fullScreen;var e=5;return jQuery.browser.webkit&&/Apple Computer/.test(navigator.vendor)&&(e=42),screen.width==window.innerWidth&&Math.abs(screen.height-window.innerHeight)<e}catch{}},E=function(e,t,a){if(C&&e.data("disablevideoonmobile")==1)return!1;var o=e.data(),i=o.audio=="html5"?"audio":"video",n=e.find(i),d=n[0],f=n.parent(),r=o.videoloop,y=r!="loopandnoslidestop";if(r=r=="loop"||r=="loopandnoslidestop",f.data("metaloaded",1),e.data("bgvideo")!=1||o.videoloop!=="none"&&o.videoloop!==!1||(y=!1),n.attr("control")==null&&(e.find(".tp-video-play-button").length!=0||C||e.append('<div class="tp-video-play-button"><i class="revicon-right-dir"></i><span class="tp-revstop">&nbsp;</span></div>'),e.find("video, .tp-poster, .tp-video-play-button").click(function(){e.hasClass("videoisplaying")?d.pause():d.play()})),e.data("forcecover")==1||e.hasClass("fullscreenvideo")||e.data("bgvideo")==1)if(e.data("forcecover")==1||e.data("bgvideo")==1){f.addClass("fullcoveredvideo");var c=e.data("aspectratio");c!==void 0&&c.split(":").length!=1||e.data("aspectratio","16:9"),l.prepareCoveredVideo(t,e)}else f.addClass("fullscreenvideo");var g=e.find(".tp-vid-play-pause")[0],b=e.find(".tp-vid-mute")[0],L=e.find(".tp-vid-full-screen")[0],T=e.find(".tp-seek-bar")[0],x=e.find(".tp-volume-bar")[0];g!=null&&w(g,"click",function(){d.paused==1?d.play():d.pause()}),b!=null&&w(b,"click",function(){d.muted==0?(d.muted=!0,b.innerHTML="Unmute"):(d.muted=!1,b.innerHTML="Mute")}),L!=null&&L&&w(L,"click",function(){d.requestFullscreen?d.requestFullscreen():d.mozRequestFullScreen?d.mozRequestFullScreen():d.webkitRequestFullscreen&&d.webkitRequestFullscreen()}),T!=null&&(w(T,"change",function(){var m=d.duration*(T.value/100);d.currentTime=m}),w(T,"mousedown",function(){e.addClass("seekbardragged"),d.pause()}),w(T,"mouseup",function(){e.removeClass("seekbardragged"),d.play()})),w(d,"canplaythrough",function(){l.preLoadAudioDone(e,t,"canplaythrough")}),w(d,"canplay",function(){l.preLoadAudioDone(e,t,"canplay")}),w(d,"progress",function(){l.preLoadAudioDone(e,t,"progress")}),w(d,"timeupdate",function(){var m=100/d.duration*d.currentTime,p=h(e.data("videoendat")),u=d.currentTime;if(T!=null&&(T.value=m),p!=0&&p!=-1&&Math.abs(p-u)<=.3&&u<p&&e.data("nextslidecalled")!=1)if(r){d.play();var v=h(e.data("videostartat"));v!=-1&&(d.currentTime=v)}else e.data("nextslideatend")==1&&(e.data("nextslideatend-triggered",1),e.data("nextslidecalled",1),t.just_called_nextslide_at_htmltimer=!0,t.c.revnext(),setTimeout(function(){t.just_called_nextslide_at_htmltimer=!1},1e3)),d.pause()}),x!=null&&w(x,"change",function(){d.volume=x.value}),w(d,"play",function(){e.data("nextslidecalled",0);var m=e.data("volume");m=m!=null&&m!="mute"?parseFloat(m)/100:m,l.is_mobile()||l.isSafari11()||(t.globalmute===!0?d.muted=!0:d.muted=!1,1<m&&(m/=100),m=="mute"?d.muted=!0:m!=null&&(d.volume=m)),e.addClass("videoisplaying");var p=o.audio=="html5"?"audio":"video";Q(e,t),y&&p!="audio"?(t.videoplaying=!0,t.c.trigger("stoptimer"),t.c.trigger("revolution.slide.onvideoplay",V(d,"html5",o))):(t.videoplaying=!1,p!="audio"&&t.c.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(d,"html5",o))),punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find(p),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});var u=e.find(".tp-vid-play-pause")[0],v=e.find(".tp-vid-mute")[0];u!=null&&(u.innerHTML="Pause"),v!=null&&d.muted&&(v.innerHTML="Unmute"),l.toggleState(o.videotoggledby)}),w(d,"pause",function(m){var p=o.audio=="html5"?"audio":"video";!D()&&0<e.find(".tp-videoposter").length&&e.data("showcoveronpause")=="on"&&!e.hasClass("seekbardragged")&&(punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find(p),.3,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),e.removeClass("videoisplaying"),t.videoplaying=!1,P(e,t),p!="audio"&&t.c.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(d,"html5",e.data()));var u=e.find(".tp-vid-play-pause")[0];u!=null&&(u.innerHTML="Play"),t.currentLayerVideoIsPlaying!=null&&t.currentLayerVideoIsPlaying.attr("id")!=e.attr("id")||l.unToggleState(o.videotoggledby)}),w(d,"ended",function(){F(),P(e,t),t.videoplaying=!1,P(e,t),i!="audio"&&t.c.trigger("starttimer"),t.c.trigger("revolution.slide.onvideostop",V(d,"html5",e.data())),e.data("nextslideatend")===!0&&0<d.currentTime&&(!t.just_called_nextslide_at_htmltimer==1&&(e.data("nextslideatend-triggered",1),t.c.revnext(),t.just_called_nextslide_at_htmltimer=!0),setTimeout(function(){t.just_called_nextslide_at_htmltimer=!1},1500)),e.removeClass("videoisplaying")})},Q=function(e,t){t.playingvideos==null&&(t.playingvideos=new Array),e.data("stopallvideos")&&t.playingvideos!=null&&0<t.playingvideos.length&&(t.lastplayedvideos=jQuery.extend(!0,[],t.playingvideos),jQuery.each(t.playingvideos,function(a,o){l.stopVideo(o,t)})),t.playingvideos.push(e),t.currentLayerVideoIsPlaying=e},P=function(e,t){t.playingvideos!=null&&0<=jQuery.inArray(e,t.playingvideos)&&t.playingvideos.splice(jQuery.inArray(e,t.playingvideos),1)}})(jQuery);