Play videos when they enter the viewport. Pause when they leave. Zero scroll listeners
Supports 3 ways to configure: global defaults for the whole project, per-instance options via constructor, and per-element overrides via data attributes.
1. Section with videos
2. Code before <body>
.html
VideoObserver Class
.js
Example 1 (Default)
.js
Example 2 (With your params)
.js
Example 3
Copy data attributes on element:
how much of the video must be visible to play (0–1)