File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes The MMAPI Player class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "The MMAPI Player class." Watch "The MMAPI Player class." New topic

The MMAPI Player class.

Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
When we create a Player (MMAPI), we MUST associate it with a media (be it streaming/media file etc eg.wav,mid etc files) ? We are not allowed to create an "independent"/"blank" player which is free from any media ?

From the Manager API, I can only see 3 createPlayer methods, all of which "force" us to create the player WITH a media file.

If we are can create a "blank" player instance, then we can tied it to different media at different times "dynamically" without instantiating new players. As far as I know, the object instantiation process might be a little CPU intensive.
Currently, if I just want to play a different file, I had to :
1) close it by calling close()
2) assign my player reference var to a new player by calling createPlayer again (at the same time this lets the old one elegible for garbage collection). This means instantiate.
3) call realise(), prefetch() again.
I think going through this whole process just to change media is a little "overkill". Don't you think so ?
Can't we have an intermediate state (like one of these existing intermediate states : UNREALIZED, REALIZED, PREFETCHED etc.) that allows us to switch media ? Kinda equivalent to changing CDs of a physical CD player.
We don't throw away a CD player when we wish to listen to another CD, do we ?
[ January 20, 2004: Message edited by: Timothy Toh ]
Michael Yuan
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Well, you are using a factory method not a constructor to get the new player instances, right? That indicates that the implement is probably re-using the player object in a way it sees efficient.

Seam Framework:
Diana Garc�a
Ranch Hand

Joined: Sep 21, 2003
Posts: 31
Hi guys, I see you're talking about class Player. I've got a problem and you might be able to help me.
I've developed an application which plays audio and video via HTTP and RTP, and everything works except from RTP video, because when I call the method player.realize() it blocks forever (without explanation).
Could you please tell me why is that? What's happening? I've no idea.
Thanks a lot
I agree. Here's the link:
subject: The MMAPI Player class.
It's not a secret anymore!