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.
@@ -309,6 +309,20 @@ function _ts_generator(thisArg, body) {
309
309
  };
310
310
  }
311
311
  }
312
+ function _ts_values(o) {
313
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
314
+ if (m) return m.call(o);
315
+ if (o && typeof o.length === "number") return {
316
+ next: function() {
317
+ if (o && i >= o.length) o = void 0;
318
+ return {
319
+ value: o && o[i++],
320
+ done: !o
321
+ };
322
+ }
323
+ };
324
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
325
+ }
312
326
  var __create = Object.create;
313
327
  var __defProp = Object.defineProperty;
314
328
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -754,7 +768,12 @@ function createImaController(video, options) {
754
768
  return [
755
769
  4,
756
770
  fetch(vastTagUrl, {
757
- mode: "cors"
771
+ mode: "cors",
772
+ credentials: "include",
773
+ headers: {
774
+ "Accept": "application/xml, text/xml, */*"
775
+ },
776
+ referrerPolicy: "no-referrer-when-downgrade"
758
777
  })
759
778
  ];
760
779
  case 1:
@@ -1299,6 +1318,7 @@ function createImaController(video, options) {
1299
1318
  },
1300
1319
  showPlaceholder: function showPlaceholder() {
1301
1320
  ensurePlaceholderContainer();
1321
+ hideContentVideo();
1302
1322
  if (adContainerEl) {
1303
1323
  adContainerEl.style.display = "flex";
1304
1324
  adContainerEl.style.backgroundColor = "#000";
@@ -1318,6 +1338,9 @@ function createImaController(video, options) {
1318
1338
  }
1319
1339
  }, 300);
1320
1340
  }
1341
+ if (!adPlaying) {
1342
+ showContentVideo();
1343
+ }
1321
1344
  }
1322
1345
  };
1323
1346
  }
@@ -1582,7 +1605,14 @@ function createHlsAdPlayer(contentVideo, options) {
1582
1605
  case 0:
1583
1606
  return [
1584
1607
  4,
1585
- fetch(vastTagUrl)
1608
+ fetch(vastTagUrl, {
1609
+ mode: "cors",
1610
+ credentials: "include",
1611
+ headers: {
1612
+ "Accept": "application/xml, text/xml, */*"
1613
+ },
1614
+ referrerPolicy: "no-referrer-when-downgrade"
1615
+ })
1586
1616
  ];
1587
1617
  case 1:
1588
1618
  response = _state.sent();
@@ -2092,6 +2122,8 @@ function createHlsAdPlayer(contentVideo, options) {
2092
2122
  return 1;
2093
2123
  },
2094
2124
  showPlaceholder: function showPlaceholder() {
2125
+ contentVideo.style.opacity = "0";
2126
+ contentVideo.style.visibility = "hidden";
2095
2127
  if (!adContainerEl) {
2096
2128
  var _contentVideo_parentElement;
2097
2129
  var container = document.createElement("div");
@@ -2119,6 +2151,10 @@ function createHlsAdPlayer(contentVideo, options) {
2119
2151
  adContainerEl.style.display = "none";
2120
2152
  adContainerEl.style.pointerEvents = "none";
2121
2153
  }
2154
+ if (!adPlaying) {
2155
+ contentVideo.style.visibility = "visible";
2156
+ contentVideo.style.opacity = "1";
2157
+ }
2122
2158
  }
2123
2159
  };
2124
2160
  }
@@ -2773,6 +2809,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2773
2809
  this.maxPlaceholderDurationMs = 5e3;
2774
2810
  this.placeholderStartTimeMs = null;
2775
2811
  this.isShowingPlaceholder = false;
2812
+ this.consecutiveEmptyResponses = 0;
2813
+ this.totalAdRequestsInBreak = 0;
2814
+ this.lastEmptyResponseTimeMs = 0;
2815
+ this.maxTotalAdRequestsPerBreak = 20;
2816
+ this.maxConsecutiveEmptyResponses = 5;
2817
+ this.baseEmptyResponseDelayMs = 2e3;
2818
+ this.maxEmptyResponseDelayMs = 3e4;
2776
2819
  initializePolyfills();
