Module javafx.media

Enum Class MediaPlayer.Status

java.lang.Object
java.lang.Enum<MediaPlayer.Status>
javafx.scene.media.MediaPlayer.Status
All Implemented Interfaces:
Serializable, Comparable<MediaPlayer.Status>, Constable
Enclosing class:
MediaPlayer

public static enum MediaPlayer.Status extends Enum<MediaPlayer.Status>
Enumeration describing the different status values of a MediaPlayer.

The principal MediaPlayer status transitions are given in the following table:

MediaPlayer Status Transition Table
Current \ NextREADYPAUSED PLAYINGSTALLEDSTOPPED DISPOSED
UNKNOWNpre-rolldispose()
READYautoplay; play()dispose()
PAUSEDplay()stop()dispose()
PLAYINGpause()buffering datastop()dispose()
STALLEDpause()data bufferedstop()dispose()
STOPPEDpause()play()dispose()
HALTEDdispose()

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 HALTED and from DISPOSED 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. DISPOSED is a terminal status entered after dispose() method is invoked and cannot be exited. HALTED status entered when a critical error occurs and may be transitioned into from any other status except DISPOSED.

The principal MediaPlayer status values and transitions are depicted in the following diagram:

MediaPlayer status 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.

Since:
JavaFX 2.0