About the ability to link to the song, these sites should always have that. You can do it with ajax.
Not sure what I think of warning the user that they’re going to stop the music. I think it’s more important for their to be an affordance that there’s music playing, like a big pause button, so they know before closing the window that the music will go away. An interruption would create work that could be avoided.