Skip to content

WIP: Increase update frequency of track progress bar

Tony Wasserka requested to merge neobrain/funkwhale:track_progress into develop

(Not too) naive attempt at addressing #1381 (closed).

Currently when playing back common audio tracks (length ~3 minutes) at a monitor resolution of 1920x1080 at 60 Hz, the progress bar will jump in steps of 10 pixels. Shorter tracks will jump even further, since the update frequency is fixed to 1 second.

This MR changes the track progress bar to update at the display frequency, and less often only when it'd move forward by less than a pixel. The expression Math.min(60, 1920 / this.duration) gives us this behavior, but is hardcoded against 1080p@60Hz displays, hence updating too rarely on high end displays (4K/120Hz) and too often on phones.

Suggestions for making this resolution-independent are welcome :)

Further to the increased update frequency, player.js was rounding the track progress to 0.1% duration steps, which caused further jumpiness.

TODO:

  • Make frequency updates resolution-agnostic

This Merge Request includes:

Edited by Georg Krause

Merge request reports