This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The MMAPI Player class.

 
Timothy Toe
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Diana Garc´┐Ża
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic