Skip to content

Commit

Permalink
fix: cmcd not applying configuration changes (shaka-project#5119)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
  • Loading branch information
littlespex and dsparacio committed Mar 23, 2023
1 parent 93baba2 commit 58aa45f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/player.js
Expand Up @@ -2886,8 +2886,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
};

return new shaka.net.NetworkingEngine(
onProgressUpdated_, onHeadersReceived_, onDownloadFailed_,
this.config_.cmcd.enabled ? onRequest_ : undefined);
onProgressUpdated_, onHeadersReceived_, onDownloadFailed_, onRequest_);
}

/**
Expand Down Expand Up @@ -3308,6 +3307,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (this.adManager_) {
this.adManager_.configure(this.config_.ads);
}
if (this.cmcdManager_) {
this.cmcdManager_.configure(this.config_.cmcd);
}
}

/**
Expand Down
10 changes: 10 additions & 0 deletions lib/util/cmcd_manager.js
Expand Up @@ -57,6 +57,16 @@ shaka.util.CmcdManager = class {
this.starved_ = false;
}

/**
* Called by the Player to provide an updated configuration any time it
* changes.
*
* @param {shaka.extern.CmcdConfiguration} config
*/
configure(config) {
this.config_ = config;
}

/**
* Set the buffering state
*
Expand Down

0 comments on commit 58aa45f

Please sign in to comment.