public static enum MediaPlayer.Status extends java.lang.Enum<MediaPlayer.Status>
MediaPlayer. The principal
MediaPlayerstatus transitions are given in the following table:
|Current \ Next||READY||PAUSED||PLAYING||STALLED||STOPPED|
The table rows represent the current state of the player and the columns
the next state of the player. The cell at the intersection of a given row
and column lists the events which can cause a transition from the row
state to the column state. An empty cell represents an impossible transition.
The transitions to
UNKNOWN and to and from
status are intentionally not tabulated.
UNKNOWN is the initial
status of the player before the media source is pre-rolled and cannot be
entered once exited.
HALTED is a terminal status entered when
an error occurs and may be transitioned into from any other status but not
MediaPlayer status values and transitions are
depicted in the following diagram:
Reaching the end of the media (or the
stopTime if this is defined) while playing does not cause the
status to change from
PLAYING. Therefore, for example, if
the media is played to its end and then a manual seek to an earlier
time within the media is performed, playing will continue from the
new media time.
|Enum Constant and Description|
State of the player after dispose() method is invoked.
State of the player when a critical error has occurred.
State of the player when playback is paused.
State of the player when it is currently playing.
State of the player once it is prepared to play.
State of the player when data coming into the buffer has slowed or stopped and the playback buffer does not have enough data to continue playing.
State of the player when playback has stopped.
State of the player immediately after creation.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final MediaPlayer.Status UNKNOWN
public static final MediaPlayer.Status READY
public static final MediaPlayer.Status PAUSED
public static final MediaPlayer.Status PLAYING
public static final MediaPlayer.Status STOPPED
public static final MediaPlayer.Status STALLED
public static final MediaPlayer.Status HALTED
public static final MediaPlayer.Status DISPOSED
MediaViewobjects associated with disposed player can be reused.
public static MediaPlayer.Status values()
for (MediaPlayer.Status c : MediaPlayer.Status.values()) System.out.println(c);
public static MediaPlayer.Status valueOf(java.lang.String name)
name- the name of the enum constant to be returned.
java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
java.lang.NullPointerException- if the argument is null
Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.