stormcloud-video-player 0.8.35 → 0.8.36

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.
@@ -20,6 +20,7 @@ declare class AdConfigManager {
20
20
  get debug(): boolean;
21
21
  isVmapEnabled(): boolean;
22
22
  fetchAdConfiguration(): Promise<void>;
23
+ private applyMqttConfigFromResponse;
23
24
  private fetchAndParseVmap;
24
25
  private parseVmapToBreaks;
25
26
  private parseVmapTimeOffsetToMs;
@@ -1855,6 +1855,9 @@ var DEFAULT_MQTT_CONFIG = {
1855
1855
  qos: 1
1856
1856
  };
1857
1857
  var mqttConfig = _object_spread({}, DEFAULT_MQTT_CONFIG);
1858
+ function applyMQTTConfig(overrides) {
1859
+ Object.assign(mqttConfig, overrides);
1860
+ }
1858
1861
  function isMQTTEnabled() {
1859
1862
  return mqttConfig.enabled;
1860
1863
  }
@@ -5026,6 +5029,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
5026
5029
  ];
5027
5030
  case 4:
5028
5031
  data = _state.sent();
5032
+ this.applyMqttConfigFromResponse(data);
5029
5033
  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;
5030
5034
  if (imaPayload) {
5031
5035
  decodedPayload = imaPayload;
@@ -5059,6 +5063,20 @@ var AdConfigManager = /*#__PURE__*/ function() {
5059
5063
  }).call(this);
5060
5064
  }
5061
5065
  },
5066
+ {
5067
+ key: "applyMqttConfigFromResponse",
5068
+ value: function applyMqttConfigFromResponse(data) {
5069
+ var _data_response;
5070
+ var mqttConfig2 = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : _data_response.mqtt_config;
5071
+ if (!mqttConfig2 || (typeof mqttConfig2 === "undefined" ? "undefined" : _type_of(mqttConfig2)) !== "object") {
5072
+ return;
5073
+ }
5074
+ applyMQTTConfig(mqttConfig2);
5075
+ if (this.debug) {
5076
+ console.log("[StormcloudVideoPlayer] Applied MQTT config from /ads/web:", mqttConfig2);
5077
+ }
5078
+ }
5079
+ },
5062
5080
  {
5063
5081
  key: "fetchAndParseVmap",
5064
5082
  value: function fetchAndParseVmap(vmapUrl) {