Skip to content

fix: honor maxPlaylistRetries for single-media HLS playlists - #1613

Open
cpruijsen wants to merge 1 commit into
videojs:mainfrom
cpruijsen:fix/issue-1596
Open

cpruijsen wants to merge 1 commit into
videojs:mainfrom
cpruijsen:fix/issue-1596

Conversation

@cpruijsen

Copy link
Copy Markdown

Description

Single HLS media playlists (no master) stop retrying once playlistErrors_ exceeds maxPlaylistRetries. Fixes #1596.

maxPlaylistRetries did not stop playlist reloads when the source was a single HLS media playlist (no master). excludePlaylist retried the only playlist whenever playlistExclusionDuration was finite, and never reached the existing playlistErrors_ > maxPlaylistRetries check that indefinitely excludes a variant on a multi-rendition master.

A single media playlist is still retried while playlistErrors_ is within the cap (default remains Infinity). Once the cap is exceeded, the playlist is excluded forever and playback errors, same as the existing "exclude the only playlist only if excluded forever" path.

The reporter reproduced infinite retries on a single media .m3u8 and confirmed the cap already works with a master that has multiple variants. README documents that retry attempts must exceed maxPlaylistRetries before indefinite exclusion.

The change skips the single-playlist early return when playlistErrors_ exceeds maxPlaylistRetries. The other option was to set playlistExclusionDuration to Infinity when retries are exhausted, and leave the early-return condition unchanged. Skipping the early return matches the later playlistErrors_ check in the same function and the existing "only playlist / excluded forever" behavior. Smallest reversible change. Happy to switch to the duration-to-Infinity approach if that is preferred.

Specific Changes proposed

  • src/playlist-controller.js: do not retry the only playlist once playlistErrors_ exceeds maxPlaylistRetries.
  • test/playlist-controller.test.js: cover a media-only source (manifest/media.m3u8) with maxPlaylistRetries: 1. First error retries, second error excludes forever and errors.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

Single-playlist sources skipped exclusion unless exclude duration was Infinity, so maxPlaylistRetries never stopped reload attempts.
@welcome

welcome Bot commented Sep 12, 2026

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maxPlaylistRetries does not work for single-media (no master) HLS playlists

1 participant