Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 36
Registered: ‎10-12-2012
My Device: developer
My Carrier: developer

what is getMediaTime() in blackberry?

what is the usage of player.getMediaTime() in blackberry.....how to get the current postion of the player using player.getMediaTime() ... pls can anyone explain

Developer
Posts: 209
Registered: ‎04-30-2011
My Device: BlackBerry Z10
My Carrier: Airtel

Re: what is getMediaTime() in blackberry?

hi krishna

if you need to implement pause and resume concept then this function is required.

/*This method is used to pause audio player*/
public static void pause()
{
try {
_player.setMediaTime(_player.getDuration());
_player.getMediaTime();
} catch (MediaException e)
{
Utility.showExcpetion(e.toString());
e.printStackTrace();
}
}
/*This method is used to play audio player*/
public static void resume()
{
try {

_player.setMediaTime(_player.getDuration()-_player.getMediaTime());
_player.start();
} catch (MediaException e)
{
Utility.showExcpetion(e.toString());
// TODO Auto-generated catch block
e.printStackTrace();
}
}

Thanks
Contributor
Posts: 36
Registered: ‎10-12-2012
My Device: developer
My Carrier: developer

Re: what is getMediaTime() in blackberry?

can we use it to insert a voice recording in between another recording.....? Such as to find the paused position in the player

Developer
Posts: 209
Registered: ‎04-30-2011
My Device: BlackBerry Z10
My Carrier: Airtel

Re: what is getMediaTime() in blackberry?

Hi Krishna

Let it try.

Thanks
Contributor
Posts: 36
Registered: ‎10-12-2012
My Device: developer
My Carrier: developer

Re: what is getMediaTime() in blackberry?

hi pankaj! actually i want to insert a voice recording at the paused position of the player in blackberry.... have u got any idea how to do it...

Developer
Posts: 209
Registered: ‎04-30-2011
My Device: BlackBerry Z10
My Carrier: Airtel

Re: what is getMediaTime() in blackberry?

HI Krishna,

I have no idea.

Because, i have not gone through this req.

Thanks
Pawan