@99golems Posted August 13, 2014 Share Posted August 13, 2014 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. Quote Link to comment Share on other sites More sharing options...
@99golems Posted August 19, 2014 Author Share Posted August 19, 2014 Aw shucks I was hoping someone would have some insight. I think window.onblur is supposed to work when the home button is pressed, but for some reason it's not. Think I should file a bug with chrome? Quote Link to comment Share on other sites More sharing options...
1-800-STAR-WARS Posted August 20, 2014 Share Posted August 20, 2014 The blur event works fine for me on both Android and iOS Chrome. How are you checking if the events are firing? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.