vidply 1.0.31 → 1.0.32

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.
@@ -5194,13 +5194,19 @@
5194
5194
  }
5195
5195
  getQualities() {
5196
5196
  if (this.hls && this.hls.levels) {
5197
- return this.hls.levels.map((level, index) => ({
5198
- index,
5199
- height: level.height,
5200
- width: level.width,
5201
- bitrate: level.bitrate,
5202
- name: "".concat(level.height, "p")
5203
- }));
5197
+ return this.hls.levels.map((level, index) => {
5198
+ const height = Number(level.height) || 0;
5199
+ const bitrate = Number(level.bitrate) || 0;
5200
+ const kb = bitrate > 0 ? Math.round(bitrate / 1e3) : 0;
5201
+ const name = height > 0 ? "".concat(height, "p") : kb > 0 ? "".concat(kb, " kb") : "Auto";
5202
+ return {
5203
+ index,
5204
+ height: level.height,
5205
+ width: level.width,
5206
+ bitrate: level.bitrate,
5207
+ name
5208
+ };
5209
+ });
5204
5210
  }
5205
5211
  return [];
5206
5212
  }
@@ -6091,6 +6097,7 @@
6091
6097
  });
6092
6098
  }
6093
6099
  createControls() {
6100
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
6094
6101
  const progressTimeWrapper = DOMUtils.createElement("div", {
6095
6102
  className: "".concat(this.player.options.classPrefix, "-progress-time-wrapper")
6096
6103
  });
@@ -6156,7 +6163,11 @@
6156
6163
  btn.dataset.overflowPriorityMobile = "3";
6157
6164
  this.rightButtons.appendChild(btn);
6158
6165
  }
6159
- if (this.player.options.speedButton) {
6166
+ const src = this.player.currentSource || ((_b = (_a = this.player.element) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "src")) || ((_c = this.player.element) == null ? void 0 : _c.currentSrc) || ((_d = this.player.element) == null ? void 0 : _d.src) || ((_h = (_g = (_f = (_e = this.player.element) == null ? void 0 : _e.querySelector) == null ? void 0 : _f.call(_e, "source")) == null ? void 0 : _g.getAttribute) == null ? void 0 : _h.call(_g, "src")) || ((_k = (_j = (_i = this.player.element) == null ? void 0 : _i.querySelector) == null ? void 0 : _j.call(_i, "source")) == null ? void 0 : _k.src) || "";
6167
+ const isHlsSource = typeof src === "string" && src.includes(".m3u8");
6168
+ const isVideoElement = ((_m = (_l = this.player.element) == null ? void 0 : _l.tagName) == null ? void 0 : _m.toLowerCase()) === "video";
6169
+ const hideSpeedForThisPlayer = !!this.player.options.hideSpeedForHls && isHlsSource || !!this.player.options.hideSpeedForHlsVideo && isHlsSource && isVideoElement;
6170
+ if (this.player.options.speedButton && !hideSpeedForThisPlayer) {
6160
6171
  const btn = this.createSpeedButton();
6161
6172
  btn.dataset.overflowPriority = "1";
6162
6173
  btn.dataset.overflowPriorityMobile = "3";
@@ -10393,6 +10404,11 @@
10393
10404
  qualityButton: true,
10394
10405
  captionStyleButton: true,
10395
10406
  speedButton: true,
10407
+ // When enabled, the playback speed UI is suppressed for ALL HLS streams (audio + video).
10408
+ hideSpeedForHls: false,
10409
+ // When enabled, the playback speed UI is suppressed for HLS *video* streams only.
10410
+ // This is useful for live streams where speed controls don't make sense.
10411
+ hideSpeedForHlsVideo: false,
10396
10412
  captionsButton: true,
10397
10413
  transcriptButton: true,
10398
10414
  fullscreenButton: true,