SpeedProvider
@UnstableApi
public interface SpeedProvider
TestSpeedProvider |
|
A custom interface that determines the speed for media at specific timestamps.
Summary
Constants |
|
|---|---|
default static final SpeedProvider |
A speed provider with default values. |
Public methods |
|
|---|---|
abstract long |
getNextSpeedChangeTimeUs(long timeUs)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. |
Constants
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 |
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. |