aholla Posted April 16, 2013 Share Posted April 16, 2013 Hi, is there a way to detect if the user has closed the browser or changed focus? My problem is that I am playing a long 'sound sprite' and if the user opens a new tab or pulls up the keyboard, the javascript stops running but the sound keeps playing. I need a way to listen for the loss of focus, so i can tell the audio to stop. Thanks, Adam Quote Link to comment Share on other sites More sharing options...
Ezelia Posted April 16, 2013 Share Posted April 16, 2013 have you tried onfocus/onblur events ? Quote Link to comment Share on other sites More sharing options...
aholla Posted April 16, 2013 Author Share Posted April 16, 2013 HA, thanks for the reply, I just found that and that's what I'm looking for. Thanks for the reply! Quote Link to comment Share on other sites More sharing options...
EmployeeNumber8 Posted April 16, 2013 Share Posted April 16, 2013 Are you using Chrome on Windows? Try locking your computer (windows key + "L") during the audio and see if the sound stops. It happened to me once but I forgot to submit it as a bug. 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.