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

expand all

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

See Also:
Media, MediaView

Profile: common

Script Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicBUFFERINGInteger

Status value when player is buffering.

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

Profile: common

 
public-readPAUSEDInteger

Status value when player is paused

publicPLAYINGInteger

status value when player is playing

publicREPEAT_FOREVERInteger

Value of repeatCount to repeat forever

publicREPEAT_NONENumber

Value of repeatCount for no repeating (play once)

publicSTALLEDInteger

Status value when player is stalled.

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 Also:
onStalled

Profile: common

 

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicautoPlayBoolean

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

publicbalanceNumber

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 -1.0 being left, 0 being center, and 1.0 being right.

Profile: common

 
public-readbufferProgressTimeDuration

For a bufferred stream, the current buffer position which indicates how much media can be played without stalling the MediaPlayer.

public-readcurrentCountNumber

Defines the current number of time the media has repeated

publiccurrentTimeDuration

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, bind with inverse must be used if it is being bound from another variable.

Profile: common

 
publicenabledTracksTrack[]

The sequence of tracks that are currently enabled on this MediaPlayer To enable or disable tracks, a Track is respctively added or removed from this sequence.

publicfaderNumber

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 -1.0 being rear, 0 being center, and 1.0 being forward.

Profile: common

 
publicmediaMedia

Defines the source Media to be played

publicmuteBoolean

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

publiconBufferingfunction(:Duration):Void

Invoked when the player is buffering data.

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

 
publiconEndOfMediafunction():Void

Invoked when the player reaches the end of media and is not repeating.

publiconErrorfunction(:MediaError):Void

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

The onError function is called when a mediaError occurs on this player. Note that onError shoudl be intitialized before other variables so that errors can be handled appropriately.

See Also:
MediaError

Profile: common

 
publiconRepeatfunction():Void

Invoked when the player reaches the end of media and is repeating.

publiconStalledfunction(:Duration):Void

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

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

 
publicpausedBoolean

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

publicrateNumber

Defines the rate at which the media is being played.

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. Note that all media formats do not support playing backwards or arbitrary rates.

Profile: common

 
publicrepeatCountNumber

Defines the number of times the media should repeat.

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

Profile: common

 
publicstartTimeDuration

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

publicstatusInteger

Reflects the current status of the MediaPlayer.

Reflects the current status of the MediaPlayer. The status is one of PAUSED: The player has been paused PLAYING: The player is playing BUFFERING: This may occur when player is paused or playing STALLED : Occurs when media is being played, but data is not being delivered fast enough to continue playing

Profile: common

 
publicstopTimeDuration

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

public-readsupportsMultiViewsBoolean

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

publictimersMediaTimer[]

the sequence media timers for this player.

the sequence media timers for this player. For each Timer in this sequence, its action function will be invoked when the time is reached by this MediaPlayer

See Also:
MediaTimer

Profile: common

 
publicvolumeNumber

Defines the volume at which the media is being played.

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

Profile: common

 

Inherited Variables

Function Summary

public pause() : Void

Pauses playing

Pauses playing

Profile: common

 
public play() : Void

Starts or resumes playing

Starts or resumes playing

Profile: common

 
public stop() : Void

Stops playing, resets to beginning of media, and resets the play count

Stops playing, resets to beginning of media, and resets the play count

Profile: common

 

Inherited Functions




Spec-Zone.ru - all specs in one place