Skip to content

fix(hls): limit preload across buffered islands#1908

Open
gemxx wants to merge 1 commit into
mainfrom
fix/hls-buffered-islands-preload
Open

fix(hls): limit preload across buffered islands#1908
gemxx wants to merge 1 commit into
mainfrom
fix/hls-buffered-islands-preload

Conversation

@gemxx
Copy link
Copy Markdown
Collaborator

@gemxx gemxx commented May 7, 2026

Account for discontinuous buffered islands before the next segment when checking VOD preload length, following hls.js max-buffer behavior.

Fixes #1906

Account for discontinuous buffered islands before the next segment when checking VOD preload length, following hls.js max-buffer behavior.

Fixes #1906
const preloadBufferLength = this._getPreloadBufferLength(bInfo, nextSegment)
// Only stop loading if we've buffered enough preload time or reached end AND all segments are loaded
if (bInfo.remaining >= config.preloadTime || (bufferThroughout && !nextSegment)) {
if (preloadBufferLength >= config.preloadTime || (bufferThroughout && !nextSegment)) {
const preloadBufferLength = this._getPreloadBufferLength(bInfo, nextSegment)
// Only stop loading if we've buffered enough preload time or reached end AND all segments are loaded
if (bInfo.remaining >= config.preloadTime || (bufferThroughout && !nextSegment)) {
if (preloadBufferLength >= config.preloadTime || (bufferThroughout && !nextSegment)) {
@gemxx gemxx self-assigned this May 8, 2026
@gemxx gemxx added the hls xgplayer-hls label May 8, 2026
@gemxx gemxx added this to the v3.0.25 milestone May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hls xgplayer-hls

Projects

None yet

Development

Successfully merging this pull request may close these issues.

如果buffer中出现多个孤岛后,会导致短期内频繁的拉取后面数据

1 participant