From 1c892045dd5df5a2c831c6aac79428eca058415c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 9 May 2023 16:37:14 +0200 Subject: [PATCH] fix(HLS): Fix seekRange for EVENT playlist not using EXT-X-PLAYLIST-TYPE (#5220) --- lib/hls/hls_parser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } }