feat: display remaining time instead of total duration in AudioPlayer
This commit is contained in:
parent
e69395dca0
commit
ed4800de6e
1 changed files with 3 additions and 1 deletions
|
|
@ -98,7 +98,9 @@ export default function AudioPlayer({ src, className }: AudioPlayerProps) {
|
|||
<Slider value={[currentTime]} max={duration || 100} step={1} onValueChange={handleSeek} />
|
||||
</div>
|
||||
|
||||
<div className="text-sm font-mono text-muted-foreground">{formatTime(duration)}</div>
|
||||
<div className="text-sm font-mono text-muted-foreground">
|
||||
{formatTime(Math.max(duration - currentTime, 0))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue