player icon indicating copy to clipboard operation
player copied to clipboard

Decimal-level steps on slider components

Open ebitonte opened this issue 1 year ago • 0 comments

Describe:

I've built a slider that allows me to modify clipStartTime and clipEndTime on a player, however using Vidstack's slider, I'm only able to do so on a whole second granularity due to the Math.round being passed to its SliderController as the rounding function. TimeSlider doesn't suffer from the same issue because it uses a custom rounding function that keeps 3 decimal places..

Any reason to not have the generic slider (and others) to use custom rounding in order to support decimal-level steps? Is there some pitfall that I'm not considering that would make this a bad idea, other than just not using native rounding?

Alternatives:

  • Using alternate slider implementations (like Radix, et al)
  • Use existing round function to automatically round slider values to the number of decimal places on the supplied step

ebitonte avatar Sep 20 '24 15:09 ebitonte