SpeedProvider


@UnstableApi
interface SpeedProvider

Known direct subclasses

A custom interface that determines the speed for media at specific timestamps.

Summary

Public functions

Long

Returns the timestamp of the next speed change, if there is any.

Float
getSpeed(timeUs: Long)

Returns the media speed from the provided timestamp.

Public functions

getNextSpeedChangeTimeUs

fun getNextSpeedChangeTimeUs(timeUs: Long): Long

Returns the timestamp of the next speed change, if there is any.

Parameters
timeUs: Long

A timestamp, in microseconds.

Returns
Long

The timestamp of the next speed change, in microseconds, or TIME_UNSET if there is no next speed change. If timeUs corresponds to a speed change, the returned value corresponds to the following speed change.

getSpeed

fun getSpeed(timeUs: Long): Float

Returns the media speed from the provided timestamp.

The media speed will stay the same until the next specified speed change.

Parameters
timeUs: Long

The timestamp of the media.

Returns
Float

The speed that the media should be played at.