I have a requirement where i need to play a notification sound only when the browser window is minimized similar to what GTalk does.
I’ve tried it using JQuery’s $(window).blur() but it only plays it when I manually blur it but not when the notifications comes and the window is blurred.
Here is the fiddle that I have tried: http://jsfiddle.net/zfUnm/
Actually this is a chat notification that i have to play only when the browser is minimized.
Thanks in advance
I think they don’t play it when minimize. They will call it every time the new notification comes, but when window is active, they disable the sound.
You can find out more method here Is there a way to detect if a browser window is not currently active?