slowly adding seek bar, now it can increment over time.

This commit is contained in:
2025-04-10 19:08:57 -04:00
parent f896587663
commit be2fad3190
7 changed files with 199 additions and 11 deletions
+3 -3
View File
@@ -174,9 +174,9 @@ func (p *Player) MuteToggle() error {
}
// return the current position as an int between 0 and 100 to work with progress bar easily.
func (p *Player) CurrentPosition() (float64, error) {
pos := 100.0 * float64(p.seeker.Position()) / float64(p.seeker.Len())
return pos, nil
func (p *Player) CurrentPosition() (int, error) {
pos := math.Round(100.0 * float64(p.seeker.Position()) / float64(p.seeker.Len()))
return int(pos), nil
}
// TODO: double check best type for percentage parameter