shaka-player 4.13.1 → 4.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,6 +78,8 @@ shaka.ui.AdStatisticsButton = class extends shaka.ui.Element {
78
78
  /** @private {!shaka.extern.AdsStats} */
79
79
  this.currentStats_ = this.adManager.getStats();
80
80
 
81
+ shaka.ui.Utils.setDisplay(this.button_, this.currentStats_.started > 0);
82
+
81
83
  /** @private {!Map<string, HTMLElement>} */
82
84
  this.displayedElements_ = new Map();
83
85
 
@@ -127,7 +127,9 @@ shaka.ui.StatisticsButton = class extends shaka.ui.Element {
127
127
 
128
128
  const parseBytes = (name) => {
129
129
  const bytes = parseInt(this.currentStats_[name], 10);
130
- if (bytes > 1e6) {
130
+ if (bytes > 2 * 1e9) {
131
+ return (bytes / 1e9).toFixed(2) + 'GB';
132
+ } else if (bytes > 1e6) {
131
133
  return (bytes / 1e6).toFixed(2) + 'MB';
132
134
  } else if (bytes > 1e3) {
133
135
  return (bytes / 1e3).toFixed(2) + 'KB';