Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
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.