Formats track lengths for the media player and the global player's tracklist.

Functions

f
fmt(s: number): string

Returns s seconds as m:ss, or 0:00 when s isn't finite, as a media element's duration is until its metadata loads.

Usage

import * as mod from "src/utils/player/duration.ts";