From df55944e8f49bdf8e34a679219cd6596ba46c777 Mon Sep 17 00:00:00 2001 From: Casey Occhialini <1508707+littlespex@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:08:42 -0500 Subject: [PATCH] fix: Fix missing throughput in CMCD for HLS live (#3874) * Use dynamic reference to abrManager Fixes #3873 Co-authored-by: Dan Sparacio --- lib/player.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/player.js b/lib/player.js index bdb52cbfed..e3c74dca97 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2817,11 +2817,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget { * @private */ createCmcd_() { - const abr = this.abrManager_; - /** @type {shaka.util.CmcdManager.PlayerInterface} */ const playerInterface = { - getBandwidthEstimate: () => abr ? abr.getBandwidthEstimate() : NaN, + getBandwidthEstimate: () => this.abrManager_ ? + this.abrManager_.getBandwidthEstimate() : NaN, getBufferedInfo: () => this.getBufferedInfo(), getCurrentTime: () => this.video_ ? this.video_.currentTime : 0, getVariantTracks: () => this.getVariantTracks(),