JavaScript / Browser APIs
The MDX video comparison component used IntersectionObserver to play videos when they enter the viewport and pause them when they leave. The threshold and rootMargin options were tuned to avoid premature triggers.
IntersectionObserver fires a callback when elements cross a visibility threshold. Combined with `video.play()`/`pause()`, it creates scroll-aware media without polling.
Task
Complete `setupVideoObserver` so the video plays when 50% of it is visible, pauses when it leaves, and handles the browser blocking autoplay.