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
Developer
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

End of media not fired

Hello friends.

 

I am developing an audio player. I have attached the player listener and it fires end of media when it has finished playing. It works in the simulator, but end of media is not fired in the device. How to rectify it. Thanks

Developer
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: End of media not fired

Is end of media *never* fired, or just not consistently?

 

Are any other events fired at the end of the track's playback?

Andrew Cowart | Metova
www.metova.com
Developer
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Re: End of media not fired

if i set breakpoint at if(event.equals(PlayerListener.END_OF_MEDIA)) , the app first fires a com.rim.loading event and then an error. " error 5 which according to api documentation is "Unspecified: some error occured which does not fit into any other category." .and then i get an exception MediaException : error initialising media.

 

I dont have this problem when i dont set the breakpoint.

 

 

 end of media is never fired in device,. but its always fired in the simulator

 

Highlighted
Developer
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: End of media not fired

Assuming your playerUpdate method's parameters look like:

 

public void playerUpdate( Player player, String event, Object object ) {

 

You can just print to the console what you're getting:

System.out.println( "-----Event: " + event + "   Object: " + object );

 

Then debug from there - If your player is receiving an error event, it immediately stops playback there (so it's similar to an end of media event).  Make sure that no buffering started events are fired towards the end of the track, etc.

 

 Otherwise - I haven't seen the event not fired before unless it just didn't reach the end of the file.  If you can reproduce it in a small sample app, this would be a good one for the developer issue tracker.

Andrew Cowart | Metova
www.metova.com