stormcloud-video-player 0.3.17 → 0.3.19

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.
@@ -259,6 +259,20 @@ function _ts_generator(thisArg, body) {
259
259
  };
260
260
  }
261
261
  }
262
+ function _ts_values(o) {
263
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
264
+ if (m) return m.call(o);
265
+ if (o && typeof o.length === "number") return {
266
+ next: function() {
267
+ if (o && i >= o.length) o = void 0;
268
+ return {
269
+ value: o && o[i++],
270
+ done: !o
271
+ };
272
+ }
273
+ };
274
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
275
+ }
262
276
  var __create = Object.create;
263
277
  var __defProp = Object.defineProperty;
264
278
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -702,7 +716,12 @@ function createImaController(video, options) {
702
716
  return [
703
717
  4,
704
718
  fetch(vastTagUrl, {
705
- mode: "cors"
719
+ mode: "cors",
720
+ credentials: "include",
721
+ headers: {
722
+ "Accept": "application/xml, text/xml, */*"
723
+ },
724
+ referrerPolicy: "no-referrer-when-downgrade"
706
725
  })
707
726
  ];
708
727
  case 1:
@@ -1247,6 +1266,7 @@ function createImaController(video, options) {
1247
1266
  },
1248
1267
  showPlaceholder: function showPlaceholder() {
1249
1268
  ensurePlaceholderContainer();
1269
+ hideContentVideo();
1250
1270
  if (adContainerEl) {
1251
1271
  adContainerEl.style.display = "flex";
1252
1272
  adContainerEl.style.backgroundColor = "#000";
@@ -1266,6 +1286,9 @@ function createImaController(video, options) {
1266
1286
  }
1267
1287
  }, 300);
1268
1288
  }
1289
+ if (!adPlaying) {
1290
+ showContentVideo();
1291
+ }
1269
1292
  }
1270
1293
  };
1271
1294
  }
@@ -1530,7 +1553,14 @@ function createHlsAdPlayer(contentVideo, options) {
1530
1553
  case 0:
1531
1554
  return [
1532
1555
  4,
1533
- fetch(vastTagUrl)
1556
+ fetch(vastTagUrl, {
1557
+ mode: "cors",
1558
+ credentials: "include",
1559
+ headers: {
1560
+ "Accept": "application/xml, text/xml, */*"
1561
+ },
1562
+ referrerPolicy: "no-referrer-when-downgrade"
1563
+ })
1534
1564
  ];
1535
1565
  case 1:
1536
1566
  response = _state.sent();
@@ -2040,6 +2070,8 @@ function createHlsAdPlayer(contentVideo, options) {
2040
2070
  return 1;
2041
2071
  },
2042
2072
  showPlaceholder: function showPlaceholder() {
2073
+ contentVideo.style.opacity = "0";
2074
+ contentVideo.style.visibility = "hidden";
2043
2075
  if (!adContainerEl) {
2044
2076
  var _contentVideo_parentElement;
2045
2077
  var container = document.createElement("div");
@@ -2067,6 +2099,10 @@ function createHlsAdPlayer(contentVideo, options) {
2067
2099
  adContainerEl.style.display = "none";
2068
2100
  adContainerEl.style.pointerEvents = "none";
2069
2101
  }
2102
+ if (!adPlaying) {
2103
+ contentVideo.style.visibility = "visible";
2104
+ contentVideo.style.opacity = "1";
2105
+ }
2070
2106
  }
2071
2107
  };
2072
2108
  }
@@ -2721,6 +2757,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2721
2757
  this.maxPlaceholderDurationMs = 5e3;
2722
2758
  this.placeholderStartTimeMs = null;
2723
2759
  this.isShowingPlaceholder = false;
2760
+ this.consecutiveEmptyResponses = 0;
2761
+ this.totalAdRequestsInBreak = 0;
2762
+ this.lastEmptyResponseTimeMs = 0;
2763
+ this.maxTotalAdRequestsPerBreak = 20;
2764
+ this.maxConsecutiveEmptyResponses = 5;
2765
+ this.baseEmptyResponseDelayMs = 2e3;
2766
+ this.maxEmptyResponseDelayMs = 3e4;
2724
2767
  initializePolyfills();
