JMF Player DRIVING ME CRAZY!

D

dan bean

I'm programming a WinAmp-like app but have become totally stuck. Any advice
would be greatly appreciated.

Basically I need a class to manage the playlist. It should iterate over the
playlist and for each track create a Player, wait for an EndOfMediaEvent,
create a Player for the next track and so on. Not too difficult I thought!

But I can't get the player to deallocate/close when the EndOfMediaEvent
event is thrown, so after 2 or 3 tracks I get 'out of memory!'. If I use
some sort of 'blockUntilClose()' method it waits indefinately and is never
notified by the ControllerListener's 'instanceof EndOfMediaEvent' (because
the listener has been added to the player I guess)

I've found loads of examples of code where the ControllerListener's
'instanceof EndOfMediaEvent' sets the media time to 0 and starts it again,
but how can I deallocate and move onto the next track? The player closes
fine when an external event (like clicking the stop button) asks it to. So I
guess I need a similar external event to be triggered by EndOfMediaEvent,
but how?

I guess the answer is very simple, and expect derisive replies. But for the
sake of my sanity could you please point me in the right direction?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top