captbaritone / captbaritone/webamp

Seeking bar positions

Open
#498 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
796
PR merge metrics
No merged PRs in 30d

Description

As a kid, I used to watch the Winamp playing music. Not being allowed to touch anything, I was "analyzing" the UI. One thing that I liked watching was the seeking bar's position being updated with the elapsed time (and how it would depend on the song's length). It, unfortunately, doesn't work nicely in the winamp2-js:

![Seeking bar - original Winamp first, winamp2-js second](https://user-images.githubusercontent.com/1062898/37245197-f844d270-2494-11e8-9c3a-b9b7afc49892.gif)

Not sure if you already noticed that (I couldn't find it in the Issues). It gets updated more often, and the steps are not uniform (at least for songs shorter than 100s).

[Flooring the elapsed time when calculating the position](https://github.com/durasj/winamp2-js/commit/994da15f552cf859cb929b2ab713b499e85e90bd) how it's done in the getTimeObj would sync them when playing:

![seeking-fxed](https://user-images.githubusercontent.com/1062898/37245458-720c2f60-2498-11e8-9d54-1c95358f9183.gif)

The harder problem is defining the steps on the range element. Since 100 is not divisible by every number <100 (we need a natural number as the step attr), I think the best solution would be to set min=0, max=Math.min(100, Math.floor(elapsed)), step=1. But some things would get slightly more complicated.

What do you please think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.