com.hdcookbook.grin.media
Class PlayerWrangler

java.lang.Object
  extended by com.hdcookbook.grin.media.PlayerWrangler

public class PlayerWrangler
extends java.lang.Object

This is a singleton class that's used to control A/V playback on the primary JMF player. In the SE version, we don't control anything, so this is a stub version that provides enough for a show to link against for grinview, and run properly without presenting video.


Method Summary
 void destroy()
          Destroy the playback engine.
static PlayerWrangler getInstance()
           
 long getMediaTime()
          Returns the current media time, or -1 if no playlist has started.
 int getMediaTimeMS()
          Returns the current media time in ms, or -1 if no playlist has started.
 float getRate()
          Gets the rate of playback.
 void initialize(AnimationEngine engine)
          Initialize the playback engine.
 void setMediaTime(long time)
          Sets the current media time in ns.
 void setMediaTimeMS(int time)
          Sets the current media time in ns.
 void setRate(float rate)
          Sets the rate of playback, subject to the restrictions of the BD spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PlayerWrangler getInstance()

initialize

public void initialize(AnimationEngine engine)
Initialize the playback engine. This must be called after the xlet startes, and before playback of video clips is attempted.


getMediaTime

public long getMediaTime()
Returns the current media time, or -1 if no playlist has started.


getMediaTimeMS

public int getMediaTimeMS()
Returns the current media time in ms, or -1 if no playlist has started.


setMediaTime

public void setMediaTime(long time)
Sets the current media time in ns. This method can only be called after the first playlist is started, because that's the first time a JMF player is acquired.


setMediaTimeMS

public void setMediaTimeMS(int time)
Sets the current media time in ns. This method can only be called after the first playlist is started, because that's the first time a JMF player is acquired.


setRate

public void setRate(float rate)
Sets the rate of playback, subject to the restrictions of the BD spec. This is just a pass-through to the JMF Player.setRate() method. This method can only be called after the first playlist is started, because that's the first time a JMF player is acquired.


getRate

public float getRate()
Gets the rate of playback. This is just a pass-through to the JMF Player.getRate method. This method can only be called after the first playlist is started, because that's the first time a JMF player is acquired.


destroy

public void destroy()
Destroy the playback engine. This must be called on xlet termination. Once destroyed, any attempt at media control fill fail, because PlayerWrangler.getInstance() will return null.