Skip to content

Commit

Permalink
fix(CMCD): Fix reset CMCD on unload
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jun 13, 2024
1 parent 8395b91 commit c39d465
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
this.preloadDueAdManagerTimer_.stop();
}

if (this.cmcdManager_) {
this.cmcdManager_.reset();
}

if (this.cmsdManager_) {
this.cmsdManager_.reset();
}
Expand Down
10 changes: 10 additions & 0 deletions lib/util/cmcd_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ shaka.util.CmcdManager = class {
this.config_ = config;
}


/**
* Resets the CmcdManager.
*/
reset() {
this.playbackStarted_ = false;
this.buffering_ = true;
this.starved_ = false;
}

/**
* Set the buffering state
*
Expand Down

0 comments on commit c39d465

Please sign in to comment.