03-05-2012 11:05 PM
To play a song, are you opening a new web page and then executing the function when that new page opens?
In order to play another song when one is playing, does your user need to close the active page, make a selection on another page, and then have the new page open?
03-05-2012 11:09 PM
I've defined mine inside the function but you could define it well outside (kind of like a class level variable from c# or php, or vb) and then check if the song is playing. Then you could stop it, change src, load the long (audioElement.load) - wait for the loaded fire and hit play.
I think that should work.
03-05-2012 11:24 PM
If you defined your audio element inside the function, I don't see how you were able to stop an audio element that's currently playing and then play another copy of that element. In other words, I don't see how you're able to avoid multiple streams playing at the same time, which is what happened to me when I tried your implementation.
03-06-2012 10:30 AM
I was able to have a testor run the code on os7, and when the code is switching to new stream, instead of no audio, the entire app just crashes. Thanks for your offer to look at my code. I've actually already raised my issue in a different thread, along with the different things I've uncovered as I dug into the problem:
Here's an excerpt from that thread:
Thursday - last edited Thursday
Here's my code:
//global audio variable here
var audio = new Audio;
//Then within an function in the same jscipt file, I set the url. It's
//when this runs a second time with a different url that it stalls.
Can anybody help? I can't really go forward unless I can get past this problem.