-
Method Summary
Modifier and TypeMethodDescriptionbooleanGet whether or not the media player will automatically repeat playing the media when it has finished playing.voidAdvance one frame.voidpause()Pause play-back.voidplay()Begin play-back.voidsetPause(boolean pause) Pause/resume.voidsetPosition(float position) Jump to a specific position.booleansetRate(float rate) Set the video play rate.voidsetRepeat(boolean repeat) Set whether or not the media player should automatically repeat playing the media when it has finished playing.voidsetTime(long time) Jump to a specific moment.voidskipPosition(float delta) Skip forward or backward by a change in position.voidskipTime(long delta) Skip forward or backward by a period of time.booleanstart()Begin play-back and wait for the media to start playing or for an error to occur.voidstop()Stop play-back.
-
Method Details
-
play
public void play()Begin play-back.If called when the play-back is paused, the play-back will resume from the current position.
-
start
public boolean start()Begin play-back and wait for the media to start playing or for an error to occur.If called when the play-back is paused, the play-back will resume from the current position.
This call will block until the media starts or errors.
- Returns:
trueif the media started playing,falseon error
-
stop
public void stop()Stop play-back.A subsequent play will play-back from the start.
-
setPause
public void setPause(boolean pause) Pause/resume.- Parameters:
pause- true to pause, false to play/resume
-
pause
public void pause()Pause play-back.If the play-back is currently paused it will begin playing.
-
nextFrame
public void nextFrame()Advance one frame. -
skipTime
public void skipTime(long delta) Skip forward or backward by a period of time.To skip backwards specify a negative delta.
- Parameters:
delta- time period, in milliseconds
-
skipPosition
public void skipPosition(float delta) Skip forward or backward by a change in position.To skip backwards specify a negative delta.
- Parameters:
delta- amount to skip
-
setTime
public void setTime(long time) Jump to a specific moment.If the requested time is less than zero, it is normalised to zero.
- Parameters:
time- time since the beginning, in milliseconds
-
setPosition
public void setPosition(float position) Jump to a specific position.If the requested position is less than zero, it is normalised to zero.
- Parameters:
position- position value, a percentage (e.g. 0.15 is 15%)
-
setRate
public boolean setRate(float rate) Set the video play rate.Some media protocols are not able to change the rate.
Note that a successful return does not guarantee the rate was changed (depending on media protocol).
- Parameters:
rate- rate, where 1.0 is normal speed, 0.5 is half speed, 2.0 is double speed and so on- Returns:
trueif successful;falseotherwise
-
setRepeat
public void setRepeat(boolean repeat) Set whether or not the media player should automatically repeat playing the media when it has finished playing.There is no guarantee of seamless play-back when using this method - see instead
MediaListPlayer.- Parameters:
repeat-trueto automatically replay the media, otherwisefalse
-
getRepeat
public boolean getRepeat()Get whether or not the media player will automatically repeat playing the media when it has finished playing.- Returns:
trueif the media will be automatically replayed, otherwisefalse
-