nk-o / jarallax

Parallax scrolling for modern browsers
https://jarallax.nkdev.info
MIT License
1.38k stars 210 forks source link

videoPlayOnlyVisible #209

Closed gcooke75 closed 2 years ago

gcooke75 commented 2 years ago

Video still loading when visible even when videoPlayOnlyVisible: false

Version used:

v2.0.2

Code to reproduce the issue (HTML blocks + JavaScript initialization)


<div class="jarallax" data-jarallax data-video-src="https://www.youtube.com/watch?v=5rPmsdGPGFU">
      <div class="container"> 
        <div class="row h-100">
                <div class="col-12 text-center">
                     <h2>Early Works</h2>
               </div>
        </div>
    </div>
</div>
 jarallax(document.querySelectorAll('.jarallax'), {
speed: 0.2,
videoPlayOnlyVisible: false,
videoLazyLoading: false
});
nk-o commented 2 years ago

Video background is always playing automatically. The option videoPlayOnlyVisible allows you to play video only in case, the section is in the viewport. If it is false, the video will be always playing.