androidx.media3.ui.compose.material3.indicator

Classes

TimeFormat

A class for specifying the format of the time to be displayed by TimeText.

Top-level functions summary

Unit

A composable that displays the duration of the media.

Unit
@UnstableApi
@Composable
PositionAndDurationText(
    player: Player,
    modifier: Modifier,
    separator: String,
    scope: CoroutineScope
)

A composable that displays the duration of the media.

Unit

A composable that displays the current position of the player.

Unit
@UnstableApi
@Composable
RemainingDurationText(
    player: Player,
    modifier: Modifier,
    showNegative: Boolean,
    scope: CoroutineScope
)

A composable that displays the duration of the media.

Unit
@UnstableApi
@Composable
TimeText(
    player: Player,
    modifier: Modifier,
    timeFormat: TimeFormat,
    scope: CoroutineScope
)

Progress indicator that represents the Player's progress state in textual form.

Top-level functions

@UnstableApi
@Composable
fun DurationText(
    player: Player,
    modifier: Modifier = Modifier,
    scope: CoroutineScope = rememberCoroutineScope()
): Unit

A composable that displays the duration of the media.

Parameters
player: Player

The Player to get the duration from.

modifier: Modifier = Modifier

The Modifier to be applied to the text.

scope: CoroutineScope = rememberCoroutineScope()

The CoroutineScope to use for listening to player progress updates.

PositionAndDurationText

@UnstableApi
@Composable
fun PositionAndDurationText(
    player: Player,
    modifier: Modifier = Modifier,
    separator: String = " / ",
    scope: CoroutineScope = rememberCoroutineScope()
): Unit

A composable that displays the duration of the media.

Parameters
player: Player

The Player to get the duration from.

modifier: Modifier = Modifier

The Modifier to be applied to the text.

separator: String = " / "

The separator string to be used between the current position and duration.

scope: CoroutineScope = rememberCoroutineScope()

The CoroutineScope to use for listening to player progress updates.

@UnstableApi
@Composable
fun PositionText(
    player: Player,
    modifier: Modifier = Modifier,
    scope: CoroutineScope = rememberCoroutineScope()
): Unit

A composable that displays the current position of the player.

Parameters
player: Player

The Player to get the position from.

modifier: Modifier = Modifier

The Modifier to be applied to the text.

scope: CoroutineScope = rememberCoroutineScope()

The CoroutineScope to use for listening to player progress updates.

@UnstableApi
@Composable
fun RemainingDurationText(
    player: Player,
    modifier: Modifier = Modifier,
    showNegative: Boolean = false,
    scope: CoroutineScope = rememberCoroutineScope()
): Unit

A composable that displays the duration of the media.

Parameters
player: Player

The Player to get the duration from.

modifier: Modifier = Modifier

The Modifier to be applied to the text.

showNegative: Boolean = false

Whether to display the remaining time with a minus sign.

scope: CoroutineScope = rememberCoroutineScope()

The CoroutineScope to use for listening to player progress updates.

@UnstableApi
@Composable
fun TimeText(
    player: Player,
    modifier: Modifier = Modifier,
    timeFormat: TimeFormat,
    scope: CoroutineScope = rememberCoroutineScope()
): Unit

Progress indicator that represents the Player's progress state in textual form.

It displays the up-to-date current position and duration of the media, formatted by getStringForTime.

Parameters
player: Player

The Player to get the progress from.

modifier: Modifier = Modifier

The Modifier to be applied to the text.

timeFormat: TimeFormat

The TimeFormat to use for displaying the time.

scope: CoroutineScope = rememberCoroutineScope()

Coroutine scope to listen to the progress updates from the player.