player
player copied to clipboard
Decimal-level steps on slider components
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