aspose file tools*
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
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "The MMAPI Player class." Watch "The MMAPI Player class." New topic
Author

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 ?
Thanks.
[ January 20, 2004: Message edited by: Timothy Toh ]
Michael Yuan
author
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: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The MMAPI Player class.