HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptoho/wp-content/themes/themify-ultra/themify/js/modules/video-player.js
((t,e,i,s,l,a)=>{"use strict";let o=!1;const n=t.click,f=/iPhone|iPad|iPod|Mac OS/i.test(window.navigator.userAgent),r=t=>{const e=new Date(1e3*(t=1/0===t?0:t)).toISOString().substr(11,8).split(":");return"00"===e[0]&&e.splice(0,1),e.join(":")},p=t=>t.requestFullscreen?t.requestFullscreen():t.mozRequestFullscreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():s.reject(),c=()=>{try{if(e.exitFullscreen)return e.exitFullscreen();if(e.webkitExitFullscreen)return e.webkitExitFullscreen();if(e.mozCancelFullScreen)return e.mozCancelFullScreen();if(e.cancelFullScreen)return e.cancelFullScreen()}catch(t){}return!1},_=t=>e.exitFullscreen?"":e.webkitExitFullscreen||t.webkitSupportsFullscreen?"webkit":!!e.mozCancelFullScreen&&"moz",h=t=>{const i=_(t);return!1!==i&&(t.hasOwnProperty("webkitDisplayingFullscreen")?t.webkitDisplayingFullscreen:""===i?e.fullscreenElement:e[i+"FullscreenElement"])},u=(t,i)=>{const s="http://www.w3.org/2000/svg",l=e.createElementNS(s,"use"),a=e.createElementNS(s,"svg");return t="tf-"+t,a.setAttribute("class","tf_fa "+(i=i?t+" "+i:t)),l.setAttributeNS(null,"href","#"+t),a.appendChild(l),a};class v{constructor(i,l){const a=e.createElement("div");this.wrap=e.createElement("div"),a.className="tf_vd_root",a.style.contain="style size",this.wrap.style.display="none",this.wrap.className="wrap tf_abs_t tf_w tf_h",a.attachShadow({mode:"open"}).appendChild(this.wrap),this.el=i,this.opt=l,this.isPlayList=this.opt&&this.opt.tracks,this.loadPrms=new s((e=>{i.readyState<3?t.requestIdleCallback((()=>{i.tfOn("canplay",e,{passive:!0,once:!0}).load()}),-1,200):e()})),this.init()}init(){const i=this,a=i.el,r=i.wrap,p=e.createDocumentFragment(),c=r.getRootNode().host,_=a.parentNode,h=e.createElement("div"),u=e.createElement("button");h.className="tf_loader tf_abs_c tf_hide",u.className="play flex big_btn tf_abs_c",u.type="button",_.tabIndex=0,a.hasAttribute("data-hide-controls")||p.append(u,i.controls()),p.appendChild(h),i.isPlayList&&p.appendChild(i.tracks()),requestAnimationFrame((async()=>{a.setAttribute("webkit-playsinline","1"),a.setAttribute("playsinline","1"),a.removeAttribute("controls"),r.appendChild(p),_.appendChild(c),await s.all([this.loadPrms,t.loadCss(t.url+"css/base.min","tf_base",null,r),t.loadCss("video","tf_video",null,r),o]),a.hasAttribute("data-hide-controls")||r.appendChild(e.tfId("tf_svg").cloneNode(!0)),a.tfOn("seeking waiting emptied pause play playing ended",(t=>{i.events(t)}),{passive:!0}),r.tfOn(n,(t=>{i.click(t)}),{passive:!0}),a.paused||i.events({type:"play"}),!i.isPlayList&&a.dataset.hoverPlay?(u.style.pointerEvents="none",i.hoverPlay()):a.dataset.autoplay&&i.playVideo(),f&&(i.airPlay(),await new s((t=>{l((()=>{for(let t=r.tfTag("svg"),e=t.length-1;e>-1;--e)t[e].innerHTML=t[e].innerHTML;t()}),100)}))),r.style.display="",_.classList.remove("tf_lazy")}))}click(e){const i=e.target,s=i.closest(".sk"),a=this.el,o=this.wrap.classList;i.closest(".controls")&&!i.classList.contains("play")||(i!==this.wrap&&e.stopImmediatePropagation(),a.paused||!t.isTouch||i.classList.contains("play")||!s&&i.classList.contains("show")?(o.remove("show"),a.paused?this.playVideo():a.pause()):(o.add("show"),o.remove("hide_ctl"),this.timeout&&clearTimeout(this.timeout),this.timeout=l((()=>{o.remove("show"),this.timeout=null}),2500),s&&(a.currentTime+=s.classList.contains("sk_l")?-15:15)))}hoverPlay(t){t??=this.wrap;const i=t.tfTag("video")[0]||this.el,s=async t=>{if(!e.fullscreenElement||t.closest(".pl_v")){try{await this.playVideo(i,!0)}catch(t){}t.tfOn("mouseleave",(s=>{i.paused||e.fullscreenElement&&!t.closest(".pl_v")||(i.pause(),i.currentTime=0)}),{passive:!0,once:!0})}};t.tfOn("mouseenter",(t=>{s(t.currentTarget)}),{passive:!0}),(i.dataset.forceplay||t.matches(":hover"))&&s(t)}showLowPowerControls(){if(this.el.hasAttribute("data-hide-controls")&&!this.wrap.tfClass("lpw_play")[0]){const t=e.createElement("button");t.className="play flex tf_abs_t lpw_play",t.type="button",this.wrap.appendChild(t)}}async playVideo(t,e){if(await this.loadPrms,t||(t=this.el),t.paused){t.dataset.playing||(t.dataset.playing=1);try{await t.play()}catch(i){try{if(t.muted)throw i;t.muted=!0,await t.play()}catch(i){if(t.paused&&(this.showLowPowerControls(),e))throw i}}}}events(i){const s=this,l=i.type,a=s.el,o=s.wrap.classList;if("play"===l){s.togglePlayList(!0),o.add("playing");for(let t=e.tfTag("video"),i=t.length-1;i>-1;--i){let e=t[i];e===a||4!==e.readyState||e.paused||!0===e.muted||e.pause()}}else if("pause"===l)o.remove("playing");else if("seeking"===l||"waiting"===l||"emptied"===l){const t="seeking"===l?"seeked":"playing";o.add("wait"),a.tfOn(t,(()=>{o.remove("wait")}),{passive:!0,once:!0})}else if("playing"===l||"ended"===l)if(s.isPlayList&&"ended"===l){const e=s.wrap,i=e.tfClass("pl_sel")[0].nextElementSibling||e.tfClass("pl_v")[0];t.triggerEvent(i,n)}else o.toggle("end","ended"===l)}airPlay(){window.WebKitPlaybackTargetAvailabilityEvent&&this.el.tfOn("webkitplaybacktargetavailabilitychanged",(t=>{if("available"===t.availability){const t=e.createElement("button"),i=this.wrap.tfClass("full")[0];i&&(t.className="airplay flex",t.tfOn(n,(()=>{this.el.webkitShowPlaybackTargetPicker()}),{passive:!0}).appendChild(u("fas-airplay")),i.before(t))}}),{passive:!0,once:!0})}pip(){const t=this.el,i=e.createDocumentFragment();if(!t.hasAttribute("disablePictureInPicture")&&e.pictureInPictureEnabled){const s=e.createElement("button");s.tfOn(n,(()=>{this.pipToggle()}),{passive:!0}).className="pip flex",t.tfOn("enterpictureinpicture",(()=>{this.wrap.classList.add("tf_is_pip")}),{passive:!0}).tfOn("leavepictureinpicture",(()=>{this.wrap.classList.remove("tf_is_pip")}),{passive:!0}),s.appendChild(u("fas-external-link-alt")),i.appendChild(s)}return i}pipToggle(){const t=this.el;try{t.webkitSupportsPresentationMode?t.webkitSetPresentationMode("picture-in-picture"===t.webkitPresentationMode?"inline":"picture-in-picture"):(h(t.parentNode)&&c(),t!==e.pictureInPictureElement?t.requestPictureInPicture():e.exitPictureInPicture())}catch(t){}}fullScreenToggle(t){const i=t.target,s=this.el;if("dblclick"!==t.type||i&&!i.closest(".controls"))if(h(s.parentNode))c();else{const t=async()=>{try{await p(s.parentNode)}catch(t){try{await p(s)}catch(t){}}};e.pictureInPictureElement||"picture-in-picture"===s.webkitPresentationMode?(this.pipToggle(),l(t,80)):t()}}controls(){let s=!1,a=!0,o=e.createDocumentFragment(),f=this.el,p=_(f),c=e.createElement("div"),v=f.parentNode,d=e.createElement("div"),w=e.createElement("div"),b=e.createElement("div"),y=e.createElement("div"),m=e.createElement("div"),g=e.createElement("div"),x=e.createElement("div"),k=e.createElement("button"),P=e.createElement("button"),N=e.createElement("button"),F=e.createElement("button"),T=e.createElement("input");if(c.className="controls flex tf_abs_t tf_box tf_w",m.className="btns",d.className="pr_wr tf_textl tf_rel",w.className=b.className=T.className="tf_abs_t tf_w tf_h",w.className+=" ld",b.className+=" cur",T.className+=" pr tf_block tf_opacity",T.type="range",T.value=T.min=0,T.max=100,k.className="play flex",k.type=P.type=N.type=F.type="button",N.className="sk sk_l flex tf_opacity",F.className="sk sk_r flex tf_opacity",g.className="time",x.className="total",y.className="htime tf_abs_t flex tf_box",y.style.display="none",P.className="full flex",this.loadPrms.then((()=>{g.textContent=r(f.currentTime),x.textContent=r(f.duration),t.isTouch||d.tfOn("pointerenter",(function(){if(!isNaN(f.duration)){y.style.display="";const e=this.clientWidth,l=i(y.clientWidth/2),a=f.duration,o=o=>{const n=o.offsetX,f=t.isRTL?n+l:n-l;f>0&&n>=0&&n<=e&&(y.style.transform="translateX("+f+"px)",!1===s&&(y.textContent=r(i(n/e)*a)))};this.tfOn("pointerleave",(function(){y.style.display="none",this.tfOff("pointermove",o,{passive:!0})}),{passive:!0,once:!0}).tfOn("pointermove",o,{passive:!0})}}),{passive:!0}),T.tfOn("input",(function(){if(!isNaN(f.duration)){f.paused||!0!==a||f.pause(),s=!0;const e=parseInt(this.value),l=100===e?f.duration-1:i(e*f.duration/100).toFixed(4);f.currentTime=l,t.isTouch||(y.textContent=r(l))}}),{passive:!0}).tfOn("change",(()=>{isNaN(f.duration)||(s=a=!1,f.paused&&f.play().catch({}).finally((()=>{a=!0})))}),{passive:!0}),f.tfOn("progress",(function(){this.buffered.length>0&&(w.style.transform="scaleX("+i(this.buffered.end(0)/this.duration).toFixed(4)+")")}),{passive:!0}).tfOn("durationchange",(function(){x.textContent=r(this.duration)}),{passive:!0}).tfOn("timeupdate",(function(){if(!isNaN(this.duration)){g.textContent=r(this.currentTime);const t=i(this.currentTime/f.duration);b.style.transform="scaleX("+t.toFixed(4)+")",!1===s&&(T.value=parseInt(100*t))}}),{passive:!0})})),m.append(this.downloadBtn(),this.volumeControl(),this.pip()),!1!==p){let e=!1,i=!1;const s=()=>{a(!0),o()},a=t=>{e=!0!==e&&!0!==t,this.wrap.classList.toggle("hide_ctl",e)},o=()=>{i&&clearTimeout(i),i=l(a,3e3)};P.tfOn(n,(t=>{this.fullScreenToggle(t)}),{passive:!0}).appendChild(u("fas-expand")),t.isTouch||this.wrap.tfOn("dblclick",(t=>{this.fullScreenToggle(t)}),{passive:!0}),v.tfOn(p+"fullscreenchange",(t=>{h(t.currentTarget)?(this.wrap.classList.add("fullscreen"),v.tfOn("pointermove",s,{passive:!0}),f.tfOn("pause",s,{passive:!0}),o()):(this.wrap.classList.remove("fullscreen","hide_ctl"),i&&(clearTimeout(i),i=null),f.tfOff("pause",s,{passive:!0}),v.tfOff("pointermove",s,{passive:!0}))}),{passive:!0}),m.appendChild(P)}return d.append(w,T,b,y),c.append(k,g,d,x,m),F.innerHTML=N.innerHTML='<span class="tf_abs_c">15</span>',o.append(N,F,c),o}volumeControl(){const s=e.createElement("div"),l=e.createElement("div"),a=e.createElement("button"),o=e.createElement("input"),r=this.el,p=e.createDocumentFragment();return a.type="button",a.tfOn(n,(()=>{r.muted=!r.muted,r.muted||0!==r.volume||(o.value=50,t.triggerEvent(o,"input"))}),{passive:!0}).className="mute tf_overflow tf_rel",r.muted?a.className+=" muted":r.volume=.5,r.tfOn("volumechange",(function(){a.classList.toggle("muted",!0===this.muted||0===this.volume)}),{passive:!0}),a.append(u("fas-volume-up","tf_abs_t tf_w tf_h"),u("fas-volume-mute","tf_abs_t tf_w tf_h")),s.className="vol_wr flex tf_rel",s.appendChild(a),!1!==f&&"mobile"===t.device||(o.min=0,o.max=100,o.type="range",o.value=r.muted?0:50,o.className="vol tf_block tf_overflow tf_w tf_h",l.className="vol_in",o.tfOn("input",(function(){const t=i(this.value/100).toFixed(3);r.volume=t,r.muted=!(t>0)}),{passive:!0}),l.appendChild(o),s.appendChild(l)),p.appendChild(s),p}downloadBtn(){const t=e.createDocumentFragment(),i=e.createElement("a"),s=this.el;return s.hasAttribute("data-download")&&(i.setAttribute("download",""),i.href=s.src,i.className="download flex",i.appendChild(u("fas-download")),t.appendChild(i)),t}togglePlayList(t){this.wrap.classList.toggle("pl_hide",t)}tracks(){const t=this.el,i=this.opt.tracks,s=e.createElement("div"),a=e.createElement("div"),o=e.createElement("div"),f=e.createElement("div"),p=e.createElement("button"),c=e.createElement("button"),_=e.createDocumentFragment(),h=e.createDocumentFragment(),u=e.createDocumentFragment(),v=new IntersectionObserver(((t,i)=>{for(let s=t.length-1;s>-1;--s)if(!0===t[s].isIntersecting){let l=t[s].target,a=l.tfTag("video")[0];if(i.unobserve(l),4===a.readyState)l.tfClass("pl_dur")[0].textContent=r(a.duration);else{let t=e.createElement("div");t.className="tf_loader tf_abs_t",a.after(t),a.tfOn("durationchange",(e=>{l.tfClass("pl_dur")[0].textContent=r(e.currentTarget.duration),t.remove(),this.hoverPlay(l)}),{passive:!0,once:!0}).load()}}}),{root:a,threshold:.3}),d=()=>{requestAnimationFrame((()=>{const t=this.wrap.tfClass("pl")[0],e=t.tfClass("pl_sel")[0],i=this.el.currentSrc.replace("#t=1","")+"#t=1";let s;for(let e=t.tfTag("video"),l=e.length-1;l>-1;--l)if(i===e[l].src){s=e[l];break}if(e&&e.classList.remove("pl_sel"),s){const e=s.closest(".pl_v");t.parentNode.tfClass("pl_sel_title")[0].textContent=e.title,e.classList.add("pl_sel")}}))};o.className="pl_wr flex tf_abs_t tf_h",a.className="pl tf_w tf_h tf_box tf_abs_t tf_scrollbar",s.className="tf_playlist_current",p.className="pl_close tf_close tf_box",c.className="pl_open tf_box tf_hide",c.type=p.type="button",f.className="pl_sel_title tf_overflow";for(let s=0;s<i.length;++s)if(i[s].src){let l=i[s],a=e.createElement("div"),o=e.createElement("div"),n=e.createElement("div"),f=e.createElement("span"),r=e.createElement("span"),p=e.createElement("video"),c=l.dimensions?l.dimensions.resized||l.dimensions.original:{width:t.width,height:t.height};p.preload="none",p.width=c.width,p.height=c.height,p.src=l.src.trim()+"#t=1",p.className="tf_w tf_h",p.style.aspectRatio=c.width/c.height,p.muted=!0,!l.type||"video/quicktime"===l.type||p.canPlayType(l.type)?(a.className="pl_v tf_rel tf_box",n.className="pl_info flex tf_overflow",o.className="pl_dur tf_textc",v.observe(a),l.title&&(f.className="pl_title tf_overflow",f.textContent=a.title=l.title,n.appendChild(f)),l.caption&&(r.className="pl_cap tf_overflow",r.textContent=l.caption,n.appendChild(r)),a.append(p,n,o),_.appendChild(a)):i.slice(s,1)}else i.slice(s,1);o.tfOn(n,(e=>{e.stopPropagation();const i=e.target?.closest(".pl_v,.pl_close");if(i)if(i.classList.contains("pl_close"))this.togglePlayList(!i.closest(".pl_hide"));else{t.pause();const e=i.tfTag("video")[0];requestAnimationFrame((()=>{t.style.aspectRatio=e.style.aspectRatio,t.src=e.currentSrc.replace("#t=1",""),requestAnimationFrame((()=>{this.playVideo()}))}))}}),{passive:!0}),t.tfOn("durationchange",d,{passive:!0}),c.tfOn(n,(t=>{t.stopImmediatePropagation(),this.togglePlayList(!1)}),{passive:!0});for(let t=8;t>-1;--t){let t=e.createElement("span");t.className="tf_h tf_w",u.appendChild(t)}return c.appendChild(u),a.appendChild(_),o.append(f,p,a),h.append(c,o),4===t.readyState?l((()=>{d()}),100):t.tfOn("loadeddata",d,{passive:!0,once:!0}),h}}t.on("tf_video_init",(i=>{!1===o&&(o=t.fonts(["tf-fas-volume-mute","tf-fas-download","tf-fas-volume-up","tf-fas-external-link-alt","tf-fas-airplay","tf-fas-expand"]));for(let t=i.length-1;t>-1;--t){let s,o=i[t],n=o.parentNode,f=n.parentNode;if(n.tfClass("tf_vd_root")[0]===a){if(f?.classList.contains("wp-video-playlist")){let t=f.tfClass("tf-playlist-script")[0]||f.tfClass("wp-playlist-script")[0];if(t)try{s=JSON.parse(t.textContent),"video"!==s.type&&(s=!1)}catch(t){s=!1}}if(!o.hasAttribute("src")&&!o.tfTag("source")[0]){if(!s?.tracks)continue;let t=s.tracks[0].src;if(!t)for(let e=1,i=s.tracks.length;e<i;++e)if(s.tracks[e].src){t=s.tracks[e].src;break}if(!t)continue;o.src=t}if(!n.classList.contains("tf_vd_lazy")){const t=e.createElement("div");t.className="tf_vd_lazy tf_w tf_h tf_box tf_rel tf_overflow tf_lazy",t.appendChild(o),n.appendChild(t)}queueMicrotask((()=>{l((()=>{new v(o,s)}),0)}))}}}))})(Themify,document,parseFloat,Promise,setTimeout,void 0);