diff --git a/lib/media/playhead.js b/lib/media/playhead.js index 8c37794768..9542c5bf95 100644 --- a/lib/media/playhead.js +++ b/lib/media/playhead.js @@ -228,7 +228,12 @@ shaka.media.Playhead.prototype.onWatchdogTimer_ = function() { var fudgeFactor = shaka.media.Playhead.FUDGE_FACTOR_; var threshold = shaka.media.Playhead.UNDERFLOW_THRESHOLD_; - var duration = this.video_.duration - fudgeFactor; + var duration; + if (this.timeline_.isLive()) { + duration = this.timeline_.getSegmentAvailabilityEnd() - fudgeFactor; + } else { + duration = this.video_.duration - fudgeFactor; + } var atEnd = (bufferEnd >= duration) || (this.video_.ended); if (!this.buffering_) {