@UnstableApi
interface MediaClock

Known direct subclasses
DecoderAudioRenderer

Decodes and renders audio using a Decoder.

FakeMediaClockRenderer

Fake abstract Renderer which is also a MediaClock.

MediaCodecAudioRenderer

Decodes and renders audio using MediaCodec and an AudioSink.

StandaloneMediaClock

A MediaClock whose position advances with real time based on the playback parameters when started.


Tracks the progression of media time.

Summary

Public functions

PlaybackParameters!

Returns the active playback parameters.

Long

Returns the current media position in microseconds.

Boolean

Returns whether there is a skipped silence since the last call to this method.

Unit

Attempts to set the playback parameters.

Public functions

getPlaybackParameters

fun getPlaybackParameters(): PlaybackParameters!

Returns the active playback parameters.

getPositionUs

fun getPositionUs(): Long

Returns the current media position in microseconds.

hasSkippedSilenceSinceLastCall

fun hasSkippedSilenceSinceLastCall(): Boolean

Returns whether there is a skipped silence since the last call to this method.

setPlaybackParameters

fun setPlaybackParameters(playbackParameters: PlaybackParameters!): Unit

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.