Skip to content

Commit

Permalink
fix(HLS): Live recovery after disconnects (#6048)
Browse files Browse the repository at this point in the history
Fixes #6019
  • Loading branch information
avelad committed Jan 9, 2024
1 parent df05692 commit 8476631
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hls/hls_parser.js
Expand Up @@ -3471,6 +3471,13 @@ shaka.hls.HlsParser = class {
if (this.isLive_() && mediaSequenceToStartTime.has(position)) {
firstStartTime = mediaSequenceToStartTime.get(position);
}
// This is for recovering from disconnects.
if (firstStartTime === 0 &&
this.presentationType_ == shaka.hls.HlsParser.PresentationType_.LIVE &&
mediaSequenceToStartTime.size > 0 &&
!mediaSequenceToStartTime.has(position)) {
firstStartTime = this.presentationTimeline_.getSegmentAvailabilityStart();
}

/** @type {!Array.<!shaka.media.SegmentReference>} */
const references = [];
Expand Down

0 comments on commit 8476631

Please sign in to comment.