Skip to content

Commit

Permalink
Merge pull request #2506 from jony89/master
Browse files Browse the repository at this point in the history
fix: computeLivePosition minimum value of media.currentTime
  • Loading branch information
robwalch committed Feb 26, 2020
2 parents 4f084c9 + 95f32a1 commit 7e06413
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controller/stream-controller.js
Expand Up @@ -280,9 +280,9 @@ class StreamController extends BaseStreamController {

if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {
let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);
logger.log(`buffer end: ${bufferEnd.toFixed(3)} is located too far from the end of live sliding playlist, reset currentTime to : ${liveSyncPosition.toFixed(3)}`);
bufferEnd = liveSyncPosition;
if (media && !media.paused && media.readyState && media.duration > liveSyncPosition) {
if (media && !media.paused && media.readyState && media.duration > liveSyncPosition && liveSyncPosition > media.currentTime) {
logger.log(`buffer end: ${bufferEnd.toFixed(3)} is located too far from the end of live sliding playlist, reset currentTime to : ${liveSyncPosition.toFixed(3)}`);
media.currentTime = liveSyncPosition;
}

Expand Down

0 comments on commit 7e06413

Please sign in to comment.