Closed adrums86 closed 1 year ago
Merging #1410 (84275c1) into main (2079454) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #1410 +/- ##
=======================================
Coverage 85.55% 85.56%
=======================================
Files 41 41
Lines 10145 10146 +1
Branches 2351 2352 +1
=======================================
+ Hits 8680 8681 +1
Misses 1465 1465
Files Changed | Coverage Δ | |
---|---|---|
src/segment-loader.js | 96.48% <100.00%> (+<0.01%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Description
After a LOT of debugging with playlist changes against a linear DASH stream, I discovered we're calling
resetLoader
when setting a new playlist (during a rendition switch), which setsfetchAtBuffer_
to false then callsresyncLoader
. This sets themediaIndex
to null, which eventually on the nextchooseNextRequest_
call (which as implied, chooses the next segment to request) forces us into the else logic. BecausefetchAtBuffer_
is false, we begin requesting segments from thecurrentTime
rather than the end of the buffer. This causes the playback watcher to assume a segment download has stalled, because when we request segments at thecurrentTime
we're either requesting cached segments or overwriting segments that were already buffered, which results in the buffer not changing and an increment of the stalled segment counter.Specific Changes proposed
Since this logic was originally implemented as an fix for LLHLS playback (see: https://github.com/videojs/http-streaming/pull/1201) we can isolate it to LLHLS streams by checking for a
partTargetDuration
on the playlist, which is required for LLHLS streams, see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.3.7. This greatly reduces the re-requesting of already buffered and cached segment requests during live playback and in turn the stability of these streams as the buffer isn't being artificially starved during a rendition switch.Requirements Checklist