benwiley4000 / cassette

📼 A flexible media player component library for React that requires no up-front config
https://benwiley4000.github.io/cassette/styleguide
MIT License
184 stars 28 forks source link

Timestamp rounds up to nearest second, MediaStatusBar momentarily reads :60 #428

Closed abrahamian closed 5 years ago

abrahamian commented 5 years ago

You can reproduce this bug simply by playing a track in the live style guide. When the playback time is between 59.5 and 60, the timestamp in the MediaStatusBar displays :60

Screen Shot 2019-06-27 at 3 49 34 PM

The problem lies in the convertToTime function, which rounds up to the nearest second. It should instead round down, so that the number displayed represents elapsed seconds.

benwiley4000 commented 5 years ago

@abrahamian I checked a few random players online (Vimeo, YouTube, Bandcamp) and indeed it seems the behavior you're suggesting is standard. Thanks for flagging this problem! I'd be happy to take a pull request if you'd like to work on it.

benwiley4000 commented 5 years ago

Ah, just realized you already left one! Thanks! :)