From 82672f7248a8cf49e9367530a6b0976a0ccb128a Mon Sep 17 00:00:00 2001 From: John Bartos Date: Thu, 19 Jul 2018 10:32:56 -0400 Subject: [PATCH] Stop level capping on media detaching (#1809) --- src/controller/cap-level-controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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;