11-05-2010 10:14 AM
I'm using Audio Extension to play sample.mp3 file. This file is stored inside folder [audio] within my app. Here is the code I used and it didn't work
var playerInstance = new blackberry.audio.Player("file///audio/sample.mp3")
I'm not sure if "file:///audio/sample.mp3" is the right path to use because it didn't work on simulator/device. Please help
11-05-2010 12:52 PM
give this a try and post up the results.
var playerInstance = new blackberry.audio.Player("audio/sample.mp3"); playerInstance.play();
If it's packaged with your WebWorks application, I think that may work.
12-19-2010 09:56 PM - edited 12-19-2010 09:58 PM
If you're using files in your widget you'll need to use the local URI and content type.
var playerInstance = new blackberry.audio.Player("local:///mp3/sound2.mp3",
"audio/mpeg", true); playerInstance.play();
First parameter is the URI string (local is relative to your application).
Second is the content-type (see content type example http://www.blackberry.com/developers/docs/widgetap
Third parameter is to use async or not for playback.
That should work! I didn't test audio on simulator, but works on my Bold.