Skip to content
Advertisement

intersection observer works only for the first video

I need to pause a video if it is not in view
the below code works only for the first video in list
how to make it working for all .bvideo ?

JavaScript

Advertisement

Answer

Use querySelectorAll() method.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement