diff --git a/api-extractor/report/hls.js.api.md b/api-extractor/report/hls.js.api.md index df343a01ac0..8d013786f1c 100644 --- a/api-extractor/report/hls.js.api.md +++ b/api-extractor/report/hls.js.api.md @@ -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) diff --git a/src/controller/subtitle-stream-controller.ts b/src/controller/subtitle-stream-controller.ts index 73e250d2c1c..b1ecf80612f 100644 --- a/src/controller/subtitle-stream-controller.ts +++ b/src/controller/subtitle-stream-controller.ts @@ -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; }