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 authored and joeyparrish committed Feb 17, 2024
1 parent f6fea75 commit 468425a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hls/hls_parser.js
Expand Up @@ -2760,6 +2760,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 468425a

Please sign in to comment.