v1.1.2
There was an issue on mobile when the tab changes #57, the videos pause and they don't resume playing once you go back on the tab.
Adding the visibilitychange
event listener together with shouldPlay
function we can now detect when the user returns to the page and resume playing the videos if they should play that is. YouTube and Video Element work perfectly.
Though Vimeo has some issues, and becomes unresponsive at times, but only on mobile. I wasn't able to deduce why except probably due it using async functions something gets stuck in the player itself and the functions triggered are never performed, althoguh it actually resolves the promisse?! What is even more weird is that this doesn't trigger "onError" event, it just stays stuck. https://developer.vimeo.com/player/sdk/reference
This issue was probably happening cause we abandoned the "autoplay" due pausing and playing videos on intersection, meaning the videos not in viewprt will be paused. This is probably why the videos were not continuing the playback when you would return to the tab.
@steve-s-eightball-media Thanks bud for reporting the issue!
What's Changed
Full Changelog: v1.1.1...v1.1.2