Skip to content

Commit 5725e19

Browse files
committed
fix: 🐛 (hls) 修复结尾ts文件一直不加载,导致播放卡住问题
1 parent e2ec981 commit 5725e19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/xgplayer-hls/src/hls/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ export class Hls extends EventEmitter {
520520
bInfo = this.bufferInfo(bInfo.nextStart || 0.5)
521521
}
522522
const bufferThroughout = Math.abs(bInfo.end - this.media.duration) < maxBufferThroughout
523-
if (bInfo.remaining >= config.preloadTime || bufferThroughout) {
523+
// Only stop loading if we've buffered enough preload time or reached end AND all segments are loaded
524+
if (bInfo.remaining >= config.preloadTime || (bufferThroughout && !nextSegment)) {
524525
this._tryEos()
525526
return
526527
}

0 commit comments

Comments
 (0)