MediaPlayer
Overview
The MediaPlayer class provides the controls for playing media. It is used in combination with the Media and MediaViewer classes to display and control media playing. Note that the MediaPlayer does not contain any visual elements so must be used with the MediaView class to view the media. The number of MediaPlayers that can concurrently display media may vary depending on the JavaFX runtime implementation.
Profile: common
Constants Summary
| name | type | description |
|---|---|---|
| REPEAT_NONE | Number |
Value of |
| REPEAT_FOREVER | Integer |
Value of |
| PLAYING | Integer |
status value when player is playing |
| BUFFERING | Integer |
Status value when player is buffering. Buffering may occur when player is paused or playing |
| STALLED | Integer |
Status value when player is stalled. |
Variable Summary
| name | type | Default Value | description |
|---|---|---|---|
| media | Media |
Defines the source |
|
| autoPlay | Boolean |
If |
|
| paused | Boolean |
Indicated if the player has been paused, either programatically, by the user, or because the media has finished playing |
|
| rate | Number |
Defines the rate at which the media is being played. Rate |
|
| volume | Number |
Defines the volume at which the media is being played. |
|
| balance | Number |
Defines the balance, or left right setting, of the audio output. Value ranges continuously from |
|
| fader | Number |
The fader, or forward and back setting, of audio output on 4+ channel output. value ranges continuously from |
|
| startTime | Duration |
Defines the time offset where media should start playing, or restart from when repeating |
|
| stopTime | Duration |
Defines the time offset where media should stop playing or restart when repeating |
|
| currentTime | Duration |
The current media time, may be read to indicate the current position or written to cause the media to seek to the set position. Note that since the variable is being updated by the JavaFX rutime, |
|
| timers | MediaTimer |
the sequence media timers for this player. For each |
|
| repeatCount | Number |
Defines the number of times the media should repeat. if repeatCount is 1 the media will play once. if it is REPEAT_FOREVER, it will repeat indefinitely |
|
| mute | Boolean |
Equals |
|
| status | Integer |
Reflects the current status of the MediaPlayer. The status is one of |
|
| enabledTracks | Track |
The sequence of tracks that are currently enabled on this |
