Skip to content

Commit

Permalink
Clear subtitle-stream-controller buffered list on detach (#5355)
Browse files Browse the repository at this point in the history
Fixes #5353
  • Loading branch information
robwalch authored Mar 29, 2023
1 parent 643cc5a commit 4160070
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,8 @@ export class SubtitleStreamController extends BaseStreamController implements Ne
onLevelLoaded(event: Events.LEVEL_LOADED, data: LevelLoadedData): void;
// (undocumented)
onManifestLoading(): void;
// (undocumented)
onMediaDetaching(): void;
// Warning: (ae-forgotten-export) The symbol "SubtitleFragProcessed" needs to be exported by the entry point hls.d.ts
//
// (undocumented)
Expand Down
5 changes: 5 additions & 0 deletions src/controller/subtitle-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export class SubtitleStreamController
this.fragmentTracker.removeAllFragments();
}

onMediaDetaching(): void {
this.tracksBuffered = [];
super.onMediaDetaching();
}

onLevelLoaded(event: Events.LEVEL_LOADED, data: LevelLoadedData) {
this.mainDetails = data.details;
}
Expand Down

0 comments on commit 4160070

Please sign in to comment.