com.sun.media
类 MediaPlayer

java.lang.Object
  继承者 com.sun.media.BasicController
      继承者 com.sun.media.BasicPlayer
          继承者 com.sun.media.MediaPlayer
所有已实现的接口:
Clock, Controller, ControllerListener, DownloadProgressListener, Duration, MediaHandler, Player

public class MediaPlayer
extends BasicPlayer

MediaPlayer extends BasicPlayer and uses PlaybackEngine to play media.


字段摘要
protected  PlaybackEngine engine
           
 
从类 com.sun.media.BasicPlayer 继承的字段
bufferControl, cachingControl, controlComp, controllerList, controls, extendedCachingControl, framePositioning, regionControl, source, VERSION
 
从类 com.sun.media.BasicController 继承的字段
processError, state, stopThreadEnabled
 
从接口 javax.media.Controller 继承的字段
LATENCY_UNKNOWN, Prefetched, Prefetching, Realized, Realizing, Started, Unrealized
 
从接口 javax.media.Clock 继承的字段
RESET
 
从接口 javax.media.Duration 继承的字段
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
构造方法摘要
MediaPlayer()
           
 
方法摘要
protected  boolean audioEnabled()
          Return true if the player is currently playing media with an audio track.
 GainControl getGainControl()
          Obtain the gain control from the media engine.
protected  TimeBase getMasterTimeBase()
          Obtain the time base from the media engine.
 long getMediaNanoseconds()
          Get the current media time in nanoseconds.
 Time getMediaTime()
          Obtain media time directly from the engine.
 java.awt.Component getVisualComponent()
          Obtain the visiual component from the media engine.
 void setProgressControl(com.sun.media.controls.ProgressControl p)
           
 void setSource(javax.media.protocol.DataSource source)
          Set the DataSource that provides the media for this player.
 void updateStats()
          This is being called from a looping thread to update the stats.
protected  boolean videoEnabled()
          Return true if the player is currently playing media with a video track.
 
从类 com.sun.media.BasicPlayer 继承的方法
abortPrefetch, abortRealize, addController, completeConfigure, completePrefetch, completeRealize, controllerSetStopTime, controllerStopAtTime, controllerUpdate, deviceBusy, doClose, doConfigure, doFailedConfigure, doFailedPrefetch, doFailedRealize, doPrefetch, doRealize, doSetMediaTime, doSetRate, doStart, doStop, downloadUpdate, getContentType, getControllerList, getControlPanelComponent, getControls, getDuration, getMediaLocator, getSource, getStartLatency, isAboutToRestart, isConfigurable, isFramePositionable, manageController, manageController, processEndOfMedia, processEvent, removeController, setMediaLength, setMediaTime, setRate, setStopTime, setTimeBase, slaveToMasterTimeBase, start, stop, stopAtTime, syncStart, unmanageController, updateDuration
 
从类 com.sun.media.BasicController 继承的方法
abortConfigure, addControllerListener, close, configure, deallocate, dispatchEvent, doDeallocate, getClock, getControl, getRate, getState, getStopTime, getSyncTime, getTargetState, getTimeBase, interrupt, isInterrupted, mapToTimeBase, prefetch, realize, removeControllerListener, resetInterrupt, sendEvent, setClock, setTargetState, stopControllerOnly, syncStartInProgress, throwError
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 javax.media.Controller 继承的方法
addControllerListener, close, deallocate, getControl, getState, getTargetState, prefetch, realize, removeControllerListener
 
从接口 javax.media.Clock 继承的方法
getRate, getStopTime, getSyncTime, getTimeBase, mapToTimeBase
 

字段详细信息

engine

protected PlaybackEngine engine
构造方法详细信息

MediaPlayer

public MediaPlayer()
方法详细信息

setSource

public void setSource(javax.media.protocol.DataSource source)
               throws java.io.IOException,
                      IncompatibleSourceException
从类 BasicPlayer 复制的描述
Set the DataSource that provides the media for this player. BasicPlayer only supports PullDataSource by default. Subclasses can override this method to support other DataSources.

指定者:
接口 MediaHandler 中的 setSource
覆盖:
BasicPlayer 中的 setSource
参数:
source - of media for this player.
抛出:
java.io.IOException - thrown when an i/o error occurs in reading information from the data source.
IncompatibleSourceException - thrown if the Player can't use this source.

getVisualComponent

public java.awt.Component getVisualComponent()
Obtain the visiual component from the media engine.

指定者:
接口 Player 中的 getVisualComponent
覆盖:
BasicPlayer 中的 getVisualComponent
返回:
the media display component.

getGainControl

public GainControl getGainControl()
Obtain the gain control from the media engine.

指定者:
接口 Player 中的 getGainControl
覆盖:
BasicPlayer 中的 getGainControl
返回:
the GainControl object for this player.

getMediaTime

public Time getMediaTime()
Obtain media time directly from the engine.

指定者:
接口 Clock 中的 getMediaTime
覆盖:
BasicController 中的 getMediaTime
返回:
the current media time.

getMediaNanoseconds

public long getMediaNanoseconds()
从类 BasicController 复制的描述
Get the current media time in nanoseconds.

指定者:
接口 Clock 中的 getMediaNanoseconds
覆盖:
BasicController 中的 getMediaNanoseconds
返回:
the media time in nanoseconds.

getMasterTimeBase

protected TimeBase getMasterTimeBase()
Obtain the time base from the media engine.

指定者:
BasicPlayer 中的 getMasterTimeBase
返回:
the master time base.

audioEnabled

protected boolean audioEnabled()
从类 BasicPlayer 复制的描述
Return true if the player is currently playing media with an audio track.

指定者:
BasicPlayer 中的 audioEnabled
返回:
true if the player is playing audio.

videoEnabled

protected boolean videoEnabled()
从类 BasicPlayer 复制的描述
Return true if the player is currently playing media with a video track.

指定者:
BasicPlayer 中的 videoEnabled
返回:
true if the player is playing video.

updateStats

public void updateStats()
从类 BasicPlayer 复制的描述
This is being called from a looping thread to update the stats.

指定者:
BasicPlayer 中的 updateStats

setProgressControl

public void setProgressControl(com.sun.media.controls.ProgressControl p)