From a4a96e74472b273496e17951684999c014f2270f Mon Sep 17 00:00:00 2001 From: Casey Occhialini <1508707+littlespex@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:34:57 -0800 Subject: [PATCH 1/2] Use dynamic reference to abrManager --- lib/player.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/player.js b/lib/player.js index bdb52cbfed..570eb7c4b1 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2817,11 +2817,9 @@ 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(), From 26d2a5efdac094c76f9f45bad8cfacfc5ac34826 Mon Sep 17 00:00:00 2001 From: Casey Occhialini <1508707+littlespex@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:37:35 -0800 Subject: [PATCH 2/2] no message --- lib/player.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/player.js b/lib/player.js index 570eb7c4b1..e3c74dca97 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2819,7 +2819,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget { createCmcd_() { /** @type {shaka.util.CmcdManager.PlayerInterface} */ const playerInterface = { - getBandwidthEstimate: () => this.abrManager_ ? this.abrManager_.getBandwidthEstimate() : NaN, + getBandwidthEstimate: () => this.abrManager_ ? + this.abrManager_.getBandwidthEstimate() : NaN, getBufferedInfo: () => this.getBufferedInfo(), getCurrentTime: () => this.video_ ? this.video_.currentTime : 0, getVariantTracks: () => this.getVariantTracks(),