Intersection Observer & Efficient Scroll Handling

What's the best practice for handling scroll-based video playback?
const videoObserver = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    const video = entry.target;
    if (entry.isIntersecting) {
      if (entry.intersectionRatio > 0.75) {
        video.play();
      } else {
        video.pause();
      }
    } else {
      video.pause();
    }
  });
}, {
  threshold: [0, 0.75, 1.0]
});
Next Question (16/20)