Looking for JS to reload page when tab goes from background to visible

I’ve built a Hype page with looping autoplay video. Sometimes the video gets stuck in an iOS Safari browser on iPad when the page comes back from background. Is there a function that will reload the page — or restart the video — whenever the page comes back from background in tabbed browser?

Thanks!
Joe

I think this is expected as modern browsers try to avoid energy consumptions etc.

Take a look at this… might help:
https://www.thefutureoftheweb.com/blog/detect-browser-window-focus

I threw this into HeadHTML for a test:
FocusBlur_quick.hype.zip (11,6 KB)

You probably could trigger a play function rather then reloading, though.

1 Like

This example might also be helpful: Page Visibility Pause and Play on Tab Switching Figured out

Thank you both!

Your welcome. Was playing with it and matched the example from the other thread… regards

FocusBlur_2_quick.hype.zip (13,2 KB)

2 Likes