SimpleBasePlayer.PositionSupplier


protected interface SimpleBasePlayer.PositionSupplier

Known direct subclasses
SimpleBasePlayer.LivePositionSupplier

A PositionSupplier connected to a live provider that returns a new value on each invocation until it is disconnected from the live source.


A supplier for a position.

Convenience methods and classes for creating position suppliers:

  • Use getConstant for constant or non-moving positions.
  • Use getExtrapolating for positions advancing with the system clock from a provided start time.
  • Use LivePositionSupplier for positions that can be directly obtained from a live system. Note that these suppliers should be disconnected from the live source as soon as the position is no longer valid, for example after a position discontinuity.

Summary

Constants

const SimpleBasePlayer.PositionSupplier!

An instance returning a constant position of zero.

Public functions

Long
get()

Returns the position.

java-static SimpleBasePlayer.PositionSupplier!
getConstant(positionMs: Long)

Returns an instance that returns a constant value.

java-static SimpleBasePlayer.PositionSupplier!
getExtrapolating(currentPositionMs: Long, playbackSpeed: Float)

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

Constants

ZERO

const val ZEROSimpleBasePlayer.PositionSupplier!

An instance returning a constant position of zero.

Public functions

get

fun get(): Long

Returns the position.

getConstant

java-static fun getConstant(positionMs: Long): SimpleBasePlayer.PositionSupplier!

Returns an instance that returns a constant value.

Parameters
positionMs: Long

The constant position to return, in milliseconds.

getExtrapolating

java-static fun getExtrapolating(currentPositionMs: Long, playbackSpeed: Float): SimpleBasePlayer.PositionSupplier!

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

Parameters
currentPositionMs: Long

The current position in milliseconds.

playbackSpeed: Float

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