Set: When a video goes out of view = Pause all videos. Nothing here needs scrolling — the videos are hidden by CSS, the way a carousel slide, closed tab or accordion hides them.
1. Accordion — collapsing sets display:none
Open / close me (press play first, then close)
Expected: closing the accordion pauses it. Re-opening leaves it paused (you started it).
2. visibility:hidden — a fade-style carousel
Press play, then use the toggle below.
Open / close me
A video hidden by
visibility:hidden or opacity:0 has to stay hidden for about 300ms before it counts — that delay is deliberate, so a quick fade does not pause a video it is about to show.