diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index f086346c73..035dc988ea 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -314,6 +314,9 @@ shaka.hls.HlsParser = class { this.presentationTimeline_.setDuration(Math.min(...maxTimestamps)); this.playerInterface_.updateDuration(); } + if (stillLive) { + this.determineDuration_(); + } } /** @@ -401,6 +404,8 @@ shaka.hls.HlsParser = class { const newestSegment = segments[segments.length - 1]; goog.asserts.assert(newestSegment, 'Should have segments!'); + streamInfo.maxTimestamp = newestSegment.endTime; + // Once the last segment has been added to the playlist, // #EXT-X-ENDLIST tag will be appended. // If that happened, treat the rest of the EVENT presentation as VOD. @@ -411,7 +416,6 @@ shaka.hls.HlsParser = class { // Flag this for later. We don't convert the whole presentation into VOD // until we've seen the ENDLIST tag for all active playlists. streamInfo.hasEndList = true; - streamInfo.maxTimestamp = newestSegment.endTime; } }