sqz269/tlmc-player-vue

Slider jumping

Closed this issue · 2 comments

Sliding the slider works. Clicking on points makes sliders jump back to original, rendering intended action ineffective

This bug is caused by how Track's playing time is synced with the slider. The playing time is handled in a separate class and fires an event every time the play time is ticked (onProgressTick). And if an onProgressTick event fires when the user is panning the slider, then the slider will prefer the event value, thus resetting to the original point.

Fix: check if a user is panning the slider when receiving an onProgressTick event; if the user is panning, then ignore the update tick.

Actually, on further investigation, this is caused by a race condition happening when a user stops panning, which sets the variable isPanningProgress.value = false;, which registers before an onProgressTick. A fix for this is to simply wrap the value set to a setTimeout with timeout value 0