Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/modules/video-player.min.js
Назад
((E,C)=>{"use strict";let r=!1;const x=E.click,o=/iPhone|iPad|iPod|Mac OS/i.test(window.navigator.userAgent),l="tf_video_",k=e=>{e=1/0===e?0:e;const t=new Date(1e3*e).toISOString().substr(11,8).split(":");return"00"===t[0]&&t.splice(0,1),t.join(":")},i=e=>e.requestFullscreen?e.requestFullscreen():e.mozRequestFullscreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.webkitEnterFullscreen?e.webkitEnterFullscreen():Promise.reject(),n=()=>{try{return C.exitFullscreen?C.exitFullscreen():C.webkitExitFullscreen?C.webkitExitFullscreen():C.mozCancelFullScreen?C.mozCancelFullScreen():C.cancelFullScreen?C.cancelFullScreen():!!C.msExitFullscreen&&C.msExitFullscreen()}catch(e){return!1}},F=e=>C.exitFullscreen?"":C.webkitExitFullscreen||e.webkitSupportsFullscreen?"webkit":C.mozCancelFullScreen?"moz":!!C.msExitFullscreen&&"ms",T=e=>{const t=F(e);return!1!==t&&(e.hasOwnProperty("webkitDisplayingFullscreen")?e.webkitDisplayingFullscreen:""===t?C.fullscreenElement:C[t+"FullscreenElement"])},P=(e,t)=>{const s="http://www.w3.org/2000/svg",a=C.createElementNS(s,"use"),i=C.createElementNS(s,"svg");return e="tf-"+e,t=t?e+" "+t:e,i.setAttribute("class","tf_fa "+t),a.setAttributeNS(null,"href","#"+e),i.appendChild(a),i},c=e=>{const a=l+e+"=";for(let t=C.cookie.split(";"),s=t.length-1;-1<s;--s){let e=t[s];while(" "===e[0])e=e.substring(1,e.length);if(0===e.indexOf(a))return e.substring(a.length,e.length)}return null},O=(e,t,s)=>{let a="";if(e=l+e,s){const i=new Date;i.setTime(i.getTime()+864e5*s),a=";expires="+i.toUTCString()}C.cookie=e+"="+(t||"")+a+";SameSite=strict;path=/"},L=e=>E.hash(e.currentSrc.split(".").slice(0,-1).join("."));class p{constructor(t,e){const s=C.createElement("div");this.wrap=C.createElement("div"),s.className="tf_vd_root",this.wrap.className="wrap tf_abs_t tf_w tf_h",s.attachShadow({mode:"open"}).appendChild(this.wrap),this.el=t,this.opt=e,this.isPlayList=this.opt&&this.opt.tracks,this.loadPrms=new Promise(e=>{t.readyState<3?E.requestIdleCallback(()=>{t.tfOn("canplay",e,{passive:!0,once:!0}).load()},-1,200):e()}),this.init()}init(){const e=this.el,t=parseFloat(c(L(e)))||0,s=C.createDocumentFragment(),a=this.wrap.getRootNode().host,i=e.parentNode,l=C.createElement("div"),n=C.createElement("button");this.wrap.style.display="none",l.className="tf_loader tf_abs_c tf_hide",n.className="play flex big_btn tf_abs_c",n.type="button",i.tabIndex=0,e.hasAttribute("data-hide-controls")||s.append(n,this.controls()),s.appendChild(l),this.isPlayList&&s.appendChild(this.tracks()),requestAnimationFrame(async()=>{0<t&&t<e.duration&&(e.currentTime=t),e.setAttribute("webkit-playsinline","1"),e.setAttribute("playsinline","1"),e.removeAttribute("controls"),this.wrap.appendChild(s),i.appendChild(a),await Promise.all([this.loadPrms,E.loadCss(E.url+"css/base.min","tf_base",null,this.wrap),E.loadCss("video","tf_video",null,this.wrap),r]),e.hasAttribute("data-hide-controls")||this.wrap.appendChild(C.tfId("tf_svg").cloneNode(!0)),e.tfOn("seeking waiting emptied pause play playing ended",e=>{this.events(e)},{passive:!0}),this.wrap.tfOn(x,e=>{this.click(e)},{passive:!0}),!this.isPlayList&&e.dataset.hoverPlay?(n.style.pointerEvents="none",this.hoverPlay()):e.dataset.autoplay&&this.playVideo(),o?(this.airPlay(),setTimeout(()=>{const t=this.wrap.tfTag("svg");for(let e=t.length-1;-1<e;--e)t[e].innerHTML=t[e].innerHTML;this.wrap.style.display="",i.classList.remove("tf_lazy")},100)):(this.wrap.style.display="",i.classList.remove("tf_lazy"))})}click(e){const t=e.target,s=t.closest(".sk"),a=this.el,i=this.wrap.classList;e.stopImmediatePropagation(),t.closest(".controls")&&!t.classList.contains("play")||(a.paused||!E.isTouch||t.classList.contains("play")||!s&&t.classList.contains("show")?(i.remove("show"),a.paused?this.playVideo():a.pause()):(i.add("show"),i.remove("hide_ctl"),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>{i.remove("show"),this.timeout=null},2500),s&&(a.currentTime+=s.classList.contains("sk_l")?-15:15)))}hoverPlay(e){const s=(e=e||this.wrap).tfTag("video")[0]||this.el,t=async t=>{if(!C.fullscreenElement||t.closest(".pl_v")){try{await this.playVideo(s,!0)}catch(e){}t.tfOn("mouseleave",e=>{s.paused||C.fullscreenElement&&!t.closest(".pl_v")||(s.pause(),s.currentTime=0)},{passive:!0,once:!0})}};e.tfOn("mouseenter",e=>{t(e.currentTarget)},{passive:!0}),(s.dataset.forceplay||e.matches(":hover"))&&t(e)}showLowPowerControls(){if(this.el.hasAttribute("data-hide-controls")&&!this.wrap.tfClass("lpw_play")[0]){const e=C.createElement("button");e.className="play flex tf_abs_t lpw_play",e.type="button",this.wrap.appendChild(e)}}async playVideo(t,s){if(await this.loadPrms,(t=t||this.el).paused){t.dataset.playing||(t.dataset.playing=1);try{await t.play()}catch(e){try{if(t.muted)throw e;t.muted=!0,await t.play()}catch(e){if(t.paused&&(this.showLowPowerControls(),s))throw e}}}}events(e){const t=e.type,s=this.el,a=this.wrap.classList;if("play"===t){this.togglePlayList(!0),a.add("playing");for(let e=C.tfTag("video"),t=e.length-1;-1<t;--t)e[t]===s||4!==e[t].readyState||e[t].paused||!0===e[t].muted||e[t].pause()}else if("pause"===t)a.remove("playing");else if("seeking"===t||"waiting"===t||"emptied"===t){const i="seeking"===t?"seeked":"playing";a.add("wait"),s.tfOn(i,()=>{a.remove("wait")},{passive:!0,once:!0})}else if("playing"===t||"ended"===t)if(this.isPlayList&&"ended"===t){const l=this.wrap,n=l.tfClass("pl_sel")[0].nextElementSibling||l.tfClass("pl_v")[0];E.triggerEvent(n,x)}else a.toggle("end","ended"===t)}airPlay(){window.WebKitPlaybackTargetAvailabilityEvent&&this.el.tfOn("webkitplaybacktargetavailabilitychanged",e=>{if("available"===e.availability){const t=C.createElement("button"),s=this.wrap.tfClass("full")[0];s&&(t.className="airplay flex",t.tfOn(x,()=>{this.el.webkitShowPlaybackTargetPicker()},{passive:!0}).appendChild(P("fas-airplay")),s.before(t))}},{passive:!0,once:!0})}pip(){const e=this.el,t=C.createDocumentFragment();if(!e.hasAttribute("disablePictureInPicture")&&C.pictureInPictureEnabled){const s=C.createElement("button");s.tfOn(x,e=>{this.pipToggle()},{passive:!0}).className="pip flex",e.tfOn("enterpictureinpicture",()=>{this.wrap.classList.add("tf_is_pip")},{passive:!0}).tfOn("leavepictureinpicture",()=>{this.wrap.classList.remove("tf_is_pip")},{passive:!0}),s.appendChild(P("fas-external-link-alt")),t.appendChild(s)}return t}pipToggle(){const e=this.el;try{e.webkitSupportsPresentationMode?e.webkitSetPresentationMode("picture-in-picture"===e.webkitPresentationMode?"inline":"picture-in-picture"):(T(e.parentNode)&&n(),e!==C.pictureInPictureElement?e.requestPictureInPicture():C.exitPictureInPicture())}catch(e){}}fullScreenToggle(e){const t=e.target,s=this.el;if("dblclick"!==e.type||t&&!t.closest(".controls"))if(T(s.parentNode))n(s);else{const a=async()=>{try{await i(s.parentNode)}catch(e){try{await i(s)}catch(e){}}};C.pictureInPictureElement||"picture-in-picture"===s.webkitPresentationMode?(this.pipToggle(),setTimeout(a,80)):a()}}controls(){let n=!1,a=!0;const e=C.createDocumentFragment(),r=this.el,i=F(r),t=L(r),s=C.createElement("div"),l=r.parentNode,o=C.createElement("div"),c=C.createElement("div"),p=C.createElement("div"),d=C.createElement("div"),f=C.createElement("div"),u=C.createElement("div"),h=C.createElement("div"),m=C.createElement("button"),v=C.createElement("button"),_=C.createElement("button"),y=C.createElement("button"),w=C.createElement("input");if(s.className="controls flex tf_abs_t tf_box tf_w",f.className="btns",o.className="pr_wr tf_textl tf_rel",c.className=p.className=w.className="tf_abs_t tf_w tf_h",c.className+=" ld",p.className+=" cur",w.className+=" pr tf_block tf_opacity",w.type="range",w.value=w.min=0,w.max=100,m.className="play flex",m.type=v.type=_.type=y.type="button",_.className="sk sk_l flex tf_opacity",y.className="sk sk_r flex tf_opacity",u.className="time",h.className="total",d.className="htime tf_abs_t flex tf_box",d.style.display="none",v.className="full flex",this.loadPrms.then(()=>{u.textContent=k(r.currentTime),h.textContent=k(r.duration),E.isTouch||o.tfOn("pointerenter",function(e){if(!isNaN(r.duration)){d.style.display="";const a=this.clientWidth,i=parseFloat(d.clientWidth/2),l=r.duration,t=e=>{const t=void 0!==e.layerX?e.layerX:e.offsetX,s=E.isRTL?t+i:t-i;0<s&&0<=t&&t<=a&&(d.style.transform="translateX("+s+"px)",!1===n)&&(d.textContent=k(parseFloat(t/a)*l))};this.tfOn("pointerleave",function(){d.style.display="none",this.tfOff("pointermove",t,{passive:!0})},{passive:!0,once:!0}).tfOn("pointermove",t,{passive:!0})}},{passive:!0}),w.tfOn("input",function(e){if(!isNaN(r.duration)){r.paused||!0!==a||r.pause(),n=!0;const t=parseInt(this.value),s=100===t?r.duration-1:parseFloat(t*r.duration/100).toFixed(4);r.currentTime=s,E.isTouch||(d.textContent=k(s))}},{passive:!0}).tfOn("change",e=>{isNaN(r.duration)||(n=a=!1,r.paused&&r.play().catch({}).finally(()=>{a=!0}))},{passive:!0}),r.tfOn("progress",function(){0<this.buffered.length&&(c.style.transform="scaleX("+parseFloat(this.buffered.end(0)/this.duration).toFixed(4)+")")},{passive:!0}).tfOn("durationchange",function(){h.textContent=k(this.duration)},{passive:!0}).tfOn("timeupdate",function(){if(!isNaN(this.duration)){u.textContent=k(this.currentTime);const e=parseFloat(this.currentTime/r.duration);p.style.transform="scaleX("+e.toFixed(4)+")",!1===n&&(w.value=parseInt(100*e)),O(t,this.currentTime,30)}},{passive:!0})}),f.append(this.downloadBtn(),this.volumeControl(),this.pip()),!1!==i){let t=!1,s=!1;const g=()=>{b(!0),N()},b=e=>{t=!0!==t&&!0!==e,this.wrap.classList.toggle("hide_ctl",t)},N=()=>{s&&clearTimeout(s),s=setTimeout(b,3e3)};v.tfOn(x,e=>{this.fullScreenToggle(e)},{passive:!0}).appendChild(P("fas-expand")),E.isTouch||this.wrap.tfOn("dblclick",e=>{this.fullScreenToggle(e)},{passive:!0}),l.tfOn(i+"fullscreenchange",e=>{T(e.currentTarget)?(this.wrap.classList.add("fullscreen"),l.tfOn("pointermove",g,{passive:!0}),r.tfOn("pause",g,{passive:!0}),N()):(this.wrap.classList.remove("fullscreen","hide_ctl"),s&&(clearTimeout(s),s=null),r.tfOff("pause",g,{passive:!0}),l.tfOff("pointermove",g,{passive:!0}))},{passive:!0}),f.appendChild(v)}return o.append(c,w,p,d),s.append(m,u,o,h,f),y.innerHTML=_.innerHTML='<span class="tf_abs_c">15</span>',e.append(_,y,s),e}volumeControl(){const e=C.createElement("div"),t=C.createElement("div"),s=C.createElement("button"),a=C.createElement("input"),i=this.el,l=L(i),n=c("vol_"+l)||-1,r=C.createDocumentFragment();return s.type="button",n?i.volume=-1<n?n:.5:i.muted=0,s.className="mute tf_overflow tf_rel",i.muted&&(s.className+=" muted"),s.tfOn(x,()=>{i.muted=!i.muted,i.muted||0!==i.volume||(a.value=50,E.triggerEvent(a,"input"))},{passive:!0}),i.tfOn("volumechange",function(){s.classList.toggle("muted",!0===this.muted||0===this.volume),O("vol_"+l,this.volume,120)},{passive:!0}),s.append(P("fas-volume-up","tf_abs_t tf_w tf_h"),P("fas-volume-mute","tf_abs_t tf_w tf_h")),e.className="vol_wr flex tf_rel",e.appendChild(s),!1!==o&&"mobile"===E.device||(a.min=0,a.max=100,a.type="range",a.value=-1<n?100*n:50,a.className="vol tf_block tf_overflow tf_w tf_h",t.className="vol_in",a.tfOn("input",function(e){const t=parseFloat(this.value/100).toFixed(3);i.volume=t,i.muted=!(0<t)},{passive:!0}),t.appendChild(a),e.appendChild(t)),r.appendChild(e),r}downloadBtn(){const e=C.createDocumentFragment(),t=C.createElement("a"),s=this.el;return s.hasAttribute("data-download")&&(t.setAttribute("download",""),t.href=s.src,t.className="download flex",t.appendChild(P("fas-download")),e.appendChild(t)),e}togglePlayList(e){this.wrap.classList.toggle("pl_hide",e)}tracks(){const o=this.el,c=this.opt.tracks,e=C.createElement("div"),t=C.createElement("div"),s=C.createElement("div"),a=C.createElement("div"),i=C.createElement("button"),l=C.createElement("button"),p=C.createDocumentFragment(),n=C.createDocumentFragment(),r=C.createDocumentFragment(),d=new IntersectionObserver((a,i)=>{for(let t=a.length-1;-1<t;--t)if(!0===a[t].isIntersecting){let s=a[t].target,e=s.tfTag("video")[0];if(i.unobserve(s),4===e.readyState)s.tfClass("pl_dur")[0].textContent=k(e.duration);else{let t=C.createElement("div");t.className="tf_loader tf_abs_t",e.after(t),e.tfOn("durationchange",e=>{s.tfClass("pl_dur")[0].textContent=k(e.currentTarget.duration),t.remove(),this.hoverPlay(s)},{passive:!0,once:!0}).load()}}},{root:t,threshold:.3}),f=()=>{requestAnimationFrame(()=>{const s=this.wrap.tfClass("pl")[0],e=s.tfClass("pl_sel")[0],a=this.el.currentSrc.replace("#t=1","")+"#t=1";let i;for(let e=s.tfTag("video"),t=e.length-1;-1<t;--t)if(a===e[t].src){i=e[t];break}if(e&&e.classList.remove("pl_sel"),i){const t=i.closest(".pl_v");s.parentNode.tfClass("pl_sel_title")[0].textContent=t.title,t.classList.add("pl_sel")}})};s.className="pl_wr flex tf_abs_t tf_h",t.className="pl tf_w tf_h tf_box tf_abs_t tf_scrollbar",e.className="tf_playlist_current",i.className="pl_close tf_close tf_box",l.className="pl_open tf_box tf_hide",l.type=i.type="button",a.className="pl_sel_title tf_overflow";for(let r=0,e=c.length;r<e;++r)if(c[r].src){c[r].src=c[r].src.trim();let e=C.createElement("div"),t=C.createElement("div"),s=C.createElement("div"),a=C.createElement("span"),i=C.createElement("span"),l=C.createElement("video"),n=c[r].dimensions?c[r].dimensions.resized||c[r].dimensions.original:{width:o.width,height:o.height};l.preload="none",l.width=n.width,l.height=n.height,l.src=c[r].src+"#t=1",l.className="tf_w tf_h",l.style.aspectRatio=n.width/n.height,l.muted=!0,!c[r].type||l.canPlayType(c[r].type)?(e.className="pl_v tf_rel tf_box",s.className="pl_info flex tf_overflow",t.className="pl_dur tf_textc",d.observe(e),c[r].title&&(a.className="pl_title tf_overflow",a.textContent=e.title=c[r].title,s.appendChild(a)),c[r].caption&&(i.className="pl_cap tf_overflow",i.textContent=c[r].caption,s.appendChild(i)),e.append(l,s,t),p.appendChild(e)):c.slice(r,1)}else c.slice(r,1);s.tfOn(x,e=>{e.stopPropagation();const t=e.target?.closest(".pl_v,.pl_close");if(t)if(t.classList.contains("pl_close"))this.togglePlayList(!t.closest(".pl_hide"));else{o.pause();const s=t.tfTag("video")[0];requestAnimationFrame(()=>{o.style.aspectRatio=s.style.aspectRatio,o.src=s.currentSrc.replace("#t=1",""),requestAnimationFrame(()=>{this.playVideo()})})}},{passive:!0}),o.tfOn("durationchange",f,{passive:!0}),l.tfOn(x,e=>{e.stopImmediatePropagation(),this.togglePlayList(!1)},{passive:!0});for(let e=8;-1<e;--e){let e=C.createElement("span");e.className="tf_h tf_w",r.appendChild(e)}return l.appendChild(r),t.appendChild(p),s.append(a,i,t),n.append(l,s),4===o.readyState?setTimeout(()=>{f()},100):o.tfOn("loadeddata",f,{passive:!0,once:!0}),n}}E.on("tf_video_init",l=>{!1===r&&(r=E.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 i=(l=void 0===l.length?[l]:l).length-1;-1<i;--i){let e=l[i],t=e.parentNode,s=t.parentNode,a;if(s.classList.contains("wp-video-playlist")){let e=s.tfClass("tf-playlist-script")[0]||s.tfClass("wp-playlist-script")[0];if(e)try{"video"!==(a=JSON.parse(e.textContent)).type&&(a=!1)}catch(e){a=!1}}if(!e.hasAttribute("src")&&!e.tfTag("source")[0]){if(!a?.tracks)continue;let s=a.tracks[0].src;if(!s)for(let e=1,t=a.tracks.length;e<t;++e)if(a.tracks[e].src){s=a.tracks[e].src;break}if(!s)continue;e.src=s}if(!t.classList.contains("tf_vd_lazy")){const n=C.createElement("div");n.className="tf_vd_lazy tf_w tf_h tf_box tf_rel tf_overflow tf_lazy",n.appendChild(e),t.appendChild(n)}new p(e,a)}})})(Themify,document);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка