stormcloud-video-player 0.8.35 → 0.8.37

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.
@@ -16,6 +16,7 @@ interface AdBreakOrchestratorHost {
16
16
  shouldContinueLiveStreamDuringAds(): boolean;
17
17
  isLiveStream(): boolean;
18
18
  getLiveSyncPosition(): number | undefined;
19
+ restartHlsLoad(position: number): void;
19
20
  generatePodVastUrl(baseUrl: string, breakDurationMs?: number): string;
20
21
  }
21
22
  declare class AdBreakOrchestrator {
@@ -58,6 +59,7 @@ declare class AdBreakOrchestrator {
58
59
  playSingleAd(vastTagUrl: string): Promise<void>;
59
60
  private showPlaceholderAndWaitForAds;
60
61
  handleAdPodComplete(): void;
62
+ private monitorLiveResumeStall;
61
63
  private resumeContentPlayback;
62
64
  handleAdFailure(): void;
63
65
  }
@@ -1045,7 +1045,7 @@ function removeBrokenAppNameOrphans(params, appName) {
1045
1045
  try {
1046
1046
  for(var _iterator = appName.split("&").slice(1)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1047
1047
  var suffix = _step.value;
1048
- var trimmed = suffix.trimStart();
1048
+ var trimmed = suffix.replace(/^\s+/, "");
1049
1049
  if (!trimmed) continue;
1050
1050
  toDelete.push(suffix, " ".concat(trimmed), trimmed);
1051
1051
  }
@@ -1099,7 +1099,7 @@ function normalizeVastTagUrl(raw) {
1099
1099
  });
1100
1100
  if (orphanFragments.length > 0) {
1101
1101
  var reconstructed = [
1102
- anValue.trimEnd()
1102
+ anValue.replace(/\s+$/, "")
1103
1103
  ].concat(_to_consumable_array(orphanFragments)).filter(Boolean).join(" & ");
1104
1104
  url.searchParams.forEach(function(_value, key) {
1105
1105
  if (key && INVALID_VAST_PARAM_KEY.test(key)) {
@@ -1300,6 +1300,9 @@ var DEFAULT_MQTT_CONFIG = {
1300
1300
  qos: 1
1301
1301
  };
1302
1302
  var mqttConfig = _object_spread({}, DEFAULT_MQTT_CONFIG);
1303
+ function applyMQTTConfig(overrides) {
1304
+ Object.assign(mqttConfig, overrides);
1305
+ }
1303
1306
  function isMQTTEnabled() {
1304
1307
  return mqttConfig.enabled;
1305
1308
  }
@@ -1907,6 +1910,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
1907
1910
  ];
1908
1911
  case 4:
1909
1912
  data = _state.sent();
1913
+ this.applyMqttConfigFromResponse(data);
1910
1914
  imaPayload = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : (_data_response_ima = _data_response.ima) === null || _data_response_ima === void 0 ? void 0 : (_data_response_ima_publisherdeskima = _data_response_ima["publisherdesk.ima"]) === null || _data_response_ima_publisherdeskima === void 0 ? void 0 : _data_response_ima_publisherdeskima.payload;
1911
1915
  if (imaPayload) {
1912
1916
  decodedPayload = imaPayload;
@@ -1940,6 +1944,20 @@ var AdConfigManager = /*#__PURE__*/ function() {
1940
1944
  }).call(this);
1941
1945
  }
1942
1946
  },
1947
+ {
1948
+ key: "applyMqttConfigFromResponse",
1949
+ value: function applyMqttConfigFromResponse(data) {
1950
+ var _data_response;
1951
+ var mqttConfig2 = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : _data_response.mqtt_config;
1952
+ if (!mqttConfig2 || (typeof mqttConfig2 === "undefined" ? "undefined" : _type_of(mqttConfig2)) !== "object") {
1953
+ return;
1954
+ }
1955
+ applyMQTTConfig(mqttConfig2);
1956
+ if (this.debug) {
1957
+ console.log("[StormcloudVideoPlayer] Applied MQTT config from /ads/web:", mqttConfig2);
1958
+ }
1959
+ }
1960
+ },
1943
1961
  {
1944
1962
  key: "fetchAndParseVmap",
1945
1963
  value: function fetchAndParseVmap(vmapUrl) {