PageSourceSearch

https://www.lobkowicz.cz/_nuxt/CxgjYRQe.js

js lobkowicz.cz collected 2026-10-02 10:37:29 UTC 4,856 bytes, 2 lines download raw bytes

1import{_ as a}from"./DOVfzyYL.js";import{d,g as h,h as l,ak as c,a as p,o as u,n as v,e as i,v as g}from"./TvATKHO3.js";class _{container;video;progressBar;progressBarLine;playBtn;playOnClick;fullscreenBreakpoint;cursorHidingTimeout;scrubbing;playing;constructor(e,s=!1,t=768){this.container=e,this.video=this.container.querySelector("video"),this.progressBar=this.container.querySelector(".video__progress"),this.progressBarLine=this.progressBar?.children[0],this.playBtn=this.container.querySelector(".video__play"),this.playOnClick=s,this.fullscreenBreakpoint=t,this.cursorHidingTimeout=null,this.scrubbing=!1,this.playing=!1,this._setupHandlers()}_setupHandlers(){if(!this.video||!this.playBtn){console.error("Failed to setup video player, required elements not found.");return}this.playBtn.addEventListener("click",this._onPlayClick.bind(this),{passive:!0}),this.container.addEventListener("click",this._onContainerClick.bind(this),{passive:!0}),this.container.addEventListener("dblclick",()=>this.video?.requestFullscreen(),{passive:!0}),this.container.addEventListener("taphold",()=>this.video?.requestFullscreen(),{passive:!0}),this.video.addEventListener("timeupdate",this._onTimeUpdate.bind(this),{passive:!0}),this.video.addEventListener("ended",this._onVideoEnded.bind(this),{passive:!0}),this.video.addEventListener("play",this._onPlay.bind(this),{passive:!0}),this.video.addEventListener("pause",this._onPause.bind(this),{passive:!0}),this.progressBar&&(this.progressBar.addEventListener("pointerdown",this._onProgressBarMouseDown.bind(this),{passive:!0}),this.progressBar.addEventListener("pointerup",this._onProgressBarMouseUp.bind(this),{passive:!0}),this.progressBar.addEventListener("pointermove",this._onProgressBarMove.bind(this),{passive:!0}),this.progressBar.addEventListener("click",this._onProgressBarClick.bind(this),{passive:!0})),this.container.addEventListener("mousemove",this._onContainerMouseMove.bind(this),{passive:!0})}_onPlayClick(e){e.stopPropagation(),this.playing?this.pause():this.play(),!this.playing&&window.innerWidth<this.fullscreenBreakpoint&&this.video?.requestFullscreen()}_onContainerClick(){this.playing?this.pause():this.playOnClick&&this.play()}_onTimeUpdate(){if(this.video&&this.progressBarLine){const e=this.video.currentTime/this.video.duration*100;this.progressBarLine.style.backgroundSize=`${e}% 100%`}}_onVideoEnded(){this.pause(),this.video&&(this.video.currentTime=0)}_onProgressBarMouseDown(){this.scrubbing=!0}_onProgressBarMouseUp(){this.scrubbing=!1}_onProgressBarClick(e){e.stopPropagation(),this.scrub((this.video?.duration||0)*e.offsetX/(this.progressBar?.offsetWidth||1))}_onProgressBarMove(e){this.scrubbing&&this.scrub((this.video?.duration||0)*e.offsetX/(this.progressBar?.offsetWidth||1))}_onContainerMouseMove(){this.cursorHidingTimeout&&clearTimeout(this.cursorHidingTimeout),this.container.classList.remove("video--fade-controls"),this.cursorHidingTimeout=window.setTimeout(()=>{this.container.classList.add("video--fade-controls"),this.cursorHidingTimeout=null},1500)}_onPlay(){this.container.classList.add("video--initialized"),this.container.classList.add("video--playing"),this.playing=!0}_onPause(){this.container.classList.remove("video--playing"),this.playing=!1}play(){this.video&&this.video.play()}pause(){this.video&&this.video.pause()}scrub(e){if(!this.video||!this.progressBarLine)return;const s=e/this.video.duration*100;this.progressBarLine.style.backgroundSize=`${s}%`,this.video.currentTime=e}deactivate(){!this.video||!this.progressBar||!this.playBtn||(this.pause(),this.playBtn.removeEventListener("click",this._onPlayClick),this.container.removeEventListener("click",this._onContainerClick),this.video.removeEventListener("timeupdate",this._onTimeUpdate),this.video.removeEventListener("ended",this._onVideoEnded),this.progressBar.removeEventListener("pointerdown",this._onProgressBarMouseDown),this.progressBar.removeEventListener("pointerup",this._onProgressBarMouseUp),this.progressBar.removeEventListener("pointermove",this._onProgressBarMove),this.progressBar.removeEventListener("click",this._onProgressBarClick),this.container.removeEventListener("mousemove",this._onContainerMouseMove))}}const m=["src"],B={class:"video__controls"},y={class:"video__play"},k=d({__name:"VideoPlayer",props:{url:{},disableControls:{type:Boolean}},setup(r){const e=r,s=h();let t=null;return l(()=>{s.value&&(t=new _(s.value,!0))}),c(()=>{t?.deactivate()}),(f,o)=>{const n=a;return u(),p("div",{ref_key:"container",ref:s,class:v(["video",{disabled:e.disableControls}])},[i("video",{src:e.url+"#t=0.1",preload:"metadata",playsinline:"",disablepictureinpicture:""},null,8,m),i("div",B,[i("button",y,[g(n,{name:"play"})]),o[0]||(o[0]=i("div",{class:"video__progress"},[i("div",{class:"video__progress-line"})],-1))])],2)}}});
1export{k as _};
2//# sourceMappingURL=CxgjYRQe.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.