2725
2768
  var browserOverrides = getBrowserConfigOverrides();
2726
2769
  this.config = _object_spread({}, config, browserOverrides);
@@ -2910,6 +2953,87 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2910
2953
  });
2911
2954
  }).call(_this);
2912
2955
  });
2956
+ this.hls.on(import_hls2.default.Events.LEVEL_LOADED, function(_evt, data) {
2957
+ if (_this.inAdBreak) {
2958
+ return;
2959
+ }
2960
+ var details = data === null || data === void 0 ? void 0 : data.details;
2961
+ if (!details || !details.fragments || details.fragments.length === 0) {
2962
+ return;
2963
+ }
2964
+ var fragmentsToScan = Math.min(5, details.fragments.length);
2965
+ for(var i = 0; i < fragmentsToScan; i++){
2966
+ var frag = details.fragments[i];
2967
+ var tagList = frag === null || frag === void 0 ? void 0 : frag.tagList;
2968
+ if (!Array.isArray(tagList)) continue;
2969
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2970
+ try {
2971
+ for(var _iterator = tagList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2972
+ var entry = _step.value;
2973
+ var tag = "";
2974
+ var value = "";
2975
+ if (Array.isArray(entry)) {
2976
+ var _entry_;
2977
+ tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
2978
+ var _entry_1;
2979
+ value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
2980
+ } else if (typeof entry === "string") {
2981
+ var idx = entry.indexOf(":");
2982
+ if (idx >= 0) {
2983
+ tag = entry.substring(0, idx);
2984
+ value = entry.substring(idx + 1);
2985
+ } else {
2986
+ tag = entry;
2987
+ }
2988
+ }
2989
+ if (!tag) continue;
2990
+ if (tag.includes("EXT-X-CUE-OUT") || tag.includes("EXT-X-DATERANGE")) {
2991
+ var attrs = tag.includes("EXT-X-DATERANGE") ? _this.parseAttributeList(value) : {};
2992
+ var hasScteOut = tag.includes("EXT-X-CUE-OUT") || "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
2993
+ if (hasScteOut) {
2994
+ if (_this.config.debugAdTiming) {
2995
+ console.log("[StormcloudVideoPlayer] \uD83C\uDFAF EARLY SCTE-35 DETECTION: Ad break marker found in fragment", i, "- triggering ad handling immediately");
2996
+ }
2997
+ var durationSeconds = _this.parseCueOutDuration(value);
2998
+ var marker = _object_spread_props(_object_spread({
2999
+ type: "start"
3000
+ }, durationSeconds !== void 0 ? {
3001
+ durationSeconds: durationSeconds
3002
+ } : {}), {
3003
+ raw: {
3004
+ tag: tag,
3005
+ value: value,
3006
+ earlyDetection: true
3007
+ }
3008
+ });
3009
+ _this.inAdBreak = true;
3010
+ _this.expectedAdBreakDurationMs = durationSeconds ? durationSeconds * 1e3 : void 0;
3011
+ _this.currentAdBreakStartWallClockMs = Date.now();
3012
+ _this.clearAdStartTimer();
3013
+ _this.handleAdStart(marker);
3014
+ if (_this.expectedAdBreakDurationMs != null) {
3015
+ _this.scheduleAdStopCountdown(_this.expectedAdBreakDurationMs);
3016
+ }
3017
+ return;
3018
+ }
3019
+ }
3020
+ }
3021
+ } catch (err) {
3022
+ _didIteratorError = true;
3023
+ _iteratorError = err;
3024
+ } finally{
3025
+ try {
3026
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3027
+ _iterator.return();
3028
+ }
3029
+ } finally{
3030
+ if (_didIteratorError) {
3031
+ throw _iteratorError;
3032
+ }
3033
+ }
3034
+ }
3035
+ }
3036
+ });
2913
3037
  this.hls.on(import_hls2.default.Events.FRAG_BUFFERED, function(_evt, data) {
2914
3038
  return _async_to_generator(function() {
2915
3039
  var _this, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
@@ -3117,11 +3241,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3117
3241
  this.ima.initialize();
3118
3242
  this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
3119
3243
  this.ima.on("all_ads_completed", function() {
3244
+ var remaining = _this.getRemainingAdMs();
3120
3245
  if (_this.config.debugAdTiming) {
3121
- console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - ending ad break");
3246
+ console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length));
3122
3247
  }
3123
3248
  if (_this.inAdBreak) {
3124
- _this.handleAdPodComplete();
3249
+ if (remaining > 500) {
3250
+ _this.tryNextAvailableAd();
3251
+ } else {
3252
+ _this.handleAdPodComplete();
3253
+ }
3125
3254
  }
3126
3255
  });
3127
3256
  this.ima.on("ad_error", function(errorPayload) {
@@ -3916,6 +4045,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3916
4045
  this.continuousFetchingActive = true;
3917
4046
  this.isShowingPlaceholder = false;
3918
4047
  this.placeholderStartTimeMs = null;
4048
+ this.consecutiveEmptyResponses = 0;
4049
+ this.totalAdRequestsInBreak = 0;
4050
+ this.lastEmptyResponseTimeMs = 0;
3919
4051
  currentMuted = this.video.muted;
3920
4052
  currentVolume = this.video.volume;
3921
4053
  this.ima.updateOriginalMutedState(currentMuted, currentVolume);
@@ -3923,6 +4055,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3923
4055
  this.currentAdIndex = 0;
3924
4056
  this.totalAdsInBreak = 1;
3925
4057
  this.adPodQueue = [];
4058
+ this.showAds = true;
4059
+ this.ima.showPlaceholder();
3926
4060
  if (this.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
3927
4061
  this.expectedAdBreakDurationMs = adBreakDurationMs;
3928
4062
  this.currentAdBreakStartWallClockMs = Date.now();
@@ -4009,158 +4143,200 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4009
4143
  key: "continuousFetchLoop",
4010
4144
  value: function continuousFetchLoop(baseVastUrl) {
4011
4145
  return _async_to_generator(function() {
4012
- var remaining, maxQueueSize, newAdUrl, response, xmlText, parser, xmlDoc, mediaFiles, error;
4146
+ var _this, _loop, _ret;
4013
4147
  return _ts_generator(this, function(_state) {
4014
4148
  switch(_state.label){
4015
4149
  case 0:
4016
- if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4017
- 3,
4018
- 14
4019
- ];
4020
- remaining = this.getRemainingAdMs();
4021
- if (remaining <= 0) {
4022
- if (this.config.debugAdTiming) {
4023
- console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4024
- }
4025
- return [
4026
- 3,
4027
- 14
4028
- ];
4029
- }
4030
- maxQueueSize = 3;
4031
- if (!(this.adRequestQueue.length >= maxQueueSize)) return [
4032
- 3,
4033
- 2
4034
- ];
4035
- if (this.config.debugAdTiming) {
4036
- console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(this.adRequestQueue.length, "), pausing fetching..."));
4037
- }
4038
- return [
4039
- 4,
4040
- new Promise(function(resolve) {
4041
- return setTimeout(resolve, 2e3);
4042
- })
4043
- ];
4150
+ _loop = function() {
4151
+ var remaining, maxQueueSize, newAdUrl, _this_ima_hasPreloadedAd, _this_ima, _this_ima_hasPreloadedAd1, hasPreloadedAd, backoffDelay, error, backoffDelay1;
4152
+ return _ts_generator(this, function(_state) {
4153
+ switch(_state.label){
4154
+ case 0:
4155
+ remaining = _this.getRemainingAdMs();
4156
+ if (remaining <= 0) {
4157
+ if (_this.config.debugAdTiming) {
4158
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4159
+ }
4160
+ return [
4161
+ 2,
4162
+ "break"
4163
+ ];
4164
+ }
4165
+ if (_this.totalAdRequestsInBreak >= _this.maxTotalAdRequestsPerBreak) {
4166
+ if (_this.config.debugAdTiming) {
4167
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Maximum ad requests reached (".concat(_this.maxTotalAdRequestsPerBreak, "), stopping fetch loop to prevent server blocks"));
4168
+ }
4169
+ return [
4170
+ 2,
4171
+ "break"
4172
+ ];
4173
+ }
4174
+ if (_this.consecutiveEmptyResponses >= _this.maxConsecutiveEmptyResponses) {
4175
+ if (_this.config.debugAdTiming) {
4176
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive empty responses (".concat(_this.maxConsecutiveEmptyResponses, "), stopping fetch loop"));
4177
+ }
4178
+ return [
4179
+ 2,
4180
+ "break"
4181
+ ];
4182
+ }
4183
+ maxQueueSize = 3;
4184
+ if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
4185
+ 3,
4186
+ 2
4187
+ ];
4188
+ if (_this.config.debugAdTiming) {
4189
+ console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(_this.adRequestQueue.length, "), pausing fetching..."));
4190
+ }
4191
+ return [
4192
+ 4,
4193
+ new Promise(function(resolve) {
4194
+ return setTimeout(resolve, 2e3);
4195
+ })
4196
+ ];
4197
+ case 1:
4198
+ _state.sent();
4199
+ return [
4200
+ 2,
4201
+ "continue"
4202
+ ];
4203
+ case 2:
4204
+ newAdUrl = _this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4205
+ if (!(!newAdUrl || _this.failedVastUrls.has(newAdUrl))) return [
4206
+ 3,
4207
+ 4
4208
+ ];
4209
+ return [
4210
+ 4,
4211
+ new Promise(function(resolve) {
4212
+ return setTimeout(resolve, 1e3);
4213
+ })
4214
+ ];
4215
+ case 3:
4216
+ _state.sent();
4217
+ return [
4218
+ 2,
4219
+ "continue"
4220
+ ];
4221
+ case 4:
4222
+ _this.totalAdRequestsInBreak++;
4223
+ if (_this.config.debugAdTiming) {
4224
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (request ".concat(_this.totalAdRequestsInBreak, "/").concat(_this.maxTotalAdRequestsPerBreak, ", queue: ").concat(_this.adRequestQueue.length, ")..."));
4225
+ }
4226
+ _state.label = 5;
4227
+ case 5:
4228
+ _state.trys.push([
4229
+ 5,
4230
+ 11,
4231
+ ,
4232
+ 13
4233
+ ]);
4234
+ if (!_this.ima.preloadAds) return [
4235
+ 3,
4236
+ 7
4237
+ ];
4238
+ return [
4239
+ 4,
4240
+ _this.ima.preloadAds(newAdUrl)
4241
+ ];
4242
+ case 6:
4243
+ _state.sent();
4244
+ _state.label = 7;
4245
+ case 7:
4246
+ hasPreloadedAd = (_this_ima_hasPreloadedAd1 = (_this_ima_hasPreloadedAd = (_this_ima = _this.ima).hasPreloadedAd) === null || _this_ima_hasPreloadedAd === void 0 ? void 0 : _this_ima_hasPreloadedAd.call(_this_ima, newAdUrl)) !== null && _this_ima_hasPreloadedAd1 !== void 0 ? _this_ima_hasPreloadedAd1 : false;
4247
+ if (!!hasPreloadedAd) return [
4248
+ 3,
4249
+ 9
4250
+ ];
4251
+ _this.consecutiveEmptyResponses++;
4252
+ _this.lastEmptyResponseTimeMs = Date.now();
4253
+ backoffDelay = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4254
+ if (_this.config.debugAdTiming) {
4255
+ console.log("[CONTINUOUS-FETCH] ⚠️ Empty/invalid VAST response (".concat(_this.consecutiveEmptyResponses, "/").concat(_this.maxConsecutiveEmptyResponses, " consecutive), backing off for ").concat(backoffDelay, "ms"));
4256
+ }
4257
+ _this.failedVastUrls.add(newAdUrl);
4258
+ return [
4259
+ 4,
4260
+ new Promise(function(resolve) {
4261
+ return setTimeout(resolve, backoffDelay);
4262
+ })
4263
+ ];
4264
+ case 8:
4265
+ _state.sent();
4266
+ return [
4267
+ 2,
4268
+ "continue"
4269
+ ];
4270
+ case 9:
4271
+ _this.consecutiveEmptyResponses = 0;
4272
+ if (_this.config.debugAdTiming) {
4273
+ console.log("[CONTINUOUS-FETCH] ✅ Successfully preloaded ad, adding to queue (queue size: ".concat(_this.adRequestQueue.length + 1, ")"));
4274
+ }
4275
+ _this.adRequestQueue.push(newAdUrl);
4276
+ _this.totalAdsInBreak++;
4277
+ return [
4278
+ 4,
4279
+ new Promise(function(resolve) {
4280
+ return setTimeout(resolve, 500);
4281
+ })
4282
+ ];
4283
+ case 10:
4284
+ _state.sent();
4285
+ return [
4286
+ 3,
4287
+ 13
4288
+ ];
4289
+ case 11:
4290
+ error = _state.sent();
4291
+ if (_this.config.debugAdTiming) {
4292
+ console.log("[CONTINUOUS-FETCH] \u274C Ad preload failed:", error.message);
4293
+ }
4294
+ _this.failedVastUrls.add(newAdUrl);
4295
+ _this.consecutiveEmptyResponses++;
4296
+ backoffDelay1 = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4297
+ return [
4298
+ 4,
4299
+ new Promise(function(resolve) {
4300
+ return setTimeout(resolve, backoffDelay1);
4301
+ })
4302
+ ];
4303
+ case 12:
4304
+ _state.sent();
4305
+ return [
4306
+ 3,
4307
+ 13
4308
+ ];
4309
+ case 13:
4310
+ return [
4311
+ 2
4312
+ ];
4313
+ }
4314
+ });
4315
+ };
4316
+ _state.label = 1;
4044
4317
  case 1:
4045
- _state.sent();
4046
- return [
4047
- 3,
4048
- 0
4049
- ];
4050
- case 2:
4051
- newAdUrl = this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4052
- if (!(!newAdUrl || this.failedVastUrls.has(newAdUrl))) return [
4318
+ if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4053
4319
  3,
4054
- 4
4055
- ];
4056
- return [
4057
- 4,
4058
- new Promise(function(resolve) {
4059
- return setTimeout(resolve, 1e3);
4060
- })
4320
+ 3
4061
4321
  ];
4062
- case 3:
4063
- _state.sent();
4322
+ _this = this;
4064
4323
  return [
4065
- 3,
4066
- 0
4067
- ];
4068
- case 4:
4069
- if (this.config.debugAdTiming) {
4070
- console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (".concat(this.successfulAdRequests.length + this.adRequestQueue.length + 1, " total)..."));
4071
- }
4072
- _state.label = 5;
4073
- case 5:
4074
- _state.trys.push([
4075
4324
  5,
4076
- 11,
4077
- ,
4078
- 13
4079
- ]);
4080
- return [
4081
- 4,
4082
- fetch(newAdUrl, {
4083
- mode: "cors"
4084
- })
4085
- ];
4086
- case 6:
4087
- response = _state.sent();
4088
- if (!response.ok) {
4089
- throw new Error("Failed to fetch VAST: ".concat(response.status));
4090
- }
4091
- return [
4092
- 4,
4093
- response.text()
4094
- ];
4095
- case 7:
4096
- xmlText = _state.sent();
4097
- parser = new DOMParser();
4098
- xmlDoc = parser.parseFromString(xmlText, "text/xml");
4099
- mediaFiles = xmlDoc.querySelectorAll("MediaFile");
4100
- if (!(mediaFiles.length === 0)) return [
4101
- 3,
4102
- 9
4103
- ];
4104
- if (this.config.debugAdTiming) {
4105
- console.log("[CONTINUOUS-FETCH] \u26A0\uFE0F VAST response has no media files, skipping");
4106
- }
4107
- this.failedVastUrls.add(newAdUrl);
4108
- return [
4109
- 4,
4110
- new Promise(function(resolve) {
4111
- return setTimeout(resolve, 1e3);
4112
- })
4113
- ];
4114
- case 8:
4115
- _state.sent();
4116
- return [
4117
- 3,
4118
- 0
4119
- ];
4120
- case 9:
4121
- if (this.config.debugAdTiming) {
4122
- console.log("[CONTINUOUS-FETCH] ✅ Successfully fetched ad, adding to queue (queue size: ".concat(this.adRequestQueue.length + 1, ")"));
4123
- }
4124
- this.adRequestQueue.push(newAdUrl);
4125
- this.totalAdsInBreak++;
4126
- return [
4127
- 4,
4128
- new Promise(function(resolve) {
4129
- return setTimeout(resolve, 500);
4130
- })
4131
- ];
4132
- case 10:
4133
- _state.sent();
4134
- return [
4135
- 3,
4136
- 13
4325
+ _ts_values(_loop())
4137
4326
  ];
4138
- case 11:
4139
- error = _state.sent();
4140
- if (this.config.debugAdTiming) {
4141
- console.log("[CONTINUOUS-FETCH] \u274C Ad fetch failed:", error.message);
4142
- }
4143
- this.failedVastUrls.add(newAdUrl);
4144
- return [
4145
- 4,
4146
- new Promise(function(resolve) {
4147
- return setTimeout(resolve, 2e3);
4148
- })
4149
- ];
4150
- case 12:
4151
- _state.sent();
4152
- return [
4327
+ case 2:
4328
+ _ret = _state.sent();
4329
+ if (_ret === "break") return [
4153
4330
  3,
4154
- 13
4331
+ 3
4155
4332
  ];
4156
- case 13:
4157
4333
  return [
4158
4334
  3,
4159
- 0
4335
+ 1
4160
4336
  ];
4161
- case 14:
4337
+ case 3:
4162
4338
  if (this.config.debugAdTiming) {
4163
- console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended");
4339
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended (total requests: ".concat(this.totalAdRequestsInBreak, ", empty responses: ").concat(this.consecutiveEmptyResponses, ")"));
4164
4340
  }
4165
4341
  return [
4166
4342
  2
@@ -4850,7 +5026,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4850
5026
  return [
4851
5027
  4,
4852
5028
  fetch(vastTagUrl, {
4853
- mode: "cors"
5029
+ mode: "cors",
5030
+ credentials: "include",
5031
+ headers: {
5032
+ "Accept": "application/xml, text/xml, */*"
5033
+ },
5034
+ referrerPolicy: "no-referrer-when-downgrade"
4854
5035
  })
4855
5036
  ];
4856
5037
  case 1:
@@ -4949,7 +5130,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4949
5130
  return [
4950
5131
  4,
4951
5132
  fetch(vastTagUrl, {
4952
- mode: "cors"
5133
+ mode: "cors",
5134
+ credentials: "include",
5135
+ headers: {
5136
+ "Accept": "application/xml, text/xml, */*"
5137
+ },
5138
+ referrerPolicy: "no-referrer-when-downgrade"
4953
5139
  })
4954
5140
  ];
4955
5141
  case 1:
@@ -5116,10 +5302,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5116
5302
  4,
5117
5303
  fetch(mediaUrl, {
5118
5304
  mode: "cors",
5305
+ credentials: "include",
5119
5306
  method: "GET",
5120
5307
  headers: {
5121
5308
  Range: "bytes=0-1048576"
5122
- }
5309
+ },
5310
+ referrerPolicy: "no-referrer-when-downgrade"
5123
5311
  })
5124
5312
  ];
5125
5313
  case 2: