Untitled
unknown
plain_text
2 years ago
875 B
10
Indexable
<div class="video-section">
<div class="video-wrapper">
<iframe data-src="https://www.youtube.com/embed/vr2PMQagF5E?rel=0&mute=1&loop=1"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>
</div>
<script>
const video = document.querySelector('iframe[data-src]');
if (video) {
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
video.src = video.getAttribute('data-src');
observer.unobserve(video);
}
});
});
observer.observe(video);
}
</script>Editor is loading...