nk-o / jarallax

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

Option to pause the video when scrolling #180

Closed mmttee closed 3 years ago

mmttee commented 3 years ago

Issue description:

I added play/pause buttons to control the video (as it's required by WCAG AA standards) but the problem occurs when the user had paused the video and try to scroll the page then the video starts playing automatically which I'm trying to prevent.

Anyone had this issue before, if so how did you solve it?

Version used:

(Did you try using the develop branch from GitHub? There's a chance your issue has already been addressed there)

1.12.2

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

nk-o commented 3 years ago

When enabled option videoPlayOnlyVisible, video will be paused and played automatically

https://github.com/nk-o/jarallax/blob/1e21900e3ba9444e5ba5e2d2f5687d4c19620112/src/jarallax-video.esm.js#L181-L195