Jump to content

What event fires when home button is pressed on mobile chrome (ios or android)?


@99golems
 Share

Recommended Posts

I have a game that pauses and mutes music when tab or browser loses focus or changes visibility to hidden, and unpauses and unmutes the music when the tab gains focus again or visibility changes to visible. It works great on all browsers (chrome desktop, firefox, safari, ie10+..) except it doesn't work on mobile chrome when the home button is pressed. So far none of my events are firing on this browser/os.

 

here are the events i have tested:

window.addEventListener('blur', onBlur);window.addEventListener('focus', onFocus);window.addEventListener('pagehide', onBlur);window.addEventListener('pageshow', onFocus);document.addEventListener('webkitvisibilitychange', _onChange);document.addEventListener('visibilitychange', _onChange);

Anyone have any ideas? Like I said it works fantastic in every single browser/OS except for Mobile Chrome on ios and android.

 

ps: this is not mobile audio related. I'm using these events to mute/unmute audio, but the problem is that the events aren't even firing in the first place.

Link to comment
Share on other sites

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...