# SimpleBasePlayer.PositionSupplier

# SimpleBasePlayer.PositionSupplier

Artifact:[androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/common/SimpleBasePlayer.java+class:androidx.media3.common.SimpleBasePlayer.PositionSupplier)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PositionSupplier "View this page in Java")

<br />

```
interface SimpleBasePlayer.PositionSupplier
```

<br />

Known direct subclasses  
[SimpleBasePlayer.LivePositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.LivePositionSupplier)  

|------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SimpleBasePlayer.LivePositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.LivePositionSupplier) | A[PositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier)connected to a live provider that returns a new value on each invocation until it is[disconnected](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.LivePositionSupplier#disconnect(long))from the live source. |

*** ** * ** ***

A supplier for a position.

Convenience methods and classes for creating position suppliers:

- Use[getConstant](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#getConstant(long))for constant or non-moving positions.
- Use[getExtrapolating](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#getExtrapolating(long,float))for positions advancing with the system clock from a provided start time.
- Use[LivePositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.LivePositionSupplier)for positions that can be directly obtained from a live system. Note that these suppliers should be[disconnected](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.LivePositionSupplier#disconnect(long))from the live source as soon as the position is no longer valid, for example after a position discontinuity.

## Summary

|                                                                      ### Constants                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[SimpleBasePlayer.PositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier)`!` | [ZERO](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#ZERO()) An instance returning a constant position of zero. |

|                                                                     ### Public functions                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                 | [get](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#get())`()` Returns the position.                                                                                                                                                                                                                                                                                                |
| `java-static `[SimpleBasePlayer.PositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier)`!` | [getConstant](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#getConstant(long))`(positionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns an instance that returns a constant value.                                                                                                                                                    |
| `java-static `[SimpleBasePlayer.PositionSupplier](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier)`!` | [getExtrapolating](https://developer.android.com/reference/kotlin/androidx/media3/common/SimpleBasePlayer.PositionSupplier#getExtrapolating(long,float))`(currentPositionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, playbackSpeed: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns an instance that extrapolates the provided position into the future. |

## Constants

### ZERO

```
const val ZERO: SimpleBasePlayer.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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The current position in milliseconds.                              |
| `playbackSpeed: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The playback speed with which the position is assumed to increase. |