@UnstableApi
class TimeFormat


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

Instances of this class can be created using the factory methods, such as position, duration, remaining, and positionAndDuration.

Summary

Public companion functions

TimeFormat

Creates a TimeFormat that displays the total duration of the media.

TimeFormat

Creates a TimeFormat that displays the current position of the player.

TimeFormat

Creates a TimeFormat that displays both the current position and the total duration.

TimeFormat
remaining(showNegative: Boolean)

Creates a TimeFormat that displays the remaining time of the media.

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public companion functions

duration

fun duration(): TimeFormat

Creates a TimeFormat that displays the total duration of the media.

position

fun position(): TimeFormat

Creates a TimeFormat that displays the current position of the player.

positionAndDuration

fun positionAndDuration(separator: String = " / "): TimeFormat

Creates a TimeFormat that displays both the current position and the total duration.

Parameters
separator: String = " / "

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

remaining

fun remaining(showNegative: Boolean = false): TimeFormat

Creates a TimeFormat that displays the remaining time of the media.

Parameters
showNegative: Boolean = false

Whether to display the remaining time with a minus sign.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int