Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Playback can be reported prematurely when network is flaky #20

Closed
derat opened this issue Sep 12, 2021 · 0 comments
Closed

Playback can be reported prematurely when network is flaky #20

derat opened this issue Sep 12, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@derat
Copy link
Owner

derat commented Sep 12, 2021

This code from onTimeUpdate_ in music-player.js is problematic:

      const now = getCurrentTimeSec();
      if (this.lastUpdateTime_ > 0) {
        this.totalPlayedSec_ += now - this.lastUpdateTime_;
      }
      this.lastUpdateTime_ = now;

If playback is hanging due to the network being flaky but then resumes later, totalPlayedSec_ gets incremented by the elapsed wall time rather than the amount of the song that was played.

It'd probably be easy to do something smarter using lastTimeUpdatePosition_. I should check what I did in the Android app.

@derat derat added the bug Something isn't working label Sep 12, 2021
@derat derat self-assigned this Sep 12, 2021
@derat derat closed this as completed in 4a40f68 Nov 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant