Fix, prevent timer from 'dying' if position > duration.

This commit is contained in:
jcass 2016-02-28 08:40:23 +02:00
parent 34e2abf612
commit a9630a21b5
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
CACHE MANIFEST
# 2016-02-23:v1
# 2016-02-28:v1
NETWORK:
*

View File

@ -109,15 +109,14 @@ ProgressTimer.prototype._update = function(timestamp) {
this._callback(Math.floor(position), duration, this._running);
state.previousPosition = position;
}
this._scheduleUpdate(timestamp);
} else {
// Workaround for https://github.com/adamcik/media-progress-timer/issues/3
// This causes the timer to die unexpectedly if the position goes
// over the duration slightly.
// this._running = false;
this._callback(duration, duration, this._running);
}
this._scheduleUpdate(timestamp);
};
if(typeof module !== 'undefined') {