01-06-2011 02:28 AM - edited 01-06-2011 02:32 AM
Hello all
I have written a code to play an audio file placed on a server.
The code works well for non touch device but not for touch device
Can anybody suggest what should i do?
PlayerThread _playerThread = new PlayerThread(); _playerThread.start();
private class PlayerThread extends Thread
{
public void run()
{
try
{
String imgPath = url;
imgPath=imgPath + ";deviceside=true" + HttpRequestHelper.getConnectionparameter();
player = javax.microedition.media.Manager.createPlayer(imgPath);
playerListener = new MediaPlayerListener();
player.addPlayerListener(playerListener);
player.start();
LoginScreen.volumeControl = (VolumeControl) player.getControl("VolumeControl");
}
catch (final Exception e)
{
System.out.println("******Exception caught :" + e);
edit: got this exception,dont knw y coz my not using file system
net.rim.device.api.io.file.FileIOException: File system error }
}
}
private class MediaPlayerListener implements PlayerListener
{
public void playerUpdate(Player player,String event,Object eventData)
{
if(event == STARTED){}
else if(event == ERROR){}
else if(event==END_OF_MEDIA){}
}
}
did some coding related to my app in this part
need help !!!!!!!!!!!
01-06-2011 03:04 AM
Any help is highly appreciated
plz can anyone suggest me what should i do.
I have also tried with buffering and downloading a file and saving it in memory card and playing it again.
but the file does not play in any case
01-07-2011 12:58 AM
Hi swati, I directly passed the Http Url of Audio file in the Player class and It works for me.
What are you getting.
01-07-2011 01:32 AM
Hey Nitin thanks fr the reply.
I have also tried that also but still no audio.
i can see it bufferring from the arrow at top right corner.
but no audio.
can u share your code if possible
may be m doing some stupid mistake.
01-07-2011 02:02 AM
Give me your email id.
--------------------------------------------------
Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.