Jump to content

handling iPad page visibility changes


anthony
 Share

Recommended Posts

Hi folks,

 

I've been trying to detect when a page in mobile Safari (iOS 6) on an iPad is not visible. My intention is that I can then pause a game and any audio that's playing. The Page Visibility API doesn't seem to work so I then tried adding event listeners for pageshow, pagehide but unfortunately I had no luck with that either.

 

Has anyone dealt with this problem before and come up with a hack/solution?

 

A half arsed idea I had as I was typing this is to monitor the elapsed time since the player last interacted with the page and if it's X seconds then pause. I don't know how reliable that would be and it's quite game specific. 

 

Thanks,

 

Anthony

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...