public interface Player extends StateModel
Player
is a media handler for rendering and controlling time based
media data.Modifier and Type | Field and Description |
---|---|
static int |
CLOSED
A player with this state has been explicitly closed or has
encountered an error and can not be used any more.
|
static int |
PREFETCHED
When a Player finishes Prefetching, it moves into the Prefetched state.
|
static int |
PREFETCHING
When prefetch is called, a Player moves from the Realized state into
the Prefetching state.
|
static int |
REALIZED
When a Player finishes realizing it moves into the REALIZED state.
|
static int |
REALIZING
When realize is called, a Player moves from the UNREALIZED state
into the REALIZING state.
|
static int |
STARTED
Calling start puts a Player into the Started state.
|
static int |
UNREALIZED
A Player in the UNREALIZED state has been instantiated, but
does not yet know anything about its media.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a listener that wants to be notified about
state changes of the player.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener that wants to be notified about
property changes of the player.
|
void |
addStateListener(StateListener listener)
Adds a listener that wants to be notified about
state changes of the player.
|
void |
close()
Initiates the following asynchronous
state transitions:
any state -> closed
|
void |
deallocate()
Initiates the following asynchronous
state transitions:
realizing -> unrealized
prefetching -> realized
prefetched -> realized
realized
started -> throws IllegalStateException
closed -> throws IllegalStateException
|
javax.swing.BoundedRangeModel |
getCachingModel()
Gets the model representing the realizing progress of
the player.
|
java.awt.Component |
getControlPanelComponent() |
int |
getState()
Gets the current state of the player.
|
int |
getTargetState()
Gets the target state.
|
javax.swing.BoundedRangeModel |
getTimeModel()
Gets the model representing the time line of the player.
|
long |
getTotalDuration() |
java.awt.Component |
getVisualComponent() |
boolean |
isActive()
Returns true when the target state of the player is equal to STARTED.
|
boolean |
isAudioAvailable()
Returns true if audio is available.
|
boolean |
isAudioEnabled()
Returns true if audio is enabled.
|
boolean |
isCached()
Returns true when the player has completely cached all movie data.
|
void |
prefetch()
Initiates the following asynchronous
state transitions:
unrealized -> realizing -> realized -> prefetching -> prefetched
realizing -> realized -> prefetching -> prefetched
realized -> prefetching -> prefetched
prefetching -> prefetched
prefetched
closed -> throws IllegalStateException
|
void |
realize()
Initiates the following asynchronous
state transitions:
unrealized -> realizing -> realized
realizing -> realized
realized
closed -> throws IllegalStateException
|
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a listener.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener.
|
void |
removeStateListener(StateListener listener)
Removes a listener.
|
void |
setAudioEnabled(boolean b)
Sets the audio enabled state.
|
void |
setTargetState(int state)
Sets the target state we want the player to be in.
|
void |
start()
Initiates the following asynchronous
state transitions:
unrealized -> realizing -> realized -> prefetching -> prefetched -> started
realizing -> realized -> prefetching -> prefetched -> started
realized -> prefetching -> prefetched -> started
prefetching -> prefetched -> started
prefetched -> started
started
closed -> throws IllegalStateException
|
void |
stop()
Initiates the following asynchronous
state transitions:
started -> prefetched
unrealized
realizing
prefetching
prefetched
closed -> throws IllegalStateException
|
static final int UNREALIZED
static final int REALIZING
static final int REALIZED
static final int PREFETCHING
static final int PREFETCHED
static final int STARTED
static final int CLOSED
void setAudioEnabled(boolean b)
boolean isAudioEnabled()
boolean isAudioAvailable()
int getState()
getState
in interface StateModel
int getTargetState()
void setTargetState(int state)
void realize()
void prefetch()
void deallocate()
void start()
void stop()
void close()
void addStateListener(StateListener listener)
addStateListener
in interface StateModel
void removeStateListener(StateListener listener)
removeStateListener
in interface StateModel
void addChangeListener(javax.swing.event.ChangeListener listener)
void removeChangeListener(javax.swing.event.ChangeListener listener)
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
javax.swing.BoundedRangeModel getTimeModel()
javax.swing.BoundedRangeModel getCachingModel()
boolean isCached()
java.awt.Component getVisualComponent()
java.awt.Component getControlPanelComponent()
long getTotalDuration()
boolean isActive()