StandaloneMediaClock
@UnstableApi
public final class StandaloneMediaClock implements MediaClock
A MediaClock whose position advances with real time based on the playback parameters when started.
Summary
Public fields |
|
|---|---|
PlaybackParameters |
Public constructors |
|---|
StandaloneMediaClock(Clock clock)Creates a new standalone media clock using the given |
Public methods |
|
|---|---|
PlaybackParameters |
Returns the active playback parameters. |
long |
Returns the current media position in microseconds. |
void |
resetPosition(long positionUs)Resets the clock's position. |
void |
setPlaybackParameters(PlaybackParameters playbackParameters)Attempts to set the playback parameters. |
void |
start()Starts the clock. |
void |
stop()Stops the clock. |
Inherited methods |
||
|---|---|---|
|
Public fields
Public constructors
StandaloneMediaClock
public StandaloneMediaClock(Clock clock)
Creates a new standalone media clock using the given Clock implementation.
Public methods
getPlaybackParameters
public PlaybackParameters getPlaybackParameters()
Returns the active playback parameters.
resetPosition
public void resetPosition(long positionUs)
Resets the clock's position.
| Parameters | |
|---|---|
long positionUs |
The position to set in microseconds. |
setPlaybackParameters
public void setPlaybackParameters(PlaybackParameters playbackParameters)
Attempts to set the playback parameters. The media clock may override the speed if changing the playback parameters is not supported.
| Parameters | |
|---|---|
PlaybackParameters playbackParameters |
The playback parameters to attempt to set. |