SpeedProvider


@UnstableApi
public interface SpeedProvider

Known direct subclasses

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

Summary

Public methods

abstract long

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

abstract float
getSpeed(long timeUs)

Returns the media speed from the provided timestamp.

Public methods

getNextSpeedChangeTimeUs

abstract long getNextSpeedChangeTimeUs(long timeUs)

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

Parameters
long timeUs

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

abstract float getSpeed(long timeUs)

Returns the media speed from the provided timestamp.

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

Parameters
long timeUs

The timestamp of the media.

Returns
float

The speed that the media should be played at.