How to run same js application only in one of multiple user opened windows with same url?
I want place a music player at homepage (even may be every page within same application/domain) and play songs on document loaded. But user may open the page contains this palyer more than one at same time.    
So, if the use opened the window w1, w2, w3 with same url, how to let the only one window may play songs(for example, w1 plays, w2 adn w3 does not). And when w1 is closed, w2 and w3 should be able to found this event, then elect for playing songs, only winner be able to play songs.

How to run same js application only in one of multiple user opened windows with same url?
===

I want place a music player at homepage (even may be every page within same application/domain) and play songs on document loaded. But user may open the page contains this palyer more than one at same time.    
So, if the use opened the window w1, w2, w3 with same url, how to let the only one window may play songs(for example, w1 plays, w2 adn w3 does not). And when w1 is closed, w2 and w3 should be able to found this event, then elect for playing songs, only winner be able to play songs.
