Lazy loading... pausing and resuming HTML5 videos - with IntersectionObserver

Scroll down...13

Scroll down...12

Scroll down...11

Scroll down...10

Having problem with "rootMargin" option in Codepen - Editor View
=> Change view to Full page!

Scroll down...9

Scroll down...8

Scroll down...7

Scroll down...6

Video loads 300px (rootMargin) before coming into viewport
and starts playing when 80% visible (threshold)

I left the audio ON for testing, to be shure if the video is paused or still playing when out of ViewPort - add "muted" attribute to video tag to silent it!
On LIVE SITES if video is not muted, the video player will not start until you click somewhere and will throw an error -> Uncaught (in promise) DOMException

Scroll down...5

Scroll down...4

Scroll down...3

Scroll down...2

Scroll down...1

Video no.1

Video no.2

...

Some other stuff belove...

...

I'm an image!