formatTime

fun formatTime(time: Double, guide: Double = 0.0, preferNegative: Boolean = false): String

Return the given time in a human-readable format, such as "0:10" or "01:23:45".

If the time is infinite or NaN, this returns "--:--".

Parameters

time

the time (in seconds) to be formatted

guide

another time (in seconds) such that the returned formatted time has the same number of parts and number of leading zeros as this guide.

preferNegative

whether the returned formatted time should preferably be negative, for example because it represents the time remaining in the video.