diff --git a/hls-player.js b/hls-player.js index 08ee5ff..c83deca 100644 --- a/hls-player.js +++ b/hls-player.js @@ -90,7 +90,7 @@ class VideoLoader { // remove old segments every 1 min let timeout = 60000; // if removal cannot happen since buffer is busy, try again in a bit - if (!this.media_buffer.updating) { + if (!this.media_buffer.updating && this.media_buffer.buffered.end(0) - 60 > this.media_buffer.buffered.start(0)) { // remove segments that are older than 1min behind the current end of buffer this.media_buffer.remove(0, this.media_buffer.buffered.end(0) - 60); } else {