StandaloneMediaClock


@UnstableApi
class StandaloneMediaClock : MediaClock


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

Summary

Public constructors

Creates a new standalone media clock using the given Clock implementation.

Public functions

Long

Returns the current media position in microseconds.

Unit
resetPosition(positionUs: Long)

Resets the clock's position.

Unit

Starts the clock.

Unit

Stops the clock.

Inherited functions

From androidx.media3.exoplayer.MediaClock
Boolean

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

Public constructors

StandaloneMediaClock

StandaloneMediaClock(clock: Clock!)

Creates a new standalone media clock using the given Clock implementation.

Parameters
clock: Clock!

A Clock.

Public functions

getPositionUs

fun getPositionUs(): Long

Returns the current media position in microseconds.

resetPosition

fun resetPosition(positionUs: Long): Unit

Resets the clock's position.

Parameters
positionUs: Long

The position to set in microseconds.

start

fun start(): Unit

Starts the clock. Does nothing if the clock is already started.

stop

fun stop(): Unit

Stops the clock. Does nothing if the clock is already stopped.

Public properties

playbackParameters

var playbackParametersPlaybackParameters!