Hi,
I am writing a VIDEO PLAYER application.
I am creating player using inputstream:
long mediatime = 0;
STARTPLAYER():
try
{
fc = (fileConnection)Connector.open(url);
inputstream is = fc.openInputStream();
Player p = Manager.createPlayer(is,null);
player.setMediaTime(mediatime );
p.start();
}
catch(Exception e)
{
//EXCEPTION 1
}
PAUSEPLAYER():
try
{
p.stop();
mediatime = player.getMediaTime();
}
catch(Exception e)
{
//EXCEPTION 2
}
I am using canvas in my application.
So I implemented showNotify() and hideNotify() as follows:
showNotify()
{
if(player.getState() == Player.PREFETCHED)
{
STARTPLAYER();
}
hideNotify():
if(player.getState() == Player.PREFETCHED)
{
PAUSEPLAYER();
}
the application works fine if no phone call is coming.
but when I got the incoming call I got exception at EXCEPTION 1: some times I am getting: javax.microedition.MediaException:Could not set media time -5
and
for some times I am getting: javax.microedition.MediaException: Could not start: -21
What is the problem? how can I rectify it.
Please help me.
Thanks,
Manoj.

Reply With Quote

