File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -297,9 +297,22 @@ export default class BaseStreamController
297297 return lastPartBuffered ;
298298 }
299299
300- const playlistType =
301- levelDetails . fragments [ levelDetails . fragments . length - 1 ] . type ;
302- return this . fragmentTracker . isEndListAppended ( playlistType ) ;
300+ const lastFragment =
301+ levelDetails . fragments [ levelDetails . fragments . length - 1 ] ;
302+ const playlistType = lastFragment . type ;
303+ if ( this . fragmentTracker . isEndListAppended ( playlistType ) ) {
304+ return true ;
305+ }
306+ // When a live playlist transitions to VOD (ENDLIST added), the last
307+ // fragment in the updated playlist has endList=true but the fragment
308+ // tracker entity was created before ENDLIST was known. Check if the
309+ // last fragment is actually buffered even though endListFragments
310+ // was never populated for it.
311+ if ( lastFragment . endList ) {
312+ const state = this . fragmentTracker . getState ( lastFragment ) ;
313+ return state === FragmentState . OK || state === FragmentState . PARTIAL ;
314+ }
315+ return false ;
303316 }
304317
305318 public getLevelDetails ( ) : LevelDetails | undefined {
You can’t perform that action at this time.
0 commit comments