SimpleBasePlayer.PositionSupplier


protected interface SimpleBasePlayer.PositionSupplier


A supplier for a position.

Summary

Constants

default static final SimpleBasePlayer.PositionSupplier

An instance returning a constant position of zero.

Public methods

abstract long
get()

Returns the position.

default static SimpleBasePlayer.PositionSupplier
getConstant(long positionMs)

Returns an instance that returns a constant value.

default static SimpleBasePlayer.PositionSupplier
getExtrapolating(long currentPositionMs, float playbackSpeed)

Returns an instance that extrapolates the provided position into the future.

Constants

ZERO

default static final SimpleBasePlayer.PositionSupplier ZERO

An instance returning a constant position of zero.

Public methods

get

abstract long get()

Returns the position.

getConstant

default static SimpleBasePlayer.PositionSupplier getConstant(long positionMs)

Returns an instance that returns a constant value.

Parameters
long positionMs

The constant position to return, in milliseconds.

getExtrapolating

default static SimpleBasePlayer.PositionSupplier getExtrapolating(long currentPositionMs, float playbackSpeed)

Returns an instance that extrapolates the provided position into the future.

Parameters
long currentPositionMs

The current position in milliseconds.

float playbackSpeed

The playback speed with which the position is assumed to increase.