Hls.js going after old ts segments after Stop/Resume. #6854
Labels
Bug
Needs Triage
If there is a suspected stream issue, apply this label to triage if it is something we should fix.
What version of Hls.js are you using?
1.5.7
What browser (including version) are you using?
Chrome Version 131.0.6778.70
What OS (including version) are you using?
Windows 11
Test stream
No response
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
we have stop/resume feature in our hls.js player for Live Playback.
When the user stops the playback, we call stopLoad() and detachMedia(). On resume, we call startLoad() followed by attachMedia().
The issue I’m encountering is that after resuming, hls.js sends a level playlist request, but it gets canceled, and the player starts requesting old .ts segments instead.
I've attached a screenshot with color-coded blocks:
we have clean up process in our multicast playback which removes old ts segments. That's why you will see 404s for the old after user resumes the playback.
we do have higher frag retry count and once retry exhausts, we try to recover one more time by calling stopLoad and startLoad. At this time, Hls.js gets the refreshed playlist and start fetching new segments but It never plays the Video.
In our other playback modality like Play from a cache serve, we don't cleanup old ts segments that often. So, Hls.js requests one or two old ts segments and it gets 200 response but by that time it gets a refreshed Level playlist and all plays fine.
Expected behaviour
If TS segments have already been loaded and the stopLoad() method is called, then upon calling startLoad() again, hls.js should not request the previously fetched TS segments, as they were already successfully retrieved.
What actually happened?
After calling stopLoad() followed by startLoad(), Hls.js requests old TS segments. When these requests result in 404 errors, it cancels the level playlist call. Once the TS segment retries are exhausted, we attempt to recover playback by calling stopLoad() and startLoad() again. While the player receives the refreshed playlist and begins fetching new segments, it gets stuck and fails to play the stream.
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: