1class YoutubePreroll{constructor(youtubeIframe,vastUrls){this.youtubeIframe=youtubeIframe,this.vastUrls=vastUrls,this.vastUrlIndex=0,this.adVolume=0,this.prerollWidth=480,this.prerollHeight=320,this.prerollLastError=303,this.prerollPaused=!1,this.observerToWatchActiveView=null,this.boundOnListableButtonClick=this.onListableButtonClick.bind(this)}initPreroll(){var prerollWrap=document.createElement("div");prerollWrap.classList.add("iinfo-preroll-position"),prerollWrap.innerHTML=` 2 <div class="iinfo-preroll-position" style="position: relative;"> 3 <div class="preroll-container-iframe"> 4 <iframe class="preroll-iframe" width="1920" height="1080" scrolling="no" allow="autoplay"></iframe> 5 </div> 6 </div> 7 `,this.youtubeIframe.after(prerollWrap);let prerollIframe=(this.prerollPosition=prerollWrap).querySelector(".preroll-iframe");prerollIframe.srcdoc='<html lang="cs"><body><div id="videoContent"><video id="contentElement" webkit-playsinline="true" playsinline="true" style="display: none"><source src="https://i.iinfo.cz/files/iinfo/626/cerne-video.mp4"></video></div><div id="adContainer"><button id="adMuteBtn"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path d="M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"/></svg></button></div></body></html>',prerollIframe.onload=()=>this.setupIframe(prerollIframe.contentWindow.document),this.prerollContainer=document.getElementsByClassName("preroll-container-iframe")[0]}setupIframe(doc){this.prerollDocument=doc;var el=this.prerollDocument.createElement("style"),el=(el.innerText="#adContainer>div:nth-of-type(1),#adContainer>div:nth-of-type(1) > iframe { width: 99% !important;height: 99% !important;max-width: 100%;}#videoContent,body{ width:100vw;height:100vh}body{ font-family:'Helvetica Neue',Arial,sans-serif}#videoContent{ overflow:hidden;background:#000}#adMuteBtn{ width:35px;height:35px;border:0;background:0 0;display:none;position:absolute;fill:rgba(230,230,230,1);bottom:20px;right:25px}",this.prerollDocument.head.appendChild(el),this.videoContent=this.prerollDocument.getElementById("contentElement"),this.videoContent.style.display="none",this.videoContent.volume=1,this.videoContent.muted=!1,this.videoContent.play());void 0!==el&&el.then(()=>{console.log("PREROLL sound allowed"),this.videoContent.volume=1,this.videoContent.muted=!1,this.setUpIMA()}).catch(()=>{console.log("PREROLL sound forbidden"),this.videoContent.volume=0,this.videoContent.muted=!0,this.setUpIMA()}),doc.getElementById("adMuteBtn").addEventListener("click",this.unmutePrerollAdvert.bind(this))}setupDimensions(){this.prerollWidth=Math.min(this.prerollPosition.offsetWidth,480),this.prerollHeight=Math.min(this.prerollPosition.offsetHeight,320)}setUpIMA(){google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),google.ima.settings.setLocale("cs"),google.ima.settings.setNumRedirects(10),this.createAdDisplayContainer(),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,adsManagerLoadedEvent=>this.onAdsManagerLoaded(adsManagerLoadedEvent),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,adErrorEvent=>this.onAdError(adErrorEvent),!1),this.videoContent.onended=()=>{this.adsLoader.contentComplete()};var adsRequest=new google.ima.AdsRequest;adsRequest.adTagUrl=this.vastUrls[this.vastUrlIndex],console.log("Preroll advert: "+this.vastUrls[this.vastUrlIndex]),this.videoContent.muted=!1,this.videoContent.volume=1,adsRequest.nonLinearAdSlotWidth=0,adsRequest.nonLinearAdSlotHeight=0,this.adsLoader.requestAds(adsRequest)}createAdDisplayContainer(){this.prerollDocument.getElementById("videoContent").style.display="none",this.adDisplayContainer=new google.ima.AdDisplayContainer(this.prerollDocument.getElementById("adContainer"),this.videoContent)}unmutePrerollAdvert(){this.adVolume=!this.adVolume,this.adVolume?(this.adsManager.setVolume(.3),this.prerollDocument.getElementById("adMuteBtn").innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path d="M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"/></svg>'):(this.adsManager.setVolume(0),this.prerollDocument.getElementById("adMuteBtn").innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path d="M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"/></svg>')}onAdsManagerLoaded(adsManagerLoadedEvent){var adsRenderingSettings=new google.ima.AdsRenderingSettings;adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,adsRenderingSettings.loadVideoTimeout=12e3,this.adsManager=adsManagerLoadedEvent.getAdsManager(this.videoContent,adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,adErrorEvent=>this.onAdError(adErrorEvent)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,()=>this.onContentPauseRequested()),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,()=>this.onContentResumeRequested()),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,adEvent=>this.onAdEvent(adEvent)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,adEvent=>this.onAdEvent(adEvent)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,adEvent=>this.onAdEvent(adEvent)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,adEvent=>this.onAdEvent(adEvent)),this.playAds()}playAds(){this.videoContent.load(),this.adDisplayContainer.initialize();try{this.adsManager.init(1920,1080,google.ima.ViewMode.NORMAL),this.adsManager.start()}catch(adError){}}onAdEvent(adEvent){var ad=adEvent.getAd();console.log("Preroll event: "+adEvent.type);let intervalTimer=null;switch(adEvent.type){case google.ima.AdEvent.Type.LOADED:ad.isLinear()||this.videoContent.play(),this.prerollDocument.getElementById("adContainer").style.width="100%",this.prerollDocument.getElementById("adContainer").style.maxWidth="640px",this.prerollDocument.getElementById("adContainer").style.height="360px";break;case google.ima.AdEvent.Type.STARTED:this.continuouslyWatchActiveView(),document.querySelectorAll(".listable-text-nav-prev, .listable-text-nav-next").forEach(el=>{el.addEventListener("click",this.boundOnListableButtonClick)}),ad.isLinear()&&(intervalTimer=setInterval(function(){},300)),this.prerollDocument.getElementById("adMuteBtn").style.display="block";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:case google.ima.AdEvent.Type.COMPLETE:this.observerToWatchActiveView&&this.observerToWatchActiveView.disconnect(),ad.isLinear()&&clearInterval(intervalTimer),this.playYtVideo()}}onAdError(adErrorEvent){console.log(adErrorEvent.getError()),this.prerollLastError=adErrorEvent.getError().getErrorCode(),this.loadNext()||this.playYtVideo()}loadNext(){return this.vastUrlIndex++,this.vastUrlIndex<this.vastUrls.length&&(this.prerollPosition.remove(),this.initPreroll(),this.adVolume=1,!0)}onContentPauseRequested(){this.videoContent.pause()}onContentResumeRequested(){this.videoContent.play()}continuouslyWatchActiveView(){this.prerollContainer?(this.observerToWatchActiveView=new IntersectionObserver(entries=>
7{entries.forEach(entry=>{entry.isIntersecting?this.prerollPaused&&(this.adsManager.resume(),this.prerollPaused=!1):this.prerollPaused||(this.adsManager.pause(),this.prerollPaused=!0)})},{root:document.body,rootMargin:"0px",scrollMargin:"0px",threshold:0}),this.observerToWatchActiveView.observe(this.prerollContainer)):console.warn("prerollContainer not found :(")}onListableButtonClick(){this.prerollContainer&&!this.prerollPaused&&(this.adsManager.pause(),this.prerollPaused=!0)}playYtVideo(){this.prerollPosition.remove(),this.youtubeIframe.style.display="block",this.youtubeIframe.allow="autoplay; encrypted-media",this.youtubeIframe.src+="&autoplay=1"}}class YoutubePrerollThumbs{constructor(vastUrls){this.vastUrls=vastUrls}initYoutubePrerollThumbs(){var youtubeIframes=document.querySelectorAll('iframe[src^="https://www.youtube.com/embed/"], iframe[src^="https://www.youtube-nocookie.com/embed/"]');if(youtubeIframes.length&&this.vastUrls.length){var re=/embed\/(.*)\?/;for(let i=0;i<youtubeIframes.length;i++){var customYTId="ytPrerollThumb-"+i,ytIframe=youtubeIframes[i],thumbWrap=` 8 <div id="${customYTId}" class="yt-preroll-thumb-wrap"> 9 <img class="yt-preroll-thumb-img" src="${"https://img.youtube.com/vi/"+ytIframe.src.match(re)[1]+"/hqdefault.jpg"}" alt="play"> 10 <div class="yt-preroll-play-button"></div> 11 </div>`;ytIframe.after(document.createRange().createContextualFragment(thumbWrap)),ytIframe.style.display="none";let youtubeThumb=document.getElementById(customYTId),youtubePreroll=new YoutubePreroll(ytIframe,this.vastUrls);youtubeThumb.addEventListener("click",()=>{youtubeThumb.remove(),youtubePreroll.initPreroll()},{capture:!1,passive:!0,once:!0})}}}}
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.