1function initLazyVideos() { 2 const videos = document.querySelectorAll('.lazy-video'); 3 const observer = new IntersectionObserver((entries) => { 4 entries.forEach(entry => { 5 if (entry.isIntersecting) { 6 loadVideo(entry.target); 7 observer.unobserve(entry.target); 8 } 9 }); 10 }, { rootMargin: '50px' }); 11 videos.forEach(video => observer.observe(video)); 12} 13function loadVideo(video) { 14 video.querySelectorAll('source').forEach(source => { 15 source.src = source.dataset.src; 16 }); 17 video.load(); 18 video.addEventListener('loadeddata', () => { 19 video.classList.add('loaded'); 20 video.play().catch(e => { 21 }); 22 }); 23} 24document.addEventListener('DOMContentLoaded', initLazyVideos);
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.