Overview
The MediaPlayer
class provides the controls for playing media.
It is used in combination with the Media and MediaView
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
Script Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | BUFFERING | Integer |
This state is unimplemented and may be deprecated in future releases. |
||||
public-read | PAUSED | Integer |
Value of status when playback is stopped or paused. |
||||
public | PLAYING | Integer |
Value of status while the player is playing the media. |
||||
public | REPEAT_FOREVER | Integer |
When repeatCount is set to this value, the player will repeat
playback of the |
||||
public | REPEAT_NONE | Number |
When repeatCount is set to this value, the player will play the
|
||||
public | STALLED | Integer |
This state is unimplemented and may be deprecated in future releases. |
Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | autoPlay | Boolean |
If |
||||
public | balance | Number |
Defines the balance, or left/right setting, of the audio output. Defines the balance, or left/right setting, of the audio output.
Value ranges continuously from Profile: common |
||||
public-read | bufferProgressTime | Duration |
For a bufferred stream, the current buffer position which indicates how
much media can be played without stalling the For a bufferred stream, the current buffer position which indicates how
much media can be played without stalling the Profile: common |
||||
public-read | currentCount | Number |
Defines the current number of times the media has repeated. Defines the current number of times the media has repeated. This property is incremented just prior to seeking back to startTime. Profile: common |
||||
public | 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. 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,
Note that setting Profile: common |
||||
public | enabledTracks | Track[] |
The sequence of tracks that are currently enabled on this
The sequence of tracks that are currently enabled on this
See Also:
|
||||
public | fader | Number |
The fader, or forward and back setting, of audio output on 4+ channel output. The fader, or forward and back setting, of audio output
on 4+ channel output.
Value ranges continuously from NOTE: This property is not implemented yet. Profile: common |
||||
public | media | Media |
Defines the source Media to be played |
||||
public | mute | Boolean |
When |
||||
public | onBuffering | function(:Duration):Void |
This property is unimplemented and may be deprecated in future releases. |
||||
public | onEndOfMedia | function():Void |
Invoked when the player |
||||
public | onError | function(:MediaError):Void |
The The
See Also:
Profile: common |
||||
public | onRepeat | function():Void |
Invoked when the player reaches Invoked when the player reaches
See Also:
Profile: common |
||||
public | onStalled | function(:Duration):Void |
This property is unimplemented and may be deprecated in future releases. |
||||
public | paused | Boolean |
Indicates if the player has been paused, either programatically, by the user, or because the media has finished playing. |
||||
public | rate | Number |
Defines the rate at which the media is being played. Defines the rate at which the media is being played.
Rate Profile: common |
||||
public | repeatCount | Number |
Defines the number of times the media should be played. Defines the number of times the media should be played.
If Profile: common |
||||
public | startTime | Duration |
Defines the time offset where media should start playing, or restart from when repeating. Defines the time offset where media should start playing, or restart from when repeating. When playback is stopped, the current time is reset to this value. Constraints: Profile: common |
||||
public | status | Integer |
Reflects the current status of the MediaPlayer. |
||||
public | stopTime | Duration |
Defines the time offset where media should stop playing or restart when repeating |
||||
public-read | supportsMultiViews | Boolean |
Indicates if this player can have multiple views associated with it. |
||||
public | timers | MediaTimer[] |
The sequence of media timers for this player. The sequence of media timers for this player.
For each MediaTimer in this sequence, its
action function will be invoked when the
time is reached by this
See Also:
Profile: common |
||||
public | volume | Number |
Defines the volume at which the media is being played. Defines the volume at which the media is being played.
Profile: common |
Inherited Variables
Function Summary
- public pause() : Void
- public play() : Void
- public stop() : Void
-
Stop playing the media.
Stop playing the media. This operation resets playback to startTime, and resets currentCount to zero.
Profile: common