Skip to content

Commit

Permalink
Stop level capping on media detaching (video-dev#1809)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnBartos authored Jul 19, 2018
1 parent 301af92 commit 82672f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controller/cap-level-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 82672f7

Please sign in to comment.