diff --git a/src/controller/cap-level-controller.js b/src/controller/cap-level-controller.js index 6aaf8309442..af09d9b7b55 100644 --- a/src/controller/cap-level-controller.js +++ b/src/controller/cap-level-controller.js @@ -11,7 +11,8 @@ class CapLevelController extends EventHandler { Event.FPS_DROP_LEVEL_CAPPING, Event.MEDIA_ATTACHING, Event.MANIFEST_PARSED, - Event.BUFFER_CODECS); + Event.BUFFER_CODECS, + Event.MEDIA_DETACHING); this.autoLevelCapping = Number.POSITIVE_INFINITY; this.firstLevel = null; @@ -64,6 +65,10 @@ class CapLevelController extends EventHandler { this.levels = data.levels; } + onMediaDetaching () { + this._stopCapping(); + } + detectPlayerSize () { if (this.media) { let levelsLength = this.levels ? this.levels.length : 0;