JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

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.

See again Also:
Media MediaViewer,

Profile: common

Attribute Summary

nametypedescription
Public
autoPlayBoolean

If autoPlay is true, playing will start as soon as possible

More: [+]

If autoPlay is true, playing will start as soon as possible

Profile: commom

balanceNumber

Defines the balance, or left right setting, of the audio output.

More: [+]

Defines the balance, or left right setting, of the audio output. Value ranges continuously from -1.0 being left, 0 being center, and 1.0 being right. This might not work on all media types and all platforms

Profile: common

BUFFERINGInteger

Status value when player is buffering.

More: [+]

Status value when player is buffering. Buffering may occur when player is paused or playing

Profile: common

currentCountNumber

Defines the current number of time the media has repeated

More: [+]

Defines the current number of time the media has repeated

Profile: common

currentTimeDuration

Defines the current media time

More: [+]

Defines the current media time

Profile: common

faderNumber

The fader, or forward and back setting, of audio output on 4+ channel output.

More: [+]

The fader, or forward and back setting, of audio output on 4+ channel output. value ranges continuously from -1.0 being rear, 0 being center, and 1.0 being forward. This might not work on all media types and all platforms

Profile: common

mediaMedia

Defines the source Media to be played

More: [+]

Defines the source Media to be played

See again Also:
Media,

Profile: common

muteBoolean

Equals true if the player's audio is muted, false otherwise.

More: [+]

Equals true if the player's audio is muted, false otherwise.

See again Also:
volume,

Profile: common

onBufferingfunction(:Duration):Void

Invoked when the player is buffering data.

More: [+]

Invoked when the player is buffering data. timeRemaining is an estimate of how much time it will take before the mediaPlayer can play the media

Profile: common

onEndOfMediafunction():Void

Invoked when the player reaches the end of media

More: [+]

Invoked when the player reaches the end of media

Profile: common

onErrorfunction(:MediaError):Void

The onError function is called when a mediaError occurs on this player.

More: [+]

The onError function is called when a mediaError occurs on this player.

See again Also:
MediaError,

Profile: common

onRepeatfunction():Void

Invoked when the player reaches the end of media.

More: [+]

Invoked when the player reaches the end of media.

See again Also:
repeatCount,

Profile: common

onStalledfunction(:Duration):Void

Invoked when the player has stalled because it was not receiving data fast enough to continue playing.

More: [+]

Invoked when the player has stalled because it was not receiving data fast enough to continue playing. timeRemaining is an estimate of how much time it will take before the mediaPlayer can continue playing.

Profile: common

pausedBoolean

Indicated if the player has been paused, either programatically, by the user, or because the media has finished playing

More: [+]

Indicated if the player has been paused, either programatically, by the user, or because the media has finished playing

Profile: common

PAUSEDInteger

Status value when player is paused

More: [+]

Status value when player is paused

Profile: common

PLAYINGInteger

status value when player is playing

More: [+]

status value when player is playing

Profile: common

rateNumber

Defines the rate at which the media is being played.

More: [+]

Defines the rate at which the media is being played. Rate 1.0 is normal play, 2.0 is 2 time normal, -1.0 is backwards, etc... This might not work on all media types and all platforms

Profile: common

REPEAT_FOREVERInteger

Value of repeatCount to repeat forever

More: [+]

Value of repeatCount to repeat forever

Profile: common

REPEAT_NONENumber

Value of repeatCount for no repeating (play once)

More: [+]

Value of repeatCount for no repeating (play once)

Profile: common

repeatCountNumber

Defines the number of times the media should repeat.

More: [+]

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 In this implementation, these are the only values currently supported

Profile: common

STALLEDInteger

Status value when player is stalled.

More: [+]

Status value when player is stalled. STALLED occurs when media is being played, but data is not being delivered fast enough to continue playing

See again Also:
onStalled,

Profile: common

startTimeDuration

Defines the time offset where media should start playing, or restart from when repeating

More: [+]

Defines the time offset where media should start playing, or restart from when repeating

Profile: common

statusInteger

Current status of player

More: [+]

Current status of player

Profile: common

stopTimeDuration

Defines the time offset where media should stop playing or restart when repeating

More: [+]

Defines the time offset where media should stop playing or restart when repeating

Profile: common

supportsMultiViewsBoolean

Indicates if this player can have multiple views associated with it.

More: [+]

Indicates if this player can have multiple views associated with it.

See again Also:
MediaView,

Profile: common

timersMediaTimer[]

Defines the media timers for this player

More: [+]

Defines the media timers for this player

Profile: common

volumeNumber

Defines the volume at which the media is being played.

More: [+]

Defines the volume at which the media is being played. 1.0 is full volume, which is the default.

Profile: common

Protected

Inherited Attributes

Function Summary

public pause() : Boolean

Pauses playing

More: [+]

Pauses playing

Returns
Boolean

Profile: common

public play() : Boolean

Starts or resumes playing

More: [+]

Starts or resumes playing

Returns
Boolean

Profile: common

Inherited Functions