1class LiteYTEmbed extends HTMLElement{connectedCallback(){this.videoId=this.getAttribute('videoid');let a=this.querySelector('.lty-playbtn');this.playLabel=(a&&a.textContent.trim())||this.getAttribute('playlabel')||'Play';!this.style.backgroundImage&&(this.style.backgroundImage=`url("https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg")`);!a&&(a=document.createElement('button'),a.type='button',a.classList.add('lty-playbtn'),this.append(a));if(!a.textContent){var A=document.createElement('span');A.className='lyt-visually-hidden';A.textContent=this.playLabel;a.append(A)}a.removeAttribute('href');this.addEventListener('pointerover',LiteYTEmbed.warmConnections,{once:!0});this.addEventListener('click',this.addIframe);this.needsYTApiForAutoplay=navigator.vendor.includes('Apple')||navigator.userAgent.includes('Mobi')}static addPrefetch(a,b,c){var d=document.createElement('link');d.rel=a;d.href=b;c&&(d.as=c);document.head.append(d)}static warmConnections(){if(LiteYTEmbed.preconnected)return;LiteYTEmbed.addPrefetch('preconnect','https://www.youtube-nocookie.com');LiteYTEmbed.addPrefetch('preconnect','https://www.google.com');LiteYTEmbed.addPrefetch('preconnect','https://googleads.g.doubleclick.net');LiteYTEmbed.addPrefetch('preconnect','https://static.doubleclick.net');LiteYTEmbed.preconnected=!0}fetchYTPlayerApi(){if(window.YT||window.YT?.Player)return;this.ytApiPromise=new Promise((a,b)=>{var c=document.createElement('script');c.src='https://www.youtube.com/iframe_api';c.async=!0;c.onload=()=>YT.ready(a);c.onerror=b;this.append(c)})}async addYTPlayerIframe(a){this.fetchYTPlayerApi();this.ytApiPromise;var b=document.createElement('div'),c=Object.fromEntries(a.entries());this.append(b);new YT.Player(b, {width:'100%',videoId:this.videoId,playerVars:c,events:{'onReady':event=>event.target.playVideo()}})}async addIframe(){if(this.classList.contains('lyt-activated'))return;this.classList.add('lyt-activated');var a=new URLSearchParams(this.getAttribute('params')||[]),b=document.createElement('iframe');a.append('autoplay','1');a.append('playsinline','1');if(this.needsYTApiForAutoplay)return this.addYTPlayerIframe(a);b.width=560;b.height=315;b.title=this.playLabel;b.allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';b.allowFullscreen=!0;b.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${`${a}`}`;this.append(b);b.focus()}}customElements.define('lite-youtube',LiteYTEmbed);
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.