2777
2820
  var browserOverrides = getBrowserConfigOverrides();
2778
2821
  this.config = _object_spread({}, config, browserOverrides);
@@ -2962,6 +3005,87 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2962
3005
  });
2963
3006
  }).call(_this);
2964
3007
  });
3008
+ this.hls.on(import_hls2.default.Events.LEVEL_LOADED, function(_evt, data) {
3009
+ if (_this.inAdBreak) {
3010
+ return;
3011
+ }
3012
+ var details = data === null || data === void 0 ? void 0 : data.details;
3013
+ if (!details || !details.fragments || details.fragments.length === 0) {
3014
+ return;
3015
+ }
3016
+ var fragmentsToScan = Math.min(5, details.fragments.length);
3017
+ for(var i = 0; i < fragmentsToScan; i++){
3018
+ var frag = details.fragments[i];
3019
+ var tagList = frag === null || frag === void 0 ? void 0 : frag.tagList;
3020
+ if (!Array.isArray(tagList)) continue;
3021
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3022
+ try {
3023
+ for(var _iterator = tagList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
3024
+ var entry = _step.value;
3025
+ var tag = "";
3026
+ var value = "";
3027
+ if (Array.isArray(entry)) {
3028
+ var _entry_;
3029
+ tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
3030
+ var _entry_1;
3031
+ value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
3032
+ } else if (typeof entry === "string") {
3033
+ var idx = entry.indexOf(":");
3034
+ if (idx >= 0) {
3035
+ tag = entry.substring(0, idx);
3036
+ value = entry.substring(idx + 1);
3037
+ } else {
3038
+ tag = entry;
3039
+ }
3040
+ }
3041
+ if (!tag) continue;
3042
+ if (tag.includes("EXT-X-CUE-OUT") || tag.includes("EXT-X-DATERANGE")) {
3043
+ var attrs = tag.includes("EXT-X-DATERANGE") ? _this.parseAttributeList(value) : {};
3044
+ var hasScteOut = tag.includes("EXT-X-CUE-OUT") || "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
3045
+ if (hasScteOut) {
3046
+ if (_this.config.debugAdTiming) {
3047
+ console.log("[StormcloudVideoPlayer] \uD83C\uDFAF EARLY SCTE-35 DETECTION: Ad break marker found in fragment", i, "- triggering ad handling immediately");
3048
+ }
3049
+ var durationSeconds = _this.parseCueOutDuration(value);
3050
+ var marker = _object_spread_props(_object_spread({
3051
+ type: "start"
3052
+ }, durationSeconds !== void 0 ? {
3053
+ durationSeconds: durationSeconds
3054
+ } : {}), {
3055
+ raw: {
3056
+ tag: tag,
3057
+ value: value,
3058
+ earlyDetection: true
3059
+ }
3060
+ });
3061
+ _this.inAdBreak = true;
3062
+ _this.expectedAdBreakDurationMs = durationSeconds ? durationSeconds * 1e3 : void 0;
3063
+ _this.currentAdBreakStartWallClockMs = Date.now();
3064
+ _this.clearAdStartTimer();
3065
+ _this.handleAdStart(marker);
3066
+ if (_this.expectedAdBreakDurationMs != null) {
3067
+ _this.scheduleAdStopCountdown(_this.expectedAdBreakDurationMs);
3068
+ }
3069
+ return;
3070
+ }
3071
+ }
3072
+ }
3073
+ } catch (err) {
3074
+ _didIteratorError = true;
3075
+ _iteratorError = err;
3076
+ } finally{
3077
+ try {
3078
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3079
+ _iterator.return();
3080
+ }
3081
+ } finally{
3082
+ if (_didIteratorError) {
3083
+ throw _iteratorError;
3084
+ }
3085
+ }
3086
+ }
3087
+ }
3088
+ });
2965
3089
  this.hls.on(import_hls2.default.Events.FRAG_BUFFERED, function(_evt, data) {
2966
3090
  return _async_to_generator(function() {
2967
3091
  var _this, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
@@ -3169,11 +3293,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3169
3293
  this.ima.initialize();
3170
3294
  this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
3171
3295
  this.ima.on("all_ads_completed", function() {
3296
+ var remaining = _this.getRemainingAdMs();
3172
3297
  if (_this.config.debugAdTiming) {
3173
- console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - ending ad break");
3298
+ console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length));
3174
3299
  }
3175
3300
  if (_this.inAdBreak) {
3176
- _this.handleAdPodComplete();
3301
+ if (remaining > 500) {
3302
+ _this.tryNextAvailableAd();
3303
+ } else {
3304
+ _this.handleAdPodComplete();
3305
+ }
3177
3306
  }
3178
3307
  });
3179
3308
  this.ima.on("ad_error", function(errorPayload) {
@@ -3968,6 +4097,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3968
4097
  this.continuousFetchingActive = true;
3969
4098
  this.isShowingPlaceholder = false;
3970
4099
  this.placeholderStartTimeMs = null;
4100
+ this.consecutiveEmptyResponses = 0;
4101
+ this.totalAdRequestsInBreak = 0;
4102
+ this.lastEmptyResponseTimeMs = 0;
3971
4103
  currentMuted = this.video.muted;
3972
4104
  currentVolume = this.video.volume;
3973
4105
  this.ima.updateOriginalMutedState(currentMuted, currentVolume);
@@ -3975,6 +4107,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3975
4107
  this.currentAdIndex = 0;
3976
4108
  this.totalAdsInBreak = 1;
3977
4109
  this.adPodQueue = [];
4110
+ this.showAds = true;
4111
+ this.ima.showPlaceholder();
3978
4112
  if (this.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
3979
4113
  this.expectedAdBreakDurationMs = adBreakDurationMs;
3980
4114
  this.currentAdBreakStartWallClockMs = Date.now();
@@ -4061,158 +4195,200 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4061
4195
  key: "continuousFetchLoop",
4062
4196
  value: function continuousFetchLoop(baseVastUrl) {
4063
4197
  return _async_to_generator(function() {
4064
- var remaining, maxQueueSize, newAdUrl, response, xmlText, parser, xmlDoc, mediaFiles, error;
4198
+ var _this, _loop, _ret;
4065
4199
  return _ts_generator(this, function(_state) {
4066
4200
  switch(_state.label){
4067
4201
  case 0:
4068
- if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4069
- 3,
4070
- 14
4071
- ];
4072
- remaining = this.getRemainingAdMs();
4073
- if (remaining <= 0) {
4074
- if (this.config.debugAdTiming) {
4075
- console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4076
- }
4077
- return [
4078
- 3,
4079
- 14
4080
- ];
4081
- }
4082
- maxQueueSize = 3;
4083
- if (!(this.adRequestQueue.length >= maxQueueSize)) return [
4084
- 3,
4085
- 2
4086
- ];
4087
- if (this.config.debugAdTiming) {
4088
- console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(this.adRequestQueue.length, "), pausing fetching..."));
4089
- }
4090
- return [
4091
- 4,
4092
- new Promise(function(resolve) {
4093
- return setTimeout(resolve, 2e3);
4094
- })
4095
- ];
4202
+ _loop = function() {
4203
+ var remaining, maxQueueSize, newAdUrl, _this_ima_hasPreloadedAd, _this_ima, _this_ima_hasPreloadedAd1, hasPreloadedAd, backoffDelay, error, backoffDelay1;
4204
+ return _ts_generator(this, function(_state) {
4205
+ switch(_state.label){
4206
+ case 0:
4207
+ remaining = _this.getRemainingAdMs();
4208
+ if (remaining <= 0) {
4209
+ if (_this.config.debugAdTiming) {
4210
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4211
+ }
4212
+ return [
4213
+ 2,
4214
+ "break"
4215
+ ];
4216
+ }
4217
+ if (_this.totalAdRequestsInBreak >= _this.maxTotalAdRequestsPerBreak) {
4218
+ if (_this.config.debugAdTiming) {
4219
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Maximum ad requests reached (".concat(_this.maxTotalAdRequestsPerBreak, "), stopping fetch loop to prevent server blocks"));
4220
+ }
4221
+ return [
4222
+ 2,
4223
+ "break"
4224
+ ];
4225
+ }
4226
+ if (_this.consecutiveEmptyResponses >= _this.maxConsecutiveEmptyResponses) {
4227
+ if (_this.config.debugAdTiming) {
4228
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive empty responses (".concat(_this.maxConsecutiveEmptyResponses, "), stopping fetch loop"));
4229
+ }
4230
+ return [
4231
+ 2,
4232
+ "break"
4233
+ ];
4234
+ }
4235
+ maxQueueSize = 3;
4236
+ if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
4237
+ 3,
4238
+ 2
4239
+ ];
4240
+ if (_this.config.debugAdTiming) {
4241
+ console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(_this.adRequestQueue.length, "), pausing fetching..."));
4242
+ }
4243
+ return [
4244
+ 4,
4245
+ new Promise(function(resolve) {
4246
+ return setTimeout(resolve, 2e3);
4247
+ })
4248
+ ];
4249
+ case 1:
4250
+ _state.sent();
4251
+ return [
4252
+ 2,
4253
+ "continue"
4254
+ ];
4255
+ case 2:
4256
+ newAdUrl = _this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4257
+ if (!(!newAdUrl || _this.failedVastUrls.has(newAdUrl))) return [
4258
+ 3,
4259
+ 4
4260
+ ];
4261
+ return [
4262
+ 4,
4263
+ new Promise(function(resolve) {
4264
+ return setTimeout(resolve, 1e3);
4265
+ })
4266
+ ];
4267
+ case 3:
4268
+ _state.sent();
4269
+ return [
4270
+ 2,
4271
+ "continue"
4272
+ ];
4273
+ case 4:
4274
+ _this.totalAdRequestsInBreak++;
4275
+ if (_this.config.debugAdTiming) {
4276
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (request ".concat(_this.totalAdRequestsInBreak, "/").concat(_this.maxTotalAdRequestsPerBreak, ", queue: ").concat(_this.adRequestQueue.length, ")..."));
4277
+ }
4278
+ _state.label = 5;
4279
+ case 5:
4280
+ _state.trys.push([
4281
+ 5,
4282
+ 11,
4283
+ ,
4284
+ 13
4285
+ ]);
4286
+ if (!_this.ima.preloadAds) return [
4287
+ 3,
4288
+ 7
4289
+ ];
4290
+ return [
4291
+ 4,
4292
+ _this.ima.preloadAds(newAdUrl)
4293
+ ];
4294
+ case 6:
4295
+ _state.sent();
4296
+ _state.label = 7;
4297
+ case 7:
4298
+ 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;
4299
+ if (!!hasPreloadedAd) return [
4300
+ 3,
4301
+ 9
4302
+ ];
4303
+ _this.consecutiveEmptyResponses++;
4304
+ _this.lastEmptyResponseTimeMs = Date.now();
4305
+ backoffDelay = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4306
+ if (_this.config.debugAdTiming) {
4307
+ console.log("[CONTINUOUS-FETCH] ⚠️ Empty/invalid VAST response (".concat(_this.consecutiveEmptyResponses, "/").concat(_this.maxConsecutiveEmptyResponses, " consecutive), backing off for ").concat(backoffDelay, "ms"));
4308
+ }
4309
+ _this.failedVastUrls.add(newAdUrl);
4310
+ return [
4311
+ 4,
4312
+ new Promise(function(resolve) {
4313
+ return setTimeout(resolve, backoffDelay);
4314
+ })
4315
+ ];
4316
+ case 8:
4317
+ _state.sent();
4318
+ return [
4319
+ 2,
4320
+ "continue"
4321
+ ];
4322
+ case 9:
4323
+ _this.consecutiveEmptyResponses = 0;
4324
+ if (_this.config.debugAdTiming) {
4325
+ console.log("[CONTINUOUS-FETCH] ✅ Successfully preloaded ad, adding to queue (queue size: ".concat(_this.adRequestQueue.length + 1, ")"));
4326
+ }
4327
+ _this.adRequestQueue.push(newAdUrl);
4328
+ _this.totalAdsInBreak++;
4329
+ return [
4330
+ 4,
4331
+ new Promise(function(resolve) {
4332
+ return setTimeout(resolve, 500);
4333
+ })
4334
+ ];
4335
+ case 10:
4336
+ _state.sent();
4337
+ return [
4338
+ 3,
4339
+ 13
4340
+ ];
4341
+ case 11:
4342
+ error = _state.sent();
4343
+ if (_this.config.debugAdTiming) {
4344
+ console.log("[CONTINUOUS-FETCH] \u274C Ad preload failed:", error.message);
4345
+ }
4346
+ _this.failedVastUrls.add(newAdUrl);
4347
+ _this.consecutiveEmptyResponses++;
4348
+ backoffDelay1 = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4349
+ return [
4350
+ 4,
4351
+ new Promise(function(resolve) {
4352
+ return setTimeout(resolve, backoffDelay1);
4353
+ })
4354
+ ];
4355
+ case 12:
4356
+ _state.sent();
4357
+ return [
4358
+ 3,
4359
+ 13
4360
+ ];
4361
+ case 13:
4362
+ return [
4363
+ 2
4364
+ ];
4365
+ }
4366
+ });
4367
+ };
4368
+ _state.label = 1;
4096
4369
  case 1:
4097
- _state.sent();
4098
- return [
4099
- 3,
4100
- 0
4101
- ];
4102
- case 2:
4103
- newAdUrl = this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4104
- if (!(!newAdUrl || this.failedVastUrls.has(newAdUrl))) return [
4370
+ if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4105
4371
  3,
4106
- 4
4107
- ];
4108
- return [
4109
- 4,
4110
- new Promise(function(resolve) {
4111
- return setTimeout(resolve, 1e3);
4112
- })
4372
+ 3
4113
4373
  ];
4114
- case 3:
4115
- _state.sent();
4374
+ _this = this;
4116
4375
  return [
4117
- 3,
4118
- 0
4119
- ];
4120
- case 4:
4121
- if (this.config.debugAdTiming) {
4122
- console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (".concat(this.successfulAdRequests.length + this.adRequestQueue.length + 1, " total)..."));
4123
- }
4124
- _state.label = 5;
4125
- case 5:
4126
- _state.trys.push([
4127
4376
  5,
4128
- 11,
4129
- ,
4130
- 13
4131
- ]);
4132
- return [
4133
- 4,
4134
- fetch(newAdUrl, {
4135
- mode: "cors"
4136
- })
4137
- ];
4138
- case 6:
4139
- response = _state.sent();
4140
- if (!response.ok) {
4141
- throw new Error("Failed to fetch VAST: ".concat(response.status));
4142
- }
4143
- return [
4144
- 4,
4145
- response.text()
4146
- ];
4147
- case 7:
4148
- xmlText = _state.sent();
4149
- parser = new DOMParser();
4150
- xmlDoc = parser.parseFromString(xmlText, "text/xml");
4151
- mediaFiles = xmlDoc.querySelectorAll("MediaFile");
4152
- if (!(mediaFiles.length === 0)) return [
4153
- 3,
4154
- 9
4155
- ];
4156
- if (this.config.debugAdTiming) {
4157
- console.log("[CONTINUOUS-FETCH] \u26A0\uFE0F VAST response has no media files, skipping");
4158
- }
4159
- this.failedVastUrls.add(newAdUrl);
4160
- return [
4161
- 4,
4162
- new Promise(function(resolve) {
4163
- return setTimeout(resolve, 1e3);
4164
- })
4165
- ];
4166
- case 8:
4167
- _state.sent();
4168
- return [
4169
- 3,
4170
- 0
4171
- ];
4172
- case 9:
4173
- if (this.config.debugAdTiming) {
4174
- console.log("[CONTINUOUS-FETCH] ✅ Successfully fetched ad, adding to queue (queue size: ".concat(this.adRequestQueue.length + 1, ")"));
4175
- }
4176
- this.adRequestQueue.push(newAdUrl);
4177
- this.totalAdsInBreak++;
4178
- return [
4179
- 4,
4180
- new Promise(function(resolve) {
4181
- return setTimeout(resolve, 500);
4182
- })
4183
- ];
4184
- case 10:
4185
- _state.sent();
4186
- return [
4187
- 3,
4188
- 13
4377
+ _ts_values(_loop())
4189
4378
  ];
4190
- case 11:
4191
- error = _state.sent();
4192
- if (this.config.debugAdTiming) {
4193
- console.log("[CONTINUOUS-FETCH] \u274C Ad fetch failed:", error.message);
4194
- }
4195
- this.failedVastUrls.add(newAdUrl);
4196
- return [
4197
- 4,
4198
- new Promise(function(resolve) {
4199
- return setTimeout(resolve, 2e3);
4200
- })
4201
- ];
4202
- case 12:
4203
- _state.sent();
4204
- return [
4379
+ case 2:
4380
+ _ret = _state.sent();
4381
+ if (_ret === "break") return [
4205
4382
  3,
4206
- 13
4383
+ 3
4207
4384
  ];
4208
- case 13:
4209
4385
  return [
4210
4386
  3,
4211
- 0
4387
+ 1
4212
4388
  ];
4213
- case 14:
4389
+ case 3:
4214
4390
  if (this.config.debugAdTiming) {
4215
- console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended");
4391
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended (total requests: ".concat(this.totalAdRequestsInBreak, ", empty responses: ").concat(this.consecutiveEmptyResponses, ")"));
4216
4392
  }
4217
4393
  return [
4218
4394
  2
@@ -4902,7 +5078,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4902
5078
  return [
4903
5079
  4,
4904
5080
  fetch(vastTagUrl, {
4905
- mode: "cors"
5081
+ mode: "cors",
5082
+ credentials: "include",
5083
+ headers: {
5084
+ "Accept": "application/xml, text/xml, */*"
5085
+ },
5086
+ referrerPolicy: "no-referrer-when-downgrade"
4906
5087
  })
4907
5088
  ];
4908
5089
  case 1:
@@ -5001,7 +5182,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5001
5182
  return [
5002
5183
  4,
5003
5184
  fetch(vastTagUrl, {
5004
- mode: "cors"
5185
+ mode: "cors",
5186
+ credentials: "include",
5187
+ headers: {
5188
+ "Accept": "application/xml, text/xml, */*"
5189
+ },
5190
+ referrerPolicy: "no-referrer-when-downgrade"
5005
5191
  })
5006
5192
  ];
5007
5193
  case 1:
@@ -5168,10 +5354,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5168
5354
  4,
5169
5355
  fetch(mediaUrl, {
5170
5356
  mode: "cors",
5357
+ credentials: "include",
5171
5358
  method: "GET",
5172
5359
  headers: {
5173
5360
  Range: "bytes=0-1048576"
5174
- }
5361
+ },
5362
+ referrerPolicy: "no-referrer-when-downgrade"
5175
5363
  })
5176
5364
  ];
5177
5365
  case 2: