I'm currently using the sun.audio package to play audio files in my application composed of servlets and jsps, code would be something simple as follows in my servlet
My application has a number of tabs, the tab for playing audio for example, is called audioPlay and contains the code above. My problems are:
(1) selecting a different browser tab, while audio is playing, within my application, the audio still continues playing, I cannot stop it.
(2) Selecting the back browser on the web application, while the audio is running, the audio doesn't stop and is still running.
I've seen on a number of web-sites that clicking on a song title, goes into a servlet and plays the song in background which is what I have presently, but when they do steps 1 and 2 above within their website, the audio stops but doesn't in mine, are there any suggestions about how to solve this? I need to call Audioplayer.player.stop(as) at some stage, would using a class with static variables and start and stop options be a possibility? I hope I have made my issue clear or could this be an issue with the cache-control header? Thanks for any help returned.