Package com.igrium.videolib.api.playback
Interface ControlsInterface
- All Known Implementing Classes:
VLCVideoPlayer.VLCControlsInterface
public interface ControlsInterface
Behavior pertaining to the playback of the current video (play/pause, etc.)
-
Method Summary
Modifier and TypeMethodDescriptionlong
Get the length of the current video.default float
getRate()
Get the current rate of playback.long
getTime()
Get the current time of the playhead.default void
pause()
Pause playback.void
play()
Begin (or resume) playback.boolean
repeat()
Get whether this video will loop back to the beginning when its finished.default void
resume()
Resume playback.void
setPause
(boolean pause) Pause or resume.default boolean
setRate
(float rate) Attempt to set the rate of playback.void
setRepeat
(boolean repeat) Set whether this video should loop back to the beginning when its finished.void
setTime
(long time) Jump to a specific time.void
stop()
Stop playback.
-
Method Details
-
play
void play()Begin (or resume) playback. -
stop
void stop()Stop playback. Subsequent play will start from the beginning. -
setPause
void setPause(boolean pause) Pause or resume.- Parameters:
pause
- True to pause; false to resume.
-
pause
default void pause()Pause playback. -
resume
default void resume()Resume playback. -
setTime
void setTime(long time) Jump to a specific time.- Parameters:
time
- Time since the beginning in milliseconds.
-
getTime
long getTime()Get the current time of the playhead.- Returns:
- Time since the beginning in milliseconds.
-
getLength
long getLength()Get the length of the current video.- Returns:
- Video length in milliseconds.
-
setRepeat
void setRepeat(boolean repeat) Set whether this video should loop back to the beginning when its finished.- Parameters:
repeat
- Should repeat
-
repeat
boolean repeat()Get whether this video will loop back to the beginning when its finished.- Returns:
- Should repeat.
-
setRate
default boolean setRate(float rate) Attempt to set the rate of playback. Not all implementations or codecs support this.- Parameters:
rate
- Playback rate.- Returns:
- Was the rate successfully changed?
-
getRate
default float getRate()Get the current rate of playback.- Returns:
- Current playback rate.
-