colthreepv / colthreepv/angular-media-player

currentTime not reset for multiple loads

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
228
Forks
69
PR merge metrics
No merged PRs in 30d

Description

`player.currentTime` is not reset after a `player.load(...)` is called for the **2nd time**.

`player.playing` is true and the `player.currentTime` is set to the previous currentTime. This causes the progress bar to jump briefly before being set correctly.

Our current workaround is to:

``` javascript
// bug fix for player... reset currentTime to zero when track is 0
$scope.$watch("player.currentTrack", function(newVal,oldVal) {
if( newVal != oldVal && newVal === 0 && $scope.player.currentTime > 0) {
$scope.player.currentTime = 0;
}
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing two consecutive player.load(...) calls while player.playing is true, then inspect the player state handling around currentTime and currentTrack. Compare the behavior with the workaround watcher shown in the issue; done means the progress bar does not briefly show the previous track position after the second load.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.