stormcloud-video-player 0.8.70 → 0.8.71

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.
@@ -9293,19 +9293,31 @@ var HlsEngine = /*#__PURE__*/ function() {
9293
9293
  // src/player/EdgePodRequest.ts
9294
9294
  var EDGE_POD_MAX_ADS = 10;
9295
9295
  var EDGE_POD_EXCEEDS_BUDGET = "edge_pod_exceeds_budget";
9296
+ var LICENSE_KEY_PLACEHOLDER = /\{licenseKey\}|%7BlicenseKey%7D/gi;
9296
9297
  function resolveEdgePodBaseUrl(config) {
9297
- var _config_edgePodUrl;
9298
+ var _config_edgePodUrl, _config_licenseKey;
9298
9299
  if (config.enableEdgePodRequest !== true) return void 0;
9299
9300
  var raw = (_config_edgePodUrl = config.edgePodUrl) === null || _config_edgePodUrl === void 0 ? void 0 : _config_edgePodUrl.trim();
9300
9301
  if (!raw) {
9301
9302
  console.warn("[AdBreak][EDGE] enableEdgePodRequest is true but edgePodUrl is missing; using GAM only");
9302
9303
  return void 0;
9303
9304
  }
9305
+ var licenseKey = (_config_licenseKey = config.licenseKey) === null || _config_licenseKey === void 0 ? void 0 : _config_licenseKey.trim();
9306
+ if (!licenseKey) {
9307
+ console.warn("[AdBreak][EDGE] enableEdgePodRequest is true but licenseKey is missing; using GAM only");
9308
+ return void 0;
9309
+ }
9310
+ var encodedKey = encodeURIComponent(licenseKey);
9304
9311
  try {
9305
- var url = new URL(raw);
9312
+ var hasPlaceholder = raw.search(LICENSE_KEY_PLACEHOLDER) !== -1;
9313
+ var url = new URL(hasPlaceholder ? raw.replace(LICENSE_KEY_PLACEHOLDER, encodedKey) : raw);
9306
9314
  if (url.protocol !== "https:" && url.protocol !== "http:") {
9307
9315
  throw new Error("unsupported protocol ".concat(url.protocol));
9308
9316
  }
9317
+ if (!hasPlaceholder) {
9318
+ var path = url.pathname.replace(/\/+$/, "");
9319
+ url.pathname = /\/[^/]+\/pod$/.test(path) ? path.replace(/\/[^/]+\/pod$/, "/".concat(encodedKey, "/pod")) : "".concat(path, "/").concat(encodedKey, "/pod");
9320
+ }
9309
9321
  return url.toString();
9310
9322
  } catch (unused) {
9311
9323
  console.warn("[AdBreak][EDGE] edgePodUrl is not a valid http(s) URL; using GAM only");
@@ -11783,6 +11795,25 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
11783
11795
  return this.floorLadderEnabled;
11784
11796
  }
11785
11797
  },
11798
+ {
11799
+ key: "setEdgePodRequest",
11800
+ value: function setEdgePodRequest(update) {
11801
+ if (update.enableEdgePodRequest === this.config.enableEdgePodRequest && update.edgePodUrl === this.config.edgePodUrl) {
11802
+ return;
11803
+ }
11804
+ if (update.enableEdgePodRequest === void 0) delete this.config.enableEdgePodRequest;
11805
+ else this.config.enableEdgePodRequest = update.enableEdgePodRequest;
11806
+ if (update.edgePodUrl === void 0) delete this.config.edgePodUrl;
11807
+ else this.config.edgePodUrl = update.edgePodUrl;
11808
+ this.edgePodBaseUrl = resolveEdgePodBaseUrl(this.config);
11809
+ }
11810
+ },
11811
+ {
11812
+ key: "getEdgePodUrl",
11813
+ value: function getEdgePodUrl() {
11814
+ return this.edgePodBaseUrl;
11815
+ }
11816
+ },
11786
11817
  {
11787
11818
  key: "warnOnInvalidFloorLadder",
11788
11819
  value: function warnOnInvalidFloorLadder(report) {