PageSourceSearch

https://powerengines.com/cdn/shop/t/27/assets/video-background.js?v=120307811945559553931781092642

js powerengines.com collected 2026-10-02 19:40:38 UTC 3,627 bytes, 2 lines download raw bytes

1customElements.get("video-background")||customElements.define("video-background",class VideoBackground extends HTMLElement{constructor(){super(),this.observer=null,this.intersecting=!1,this.videoLoaded=!1}connectedCallback(){this.videoType=this.dataset.type,this.videoId=this.dataset.videoId,this.sectionId=this.dataset.sectionId,this.videoElement=this.querySelector(`#${this.sectionId}-video-player`),this.videoLoaderElement=this.querySelector(".video-background-loader"),this.videoPlayerWrapper=this.querySelector(".video-background-player"),this.observer=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&!this.intersecting&&(this.intersecting=!0,this.initializeVideo(),observer.unobserve(this))})},{rootMargin:"200px"}),this.observer.observe(this)}initializeVideo(){switch(this.videoType){case"self-hosted":this.initializeSelfHostedVideo();break;case"youtube":VideoBackground.loadYouTube(),this.initializeYouTube();break;case"vimeo":VideoBackground.loadVimeo(),this.initializeVimeo();break}}initializeSelfHostedVideo(){const player=this.querySelector("video");if(!player)return;this.videoLoaded||this.loadVideoSources(player);const isVideoPlaying=player.currentTime>0&&!player.paused&&!player.ended&&player.readyState>2;isVideoPlaying&&this.showPlayer(),player.addEventListener("loadstart",()=>{this.videoLoaderElement.classList.remove("is-hidden")}),player.addEventListener("canplay",()=>{isVideoPlaying||player.play().catch(error=>{console.warn("Video autoplay failed:",error)})}),player.addEventListener("playing",()=>{this.showPlayer()}),player.addEventListener("error",()=>{console.error("Video failed to load"),this.videoLoaderElement.classList.add("is-hidden"),this.setAttribute("data-loaded","error")})}loadVideoSources(player){player.querySelectorAll("source[data-src]").forEach(source=>{source.src=source.dataset.src,source.removeAttribute("data-src")}),player.load(),this.videoLoaded=!0}initializeYouTube(){if(typeof YT>"u"||typeof YT.Player>"u")return setTimeout(()=>{this.initializeYouTube()},333);new YT.Player(`${this.sectionId}-video-player`,{videoId:this.videoId,playerVars:{autoplay:1,controls:0,showinfo:0,modestbranding:0,loop:1,playlist:this.videoId,fs:0,autohide:0,mute:1,playsinline:1},events:{onReady:event=>{event.target.mute(),event.target.playVideo(),setTimeout(()=>{this.showPlayer()},1e3)},onStateChange:event=>{event.data===YT.PlayerState.PLAYING&&this.showPlayer()}}})}initializeVimeo(){if(typeof Vimeo>"u"||typeof Vimeo.Player>"u")return setTimeout(()=>{this.initializeVimeo()},333);const player=new Vimeo.Player(this.videoElement,{id:this.videoId,loop:!0,autoplay:!0,byline:!1,title:!1,autopause:!1,muted:!0,playsinline:!0,controls:!1,background:!0});player.setVolume(0),player.on("play",()=>{this.showPlayer()})}showPlayer(){this.videoPlayerWrapper.classList.add("visible"),this.videoLoaderElement.classList.add("is-hidden"),this.setAttribute("data-loaded","true")}static loadYouTube(){if(window.TFP_YOUTUBE_LOADED)return;window.TFP_YOUTUBE_LOADED=!0;const tag=document.createElement("script"),[firstScriptTag]=document.getElementsByTagName("script");tag.src="https://www.youtube.com/player_api",firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}static loadVimeo(){if(window.TFP_VIMEO_LOADED)return;window.TFP_VIMEO_LOADED=!0;const tag=document.createElement("script"),[firstScriptTag]=document.getElementsByTagName("script");tag.src="https://player.vimeo.com/api/player.js",firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}});
2//# sourceMappingURL=/cdn/shop/t/27/assets/video-background.js.map?v=120307811945559553931781092642

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.