Spec-Zone .ru
спецификации, руководства, описания, API

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. Note that the MediaPlayer does not contain any visual elements so must be used with the MediaView class to view the media.

See Also:
Media, MediaView

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

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

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

publiccurrentCountNumber

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

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.

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

public-readPAUSEDInteger

Status value when player is paused

publicPLAYINGInteger

status value when player is 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

 
publicREPEAT_FOREVERInteger

Value of repeatCount to repeat forever

publicREPEAT_NONENumber

Value of repeatCount for no repeating (play once)

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

 
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

 
publicstartTimeDuration

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

publicstatusInteger

Current status of player

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() : Boolean

Pauses playing

Pauses playing

Returns
Boolean

Profile: common

 
public play() : Boolean

Starts or resumes playing

Starts or resumes playing

Returns
Boolean

Profile: common

 
public stop() : Number

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

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

Returns
Number

Profile: common

 

Inherited Functions