java.lang.Object
one.jpro.platform.media.player.impl.WebMediaPlayer
- All Implemented Interfaces:
javafx.event.EventTarget,MediaEngine,MediaPlayer,WebMediaEngine
MediaPlayer implementation for the web.- Author:
- Besmir Beqiri
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.BooleanPropertyWhether playing should start as soon as possible.javafx.beans.property.ReadOnlyIntegerPropertyThe number of completed playback cycles.javafx.beans.property.ReadOnlyDoublePropertyThe current rate of playback regardless of settings.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The current media playback time.javafx.beans.property.IntegerPropertyThe number of times the media will be played.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The total duration of play time if allowed to play until finished.final javafx.beans.property.ReadOnlyObjectProperty<MediaPlayerException> Observable property set to aMediaPlayerExceptionif an error occurs.final javafx.beans.property.ReadOnlyObjectProperty<MediaSource> The media source for the current player.javafx.beans.property.BooleanPropertyWhether the player audio is muted.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the end of media is reached naturally.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when an error occurs.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toPAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toPLAYING.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toREADY.javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the playercurrentTimereachesstopTimeand will be repeating.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toSTALLED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toSTOPPED.javafx.beans.property.DoublePropertyThe rate at which the media should be played.javafx.beans.property.ReadOnlyObjectProperty<WebReadyState> javafx.beans.property.ObjectProperty<javafx.util.Duration> The time offset where media should start playing, or restart from when repeating.javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.media.MediaPlayer.Status> The current status of this media player.javafx.beans.property.ObjectProperty<javafx.util.Duration> The time offset where media should stop playing or restart when repeating.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The total amount of play time if allowed to play until finished.javafx.beans.property.DoubleProperty -
Field Summary
Fields inherited from interface one.jpro.platform.media.player.MediaPlayer
INDEFINITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.BooleanPropertyWhether playing should start as soon as possible.javafx.event.EventDispatchChainbuildEventDispatchChain(javafx.event.EventDispatchChain tail) javafx.beans.property.ReadOnlyIntegerPropertyThe number of completed playback cycles.javafx.beans.property.ReadOnlyDoublePropertyThe current rate of playback regardless of settings.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The current media playback time.javafx.beans.property.IntegerPropertyThe number of times the media will be played.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The total duration of play time if allowed to play until finished.final javafx.beans.property.ReadOnlyObjectProperty<MediaPlayerException> Observable property set to aMediaPlayerExceptionif an error occurs.final intRetrieves the index of the current cycle.doubleGets the value of thecurrentRateproperty.javafx.util.DurationRetrieves the current media time.intRetrieves the cycle count.javafx.util.DurationRetrieves the cycle duration in seconds.javafx.util.DurationGets the duration for the given media source.final MediaPlayerExceptiongetError()Retrieve the value of theerrorproperty ornullif there is no error.final MediaSourceRetrieves the current media source.final javafx.event.EventHandler<MediaPlayerEvent> Retrievers the event handler invoked when the end of media is reached naturally.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves the event handler for errors.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves theMediaPlayer.Status.PAUSEDevent handler.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves theMediaPlayer.Status.PLAYINGevent handler.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves theMediaPlayer.Status.READYevent handler.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves the repeat event handler.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves theMediaPlayer.Status.STALLEDevent handler.final javafx.event.EventHandler<MediaPlayerEvent> Retrieves theMediaPlayer.Status.STOPPEDevent handler.doublegetRate()Gets the value of therateproperty.Gets the value of thereadyStateproperty.javafx.util.DurationGets the value of thestartTimeproperty.javafx.scene.media.MediaPlayer.StatusRetrieves the current player status.javafx.util.DurationGets the value of thestopTimeproperty.javafx.util.DurationRetrieves the total playback duration including all cycles (repetitions).com.jpro.webapi.JSVariableReturns the video element used to both play and record media on the browser.doubleGets the value of thevolumeproperty.com.jpro.webapi.WebAPIReturns theWebAPIinstance.booleanRetrieves theautoPlayproperty value.booleanisMute()Gets the value of themuteproperty.final javafx.beans.property.ReadOnlyObjectProperty<MediaSource> The media source for the current player.javafx.beans.property.BooleanPropertyWhether the player audio is muted.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the end of media is reached naturally.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when an error occurs.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toPAUSED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toPLAYING.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toREADY.javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the playercurrentTimereachesstopTimeand will be repeating.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toSTALLED.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> Event handler invoked when the status changes toSTOPPED.voidpause()Pauses the player.voidplay()Starts playing the media.javafx.beans.property.DoublePropertyThe rate at which the media should be played.javafx.beans.property.ReadOnlyObjectProperty<WebReadyState> voidseek(javafx.util.Duration seekTime) Seeks the player to a new playback time.voidsetAutoPlay(boolean value) Sets theautoPlayproperty value.voidsetCycleCount(int value) Sets the cycle count.voidsetMute(boolean value) Sets the value of themuteproperty.final voidsetOnEndOfMedia(javafx.event.EventHandler<MediaPlayerEvent> value) Sets the event handler invoked when the end of media is reached naturally.final voidsetOnError(javafx.event.EventHandler<MediaPlayerEvent> value) Sets the event handler to be called when an error occurs.final voidsetOnPaused(javafx.event.EventHandler<MediaPlayerEvent> value) Sets theMediaPlayer.Status.PAUSEDevent handler.final voidsetOnPlaying(javafx.event.EventHandler<MediaPlayerEvent> value) Sets theMediaPlayer.Status.PLAYINGevent handler.final voidsetOnReady(javafx.event.EventHandler<MediaPlayerEvent> value) Sets theMediaPlayer.Status.READYevent handler.final voidsetOnRepeat(javafx.event.EventHandler<MediaPlayerEvent> value) Sets the repeat event handler.final voidsetOnStalled(javafx.event.EventHandler<MediaPlayerEvent> value) Sets theMediaPlayer.Status.STALLEDevent handler.final voidsetOnStopped(javafx.event.EventHandler<MediaPlayerEvent> value) Sets theMediaPlayer.Status.STOPPEDevent handler.voidsetRate(double value) Sets the value of therateproperty.voidsetStartTime(javafx.util.Duration value) Sets the value of thestartTimeproperty.voidsetStopTime(javafx.util.Duration value) Sets the value of thestopTimeproperty.voidsetVolume(double value) Sets the value of thevolumeproperty.javafx.beans.property.ObjectProperty<javafx.util.Duration> The time offset where media should start playing, or restart from when repeating.javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.media.MediaPlayer.Status> The current status of this media player.voidstop()Stops playing the media.javafx.beans.property.ObjectProperty<javafx.util.Duration> The time offset where media should stop playing or restart when repeating.javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> The total amount of play time if allowed to play until finished.javafx.beans.property.DoubleProperty
-
Property Details
-
startTime
public javafx.beans.property.ObjectProperty<javafx.util.Duration> startTimeProperty- Specified by:
startTimePropertyin interfaceMediaPlayer- Returns:
- the
startTimeproperty - See Also:
-
stopTime
public javafx.beans.property.ObjectProperty<javafx.util.Duration> stopTimeProperty- Specified by:
stopTimePropertyin interfaceMediaPlayer- Returns:
- the
stopTimeproperty - See Also:
-
autoPlay
public javafx.beans.property.BooleanProperty autoPlayProperty- Specified by:
autoPlayPropertyin interfaceMediaPlayer- Returns:
- the
autoPlayproperty - See Also:
-
readyState
- See Also:
-
volume
public javafx.beans.property.DoubleProperty volumeProperty- Specified by:
volumePropertyin interfaceMediaPlayer- Returns:
- the
volumeproperty - See Also:
-
mute
public javafx.beans.property.BooleanProperty muteProperty- Specified by:
mutePropertyin interfaceMediaPlayer- Returns:
- the
muteproperty - See Also:
-
rate
public javafx.beans.property.DoubleProperty rateProperty- Specified by:
ratePropertyin interfaceMediaPlayer- Returns:
- the
rateproperty - See Also:
-
currentRate
public javafx.beans.property.ReadOnlyDoubleProperty currentRateProperty- Specified by:
currentRatePropertyin interfaceMediaPlayer- Returns:
- the
currentRateproperty - See Also:
-
mediaSource
- Specified by:
mediaSourcePropertyin interfaceMediaPlayer- Returns:
- the
mediaSourceproperty - See Also:
-
status
public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.media.MediaPlayer.Status> statusPropertyThe current status of this media player.- Specified by:
statusPropertyin interfaceMediaPlayer- Returns:
- the
statusproperty - See Also:
-
currentTime
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> currentTimeProperty- Specified by:
currentTimePropertyin interfaceMediaPlayer- Returns:
- the current playback time
- See Also:
-
cycleCount
public javafx.beans.property.IntegerProperty cycleCountProperty- Specified by:
cycleCountPropertyin interfaceMediaPlayer- Returns:
- the
cycleCountproperty - See Also:
-
currentCount
public javafx.beans.property.ReadOnlyIntegerProperty currentCountProperty- Specified by:
currentCountPropertyin interfaceMediaPlayer- Returns:
- the
currentCountproperty - See Also:
-
cycleDuration
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> cycleDurationProperty- Specified by:
cycleDurationPropertyin interfaceMediaPlayer- Returns:
- the
cycleDurationproperty - See Also:
-
duration
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> durationProperty- Specified by:
durationPropertyin interfaceMediaPlayer- Returns:
- the duration of the media
- See Also:
-
totalDuration
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> totalDurationProperty- Specified by:
totalDurationPropertyin interfaceMediaPlayer- Returns:
- the
totalDurationproperty - See Also:
-
onReady
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onReadyProperty- Specified by:
onReadyPropertyin interfaceMediaPlayer- Returns:
- the
onReadyproperty - See Also:
-
onPlaying
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onPlayingProperty- Specified by:
onPlayingPropertyin interfaceMediaPlayer- Returns:
- the
onPlayingproperty - See Also:
-
onPaused
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onPausedProperty- Specified by:
onPausedPropertyin interfaceMediaPlayer- Returns:
- the
onPausedproperty - See Also:
-
onStalled
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onStalledProperty- Specified by:
onStalledPropertyin interfaceMediaPlayer- Returns:
- the
onStalledproperty - See Also:
-
onStopped
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onStoppedProperty- Specified by:
onStoppedPropertyin interfaceMediaPlayer- Returns:
- the
onStoppedproperty - See Also:
-
onEndOfMedia
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onEndOfMediaProperty- Specified by:
onEndOfMediaPropertyin interfaceMediaPlayer- Returns:
- the
onEndOfMediaproperty - See Also:
-
onRepeat
public javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onRepeatProperty- Specified by:
onRepeatPropertyin interfaceMediaPlayer- Returns:
- the
onRepeatproperty - See Also:
-
onError
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onErrorProperty- Specified by:
onErrorPropertyin interfaceMediaPlayer- Returns:
- the
onErrorproperty - See Also:
-
error
- Specified by:
errorPropertyin interfaceMediaPlayer- Returns:
- the
errorproperty - See Also:
-
-
Constructor Details
-
WebMediaPlayer
-
-
Method Details
-
getWebAPI
public com.jpro.webapi.WebAPI getWebAPI()Description copied from interface:WebMediaEngineReturns theWebAPIinstance.- Specified by:
getWebAPIin interfaceWebMediaEngine- Returns:
- the
WebAPIinstance
-
getVideoElement
public com.jpro.webapi.JSVariable getVideoElement()Description copied from interface:WebMediaEngineReturns the video element used to both play and record media on the browser.- Specified by:
getVideoElementin interfaceWebMediaEngine- Returns:
- the video element as a
JSVariable
-
getStartTime
public javafx.util.Duration getStartTime()Gets the value of thestartTimeproperty.- Specified by:
getStartTimein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
startTimeproperty - See Also:
-
setStartTime
public void setStartTime(javafx.util.Duration value) Sets the value of thestartTimeproperty.- Specified by:
setStartTimein interfaceMediaPlayer- Property description:
- Parameters:
value- the value for thestartTimeproperty- See Also:
-
startTimeProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> startTimeProperty()Description copied from interface:MediaPlayerThe time offset where media should start playing, or restart from when repeating. When playback is stopped, the current time is reset to this value. If this value is positive, then the first time the media is played there might be a delay before playing begins unless the play position can be set to an arbitrary time within the media. This could occur for example for a video which does not contain a lookup table of the offsets of intra-frames in the video stream. In such a case the video frames would need to be skipped over until the position of the first intra-frame before the start time was reached. The default value isDuration.ZERO.Constraints:
0 ≤ startTime <stopTime- Specified by:
startTimePropertyin interfaceMediaPlayer- Returns:
- the
startTimeproperty - See Also:
-
getStopTime
public javafx.util.Duration getStopTime()Gets the value of thestopTimeproperty.- Specified by:
getStopTimein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
stopTimeproperty - See Also:
-
setStopTime
public void setStopTime(javafx.util.Duration value) Sets the value of thestopTimeproperty.- Specified by:
setStopTimein interfaceMediaPlayer- Property description:
- Parameters:
value- the value for thestopTimeproperty- See Also:
-
stopTimeProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> stopTimeProperty()Description copied from interface:MediaPlayerThe time offset where media should stop playing or restart when repeating. The default value is.MediaPlayer.getDuration()Constraints:
startTime< stopTime ≤MediaPlayer.duration- Specified by:
stopTimePropertyin interfaceMediaPlayer- Returns:
- the
stopTimeproperty - See Also:
-
autoPlayProperty
public javafx.beans.property.BooleanProperty autoPlayProperty()Description copied from interface:MediaPlayerWhether playing should start as soon as possible. For a new player this will occur once the player has reached the READY state. The default value isfalse.- Specified by:
autoPlayPropertyin interfaceMediaPlayer- Returns:
- the
autoPlayproperty - See Also:
-
getReadyState
Gets the value of thereadyStateproperty.- Property description:
- Returns:
- the value of the
readyStateproperty - See Also:
-
readyStateProperty
- Returns:
- the
readyStateproperty - See Also:
-
getVolume
public double getVolume()Gets the value of thevolumeproperty.- Specified by:
getVolumein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
volumeproperty - See Also:
-
setVolume
public void setVolume(double value) Sets the value of thevolumeproperty.- Specified by:
setVolumein interfaceMediaPlayer- Property description:
- Parameters:
value- the value for thevolumeproperty- See Also:
-
volumeProperty
public javafx.beans.property.DoubleProperty volumeProperty()- Specified by:
volumePropertyin interfaceMediaPlayer- Returns:
- the
volumeproperty - See Also:
-
isMute
public boolean isMute()Gets the value of themuteproperty.- Specified by:
isMutein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
muteproperty - See Also:
-
setMute
public void setMute(boolean value) Sets the value of themuteproperty.- Specified by:
setMutein interfaceMediaPlayer- Property description:
- Parameters:
value- the value for themuteproperty- See Also:
-
muteProperty
public javafx.beans.property.BooleanProperty muteProperty()Description copied from interface:MediaPlayerWhether the player audio is muted. A value oftrueindicates that audio is not being produced. The value of this property has no effect onvolume, i.e., if the audio is muted and then unmuted, audio playback will resume at the same audible level provided of course that thevolumeproperty has not been modified meanwhile. The default value isfalse.- Specified by:
mutePropertyin interfaceMediaPlayer- Returns:
- the
muteproperty - See Also:
-
getRate
public double getRate()Gets the value of therateproperty.- Specified by:
getRatein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
rateproperty - See Also:
-
setRate
public void setRate(double value) Sets the value of therateproperty.- Specified by:
setRatein interfaceMediaPlayer- Property description:
- Parameters:
value- the value for therateproperty- See Also:
-
rateProperty
public javafx.beans.property.DoubleProperty rateProperty()Description copied from interface:MediaPlayerThe rate at which the media should be played. For example, a rate of1.0plays the media at its normal (encoded) playback rate,2.0plays back at twice the normal rate, etc. The currently supported range of rates is[0.0, 8.0]. The default value is1.0.- Specified by:
ratePropertyin interfaceMediaPlayer- Returns:
- the
rateproperty - See Also:
-
getCurrentRate
public double getCurrentRate()Gets the value of thecurrentRateproperty.- Specified by:
getCurrentRatein interfaceMediaPlayer- Property description:
- Returns:
- the value of the
currentRateproperty - See Also:
-
currentRateProperty
public javafx.beans.property.ReadOnlyDoubleProperty currentRateProperty()Description copied from interface:MediaPlayerThe current rate of playback regardless of settings. For example, ifrateis set to 1.0 and the player is paused or stalled, thencurrentRatewill be zero.- Specified by:
currentRatePropertyin interfaceMediaPlayer- Returns:
- the
currentRateproperty - See Also:
-
play
public void play()Description copied from interface:MediaPlayerStarts playing the media. If previously paused, then playback resumes where it was paused. If playback was stopped, playback starts from thestartTime. When playing actually starts thestatuswill be set toMediaPlayer.Status.PLAYING.- Specified by:
playin interfaceMediaPlayer
-
pause
public void pause()Description copied from interface:MediaPlayerPauses the player. Once the player is actually paused thestatuswill be set toMediaPlayer.Status.PAUSED.- Specified by:
pausein interfaceMediaPlayer
-
stop
public void stop()Description copied from interface:MediaPlayerStops playing the media. This operation resets playback tostartTimeandcurrentCountto zero. Once the player is actually stopped, thestatuswill be set toMediaPlayer.Status.STOPPED. The only transitions out ofSTOPPEDstatus are toMediaPlayer.Status.PAUSEDandMediaPlayer.Status.PLAYINGwhich occur after invokingMediaPlayer.pause()orMediaPlayer.play(), respectively. While stopped, the player will not respond to playback position changes requested byMediaPlayer.seek(Duration), although this is not the case for the player on the web when running via JPro.- Specified by:
stopin interfaceMediaPlayer
-
seek
public void seek(javafx.util.Duration seekTime) Description copied from interface:MediaPlayerSeeks the player to a new playback time. Invoking this method will have no effect while the player status isMediaPlayer.Status.STOPPEDor media duration isDuration.INDEFINITE.The behavior of
seek()is constrained as follows where start time and stop time indicate the effective lower and upper bounds, respectively, of media playback:MediaPlayer Seek Table seekTime seek position nullno change Duration.UNKNOWNno change Duration.INDEFINITEstop time seekTime < start time start time seekTime > stop time stop time start time ≤ seekTime ≤ stop time seekTime - Specified by:
seekin interfaceMediaPlayer- Parameters:
seekTime- the requested playback time
-
getMediaSource
Description copied from interface:MediaPlayerRetrieves the current media source.- Specified by:
getMediaSourcein interfaceMediaPlayer- Returns:
MediaSourceobject
-
mediaSourceProperty
Description copied from interface:MediaPlayerThe media source for the current player. It holds the information on where it resource is located and accessed either via a string form URI locally, or viaWebAPI.JSFileremotely.- Specified by:
mediaSourcePropertyin interfaceMediaPlayer- Returns:
- the
mediaSourceproperty - See Also:
-
setAutoPlay
public void setAutoPlay(boolean value) Description copied from interface:MediaPlayerSets theautoPlayproperty value.- Specified by:
setAutoPlayin interfaceMediaPlayer- Parameters:
value- whether to enable auto-playback
-
isAutoPlay
public boolean isAutoPlay()Description copied from interface:MediaPlayerRetrieves theautoPlayproperty value.- Specified by:
isAutoPlayin interfaceMediaPlayer- Returns:
- the value.
-
getStatus
public javafx.scene.media.MediaPlayer.Status getStatus()Description copied from interface:MediaPlayerRetrieves the current player status.- Specified by:
getStatusin interfaceMediaPlayer- Returns:
- the playback
MediaPlayer.Status
-
statusProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.media.MediaPlayer.Status> statusProperty()The current status of this media player.- Specified by:
statusPropertyin interfaceMediaPlayer- Returns:
- the
statusproperty - See Also:
-
getCurrentTime
public javafx.util.Duration getCurrentTime()Description copied from interface:MediaPlayerRetrieves the current media time.- Specified by:
getCurrentTimein interfaceMediaPlayer- Returns:
- the current media time
-
currentTimeProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> currentTimeProperty()Description copied from interface:MediaPlayerThe current media playback time. This property is read-only: useMediaPlayer.seek(Duration)to change playback to a different stream position.- Specified by:
currentTimePropertyin interfaceMediaPlayer- Returns:
- the
currentTimeproperty - See Also:
-
getCycleCount
public int getCycleCount()Description copied from interface:MediaPlayerRetrieves the cycle count.- Specified by:
getCycleCountin interfaceMediaPlayer- Returns:
- the cycle count.
-
setCycleCount
public void setCycleCount(int value) Description copied from interface:MediaPlayerSets the cycle count. Its effect will be constrained to[1,. Invoking this method will have no effect if media duration isInteger.MAX_VALUE]Duration.INDEFINITE.- Specified by:
setCycleCountin interfaceMediaPlayer- Parameters:
value- the cycle count
-
cycleCountProperty
public javafx.beans.property.IntegerProperty cycleCountProperty()Description copied from interface:MediaPlayerThe number of times the media will be played. By default,cycleCountis set to1meaning the media will only be played once. SettingcycleCountto a value greater than 1 will cause the media to play the given number of times or until stopped. If set toINDEFINITE, playback will repeat until stop() or pause() is called.constraints:
cycleCount ≥ 1- Specified by:
cycleCountPropertyin interfaceMediaPlayer- Returns:
- the
cycleCountproperty - See Also:
-
getCurrentCount
public final int getCurrentCount()Description copied from interface:MediaPlayerRetrieves the index of the current cycle.- Specified by:
getCurrentCountin interfaceMediaPlayer- Returns:
- the current cycle index
-
currentCountProperty
public javafx.beans.property.ReadOnlyIntegerProperty currentCountProperty()Description copied from interface:MediaPlayerThe number of completed playback cycles. On the first pass, the value should be 0. On the second pass, the value should be 1 and so on. It is incremented at the end of each cycle just prior to seeking back tostartTime, i.e., whenstopTimeor the end of media has been reached.- Specified by:
currentCountPropertyin interfaceMediaPlayer- Returns:
- the
currentCountproperty - See Also:
-
getCycleDuration
public javafx.util.Duration getCycleDuration()Description copied from interface:MediaPlayerRetrieves the cycle duration in seconds.- Specified by:
getCycleDurationin interfaceMediaPlayer- Returns:
- the cycle duration
-
cycleDurationProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> cycleDurationProperty()Description copied from interface:MediaPlayerThe amount of time between thestartTimeandstopTimeof this player. For the total duration of the MediaSource use theMediaPlayer.durationproperty.- Specified by:
cycleDurationPropertyin interfaceMediaPlayer- Returns:
- the
cycleDurationproperty - See Also:
-
getDuration
public javafx.util.Duration getDuration()Description copied from interface:MediaPlayerGets the duration for the given media source. If the duration cannot be obtained when this method is invoked, aDuration.UNKNOWNvalue will be returned.- Specified by:
getDurationin interfaceMediaPlayer
-
durationProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> durationProperty()Description copied from interface:MediaPlayerThe total duration of play time if allowed to play until finished. If the Media duration isDuration.UNKNOWN, then this will likewise beDuration.UNKNOWN.- Specified by:
durationPropertyin interfaceMediaPlayer- Returns:
- the
durationproperty - See Also:
-
getTotalDuration
public javafx.util.Duration getTotalDuration()Description copied from interface:MediaPlayerRetrieves the total playback duration including all cycles (repetitions).- Specified by:
getTotalDurationin interfaceMediaPlayer- Returns:
- the total playback duration
-
totalDurationProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> totalDurationProperty()Description copied from interface:MediaPlayerThe total amount of play time if allowed to play until finished. IfcycleCountis set toINDEFINITEthen this will also be INDEFINITE. If the media resource duration is UNKNOWN, then this will likewise be UNKNOWN. Otherwise, total duration will be the product of cycleDuration and cycleCount.- Specified by:
totalDurationPropertyin interfaceMediaPlayer- Returns:
- the
totalDurationproperty - See Also:
-
getOnReady
Description copied from interface:MediaPlayerRetrieves theMediaPlayer.Status.READYevent handler.- Specified by:
getOnReadyin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnReady
Description copied from interface:MediaPlayerSets theMediaPlayer.Status.READYevent handler.- Specified by:
setOnReadyin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onReadyProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onReadyProperty()Description copied from interface:MediaPlayerEvent handler invoked when the status changes toREADY.- Specified by:
onReadyPropertyin interfaceMediaPlayer- Returns:
- the
onReadyproperty - See Also:
-
getOnPlaying
Description copied from interface:MediaPlayerRetrieves theMediaPlayer.Status.PLAYINGevent handler.- Specified by:
getOnPlayingin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnPlaying
Description copied from interface:MediaPlayerSets theMediaPlayer.Status.PLAYINGevent handler.- Specified by:
setOnPlayingin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onPlayingProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onPlayingProperty()Description copied from interface:MediaPlayerEvent handler invoked when the status changes toPLAYING.- Specified by:
onPlayingPropertyin interfaceMediaPlayer- Returns:
- the
onPlayingproperty - See Also:
-
getOnPaused
Description copied from interface:MediaPlayerRetrieves theMediaPlayer.Status.PAUSEDevent handler.- Specified by:
getOnPausedin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnPaused
Description copied from interface:MediaPlayerSets theMediaPlayer.Status.PAUSEDevent handler.- Specified by:
setOnPausedin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onPausedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onPausedProperty()Description copied from interface:MediaPlayerEvent handler invoked when the status changes toPAUSED.- Specified by:
onPausedPropertyin interfaceMediaPlayer- Returns:
- the
onPausedproperty - See Also:
-
getOnStalled
Description copied from interface:MediaPlayerRetrieves theMediaPlayer.Status.STALLEDevent handler.- Specified by:
getOnStalledin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnStalled
Description copied from interface:MediaPlayerSets theMediaPlayer.Status.STALLEDevent handler.- Specified by:
setOnStalledin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onStalledProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onStalledProperty()Description copied from interface:MediaPlayerEvent handler invoked when the status changes toSTALLED.- Specified by:
onStalledPropertyin interfaceMediaPlayer- Returns:
- the
onStalledproperty - See Also:
-
getOnStopped
Description copied from interface:MediaPlayerRetrieves theMediaPlayer.Status.STOPPEDevent handler.- Specified by:
getOnStoppedin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnStopped
Description copied from interface:MediaPlayerSets theMediaPlayer.Status.STOPPEDevent handler.- Specified by:
setOnStoppedin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onStoppedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onStoppedProperty()Description copied from interface:MediaPlayerEvent handler invoked when the status changes toSTOPPED.- Specified by:
onStoppedPropertyin interfaceMediaPlayer- Returns:
- the
onStoppedproperty - See Also:
-
getOnEndOfMedia
Description copied from interface:MediaPlayerRetrievers the event handler invoked when the end of media is reached naturally.- Specified by:
getOnEndOfMediain interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnEndOfMedia
Description copied from interface:MediaPlayerSets the event handler invoked when the end of media is reached naturally.- Specified by:
setOnEndOfMediain interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onEndOfMediaProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onEndOfMediaProperty()Description copied from interface:MediaPlayerEvent handler invoked when the end of media is reached naturally.- Specified by:
onEndOfMediaPropertyin interfaceMediaPlayer- Returns:
- the
onEndOfMediaproperty - See Also:
-
getOnRepeat
Description copied from interface:MediaPlayerRetrieves the repeat event handler.- Specified by:
getOnRepeatin interfaceMediaPlayer- Returns:
- the event handler or
null.
-
setOnRepeat
Description copied from interface:MediaPlayerSets the repeat event handler.- Specified by:
setOnRepeatin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onRepeatProperty
public javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onRepeatProperty()Description copied from interface:MediaPlayerEvent handler invoked when the playercurrentTimereachesstopTimeand will be repeating. This callback is made prior to seeking back tostartTime.- Specified by:
onRepeatPropertyin interfaceMediaPlayer- Returns:
- the
onRepeatproperty - See Also:
-
getOnError
Description copied from interface:MediaPlayerRetrieves the event handler for errors.- Specified by:
getOnErrorin interfaceMediaPlayer- Returns:
- the event handler.
-
setOnError
Description copied from interface:MediaPlayerSets the event handler to be called when an error occurs.- Specified by:
setOnErrorin interfaceMediaPlayer- Parameters:
value- the event handler ornull.
-
onErrorProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<MediaPlayerEvent>> onErrorProperty()Description copied from interface:MediaPlayerEvent handler invoked when an error occurs.- Specified by:
onErrorPropertyin interfaceMediaPlayer- Returns:
- the
onErrorproperty - See Also:
-
getError
Description copied from interface:MediaPlayerRetrieve the value of theerrorproperty ornullif there is no error.- Specified by:
getErrorin interfaceMediaPlayer- Returns:
- a
MediaPlayerExceptionornull.
-
errorProperty
Description copied from interface:MediaPlayerObservable property set to aMediaPlayerExceptionif an error occurs.- Specified by:
errorPropertyin interfaceMediaPlayer- Returns:
- the
errorproperty - See Also:
-
buildEventDispatchChain
public javafx.event.EventDispatchChain buildEventDispatchChain(javafx.event.EventDispatchChain tail) - Specified by:
buildEventDispatchChainin interfacejavafx.event.EventTarget
-