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;
@@ -790,7 +804,12 @@ function createImaController(video, options) {
790
804
  return [
791
805
  4,
792
806
  fetch(vastTagUrl, {
793
- mode: "cors"
807
+ mode: "cors",
808
+ credentials: "include",
809
+ headers: {
810
+ "Accept": "application/xml, text/xml, */*"
811
+ },
812
+ referrerPolicy: "no-referrer-when-downgrade"
794
813
  })
795
814
  ];
796
815
  case 1:
@@ -1335,6 +1354,7 @@ function createImaController(video, options) {
1335
1354
  },
1336
1355
  showPlaceholder: function showPlaceholder() {
1337
1356
  ensurePlaceholderContainer();
1357
+ hideContentVideo();
1338
1358
  if (adContainerEl) {
1339
1359
  adContainerEl.style.display = "flex";
1340
1360
  adContainerEl.style.backgroundColor = "#000";
@@ -1354,6 +1374,9 @@ function createImaController(video, options) {
1354
1374
  }
1355
1375
  }, 300);
1356
1376
  }
1377
+ if (!adPlaying) {
1378
+ showContentVideo();
1379
+ }
1357
1380
  }
1358
1381
  };
1359
1382
  }
@@ -1618,7 +1641,14 @@ function createHlsAdPlayer(contentVideo, options) {
1618
1641
  case 0:
1619
1642
  return [
1620
1643
  4,
1621
- fetch(vastTagUrl)
1644
+ fetch(vastTagUrl, {
1645
+ mode: "cors",
1646
+ credentials: "include",
1647
+ headers: {
1648
+ "Accept": "application/xml, text/xml, */*"
1649
+ },
1650
+ referrerPolicy: "no-referrer-when-downgrade"
1651
+ })
1622
1652
  ];
1623
1653
  case 1:
1624
1654
  response = _state.sent();
@@ -2128,6 +2158,8 @@ function createHlsAdPlayer(contentVideo, options) {
2128
2158
  return 1;
2129
2159
  },
2130
2160
  showPlaceholder: function showPlaceholder() {
2161
+ contentVideo.style.opacity = "0";
2162
+ contentVideo.style.visibility = "hidden";
2131
2163
  if (!adContainerEl) {
2132
2164
  var _contentVideo_parentElement;
2133
2165
  var container = document.createElement("div");
@@ -2155,6 +2187,10 @@ function createHlsAdPlayer(contentVideo, options) {
2155
2187
  adContainerEl.style.display = "none";
2156
2188
  adContainerEl.style.pointerEvents = "none";
2157
2189
  }
2190
+ if (!adPlaying) {
2191
+ contentVideo.style.visibility = "visible";
2192
+ contentVideo.style.opacity = "1";
2193
+ }
2158
2194
  }
2159
2195
  };
2160
2196
  }
@@ -2809,6 +2845,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2809
2845
  this.maxPlaceholderDurationMs = 5e3;
2810
2846
  this.placeholderStartTimeMs = null;
2811
2847
  this.isShowingPlaceholder = false;
2848
+ this.consecutiveEmptyResponses = 0;
2849
+ this.totalAdRequestsInBreak = 0;
2850
+ this.lastEmptyResponseTimeMs = 0;
2851
+ this.maxTotalAdRequestsPerBreak = 20;
2852
+ this.maxConsecutiveEmptyResponses = 5;
2853
+ this.baseEmptyResponseDelayMs = 2e3;
2854
+ this.maxEmptyResponseDelayMs = 3e4;
2812
2855
  initializePolyfills();
2813
2856
  var browserOverrides = getBrowserConfigOverrides();
2814
2857
  this.config = _object_spread({}, config, browserOverrides);
@@ -2998,6 +3041,87 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2998
3041
  });
2999
3042
  }).call(_this);
3000
3043
  });
3044
+ this.hls.on(import_hls2.default.Events.LEVEL_LOADED, function(_evt, data) {
3045
+ if (_this.inAdBreak) {
3046
+ return;
3047
+ }
3048
+ var details = data === null || data === void 0 ? void 0 : data.details;
3049
+ if (!details || !details.fragments || details.fragments.length === 0) {
3050
+ return;
3051
+ }
3052
+ var fragmentsToScan = Math.min(5, details.fragments.length);
3053
+ for(var i = 0; i < fragmentsToScan; i++){
3054
+ var frag = details.fragments[i];
3055
+ var tagList = frag === null || frag === void 0 ? void 0 : frag.tagList;
3056
+ if (!Array.isArray(tagList)) continue;
3057
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3058
+ try {
3059
+ for(var _iterator = tagList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
3060
+ var entry = _step.value;
3061
+ var tag = "";
3062
+ var value = "";
3063
+ if (Array.isArray(entry)) {
3064
+ var _entry_;
3065
+ tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
3066
+ var _entry_1;
3067
+ value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
3068
+ } else if (typeof entry === "string") {
3069
+ var idx = entry.indexOf(":");
3070
+ if (idx >= 0) {
3071
+ tag = entry.substring(0, idx);
3072
+ value = entry.substring(idx + 1);
3073
+ } else {
3074
+ tag = entry;
3075
+ }
3076
+ }
3077
+ if (!tag) continue;
3078
+ if (tag.includes("EXT-X-CUE-OUT") || tag.includes("EXT-X-DATERANGE")) {
3079
+ var attrs = tag.includes("EXT-X-DATERANGE") ? _this.parseAttributeList(value) : {};
3080
+ var hasScteOut = tag.includes("EXT-X-CUE-OUT") || "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
3081
+ if (hasScteOut) {
3082
+ if (_this.config.debugAdTiming) {
3083
+ console.log("[StormcloudVideoPlayer] \uD83C\uDFAF EARLY SCTE-35 DETECTION: Ad break marker found in fragment", i, "- triggering ad handling immediately");
3084
+ }
3085
+ var durationSeconds = _this.parseCueOutDuration(value);
3086
+ var marker = _object_spread_props(_object_spread({
3087
+ type: "start"
3088
+ }, durationSeconds !== void 0 ? {
3089
+ durationSeconds: durationSeconds
3090
+ } : {}), {
3091
+ raw: {
3092
+ tag: tag,
3093
+ value: value,
3094
+ earlyDetection: true
3095
+ }
3096
+ });
3097
+ _this.inAdBreak = true;
3098
+ _this.expectedAdBreakDurationMs = durationSeconds ? durationSeconds * 1e3 : void 0;
3099
+ _this.currentAdBreakStartWallClockMs = Date.now();
3100
+ _this.clearAdStartTimer();
3101
+ _this.handleAdStart(marker);
3102
+ if (_this.expectedAdBreakDurationMs != null) {
3103
+ _this.scheduleAdStopCountdown(_this.expectedAdBreakDurationMs);
3104
+ }
3105
+ return;
3106
+ }
3107
+ }
3108
+ }
3109
+ } catch (err) {
3110
+ _didIteratorError = true;
3111
+ _iteratorError = err;
3112
+ } finally{
3113
+ try {
3114
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3115
+ _iterator.return();
3116
+ }
3117
+ } finally{
3118
+ if (_didIteratorError) {
3119
+ throw _iteratorError;
3120
+ }
3121
+ }
3122
+ }
3123
+ }
3124
+ });
3001
3125
  this.hls.on(import_hls2.default.Events.FRAG_BUFFERED, function(_evt, data) {
3002
3126
  return _async_to_generator(function() {
3003
3127
  var _this, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
@@ -3205,11 +3329,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3205
3329
  this.ima.initialize();
3206
3330
  this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
3207
3331
  this.ima.on("all_ads_completed", function() {
3332
+ var remaining = _this.getRemainingAdMs();
3208
3333
  if (_this.config.debugAdTiming) {
3209
- console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - ending ad break");
3334
+ console.log("[StormcloudVideoPlayer] IMA all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length));
3210
3335
  }
3211
3336
  if (_this.inAdBreak) {
3212
- _this.handleAdPodComplete();
3337
+ if (remaining > 500) {
3338
+ _this.tryNextAvailableAd();
3339
+ } else {
3340
+ _this.handleAdPodComplete();
3341
+ }
3213
3342
  }
3214
3343
  });
3215
3344
  this.ima.on("ad_error", function(errorPayload) {
@@ -4004,6 +4133,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4004
4133
  this.continuousFetchingActive = true;
4005
4134
  this.isShowingPlaceholder = false;
4006
4135
  this.placeholderStartTimeMs = null;
4136
+ this.consecutiveEmptyResponses = 0;
4137
+ this.totalAdRequestsInBreak = 0;
4138
+ this.lastEmptyResponseTimeMs = 0;
4007
4139
  currentMuted = this.video.muted;
4008
4140
  currentVolume = this.video.volume;
4009
4141
  this.ima.updateOriginalMutedState(currentMuted, currentVolume);
@@ -4011,6 +4143,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4011
4143
  this.currentAdIndex = 0;
4012
4144
  this.totalAdsInBreak = 1;
4013
4145
  this.adPodQueue = [];
4146
+ this.showAds = true;
4147
+ this.ima.showPlaceholder();
4014
4148
  if (this.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
4015
4149
  this.expectedAdBreakDurationMs = adBreakDurationMs;
4016
4150
  this.currentAdBreakStartWallClockMs = Date.now();
@@ -4097,158 +4231,200 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4097
4231
  key: "continuousFetchLoop",
4098
4232
  value: function continuousFetchLoop(baseVastUrl) {
4099
4233
  return _async_to_generator(function() {
4100
- var remaining, maxQueueSize, newAdUrl, response, xmlText, parser, xmlDoc, mediaFiles, error;
4234
+ var _this, _loop, _ret;
4101
4235
  return _ts_generator(this, function(_state) {
4102
4236
  switch(_state.label){
4103
4237
  case 0:
4104
- if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4105
- 3,
4106
- 14
4107
- ];
4108
- remaining = this.getRemainingAdMs();
4109
- if (remaining <= 0) {
4110
- if (this.config.debugAdTiming) {
4111
- console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4112
- }
4113
- return [
4114
- 3,
4115
- 14
4116
- ];
4117
- }
4118
- maxQueueSize = 3;
4119
- if (!(this.adRequestQueue.length >= maxQueueSize)) return [
4120
- 3,
4121
- 2
4122
- ];
4123
- if (this.config.debugAdTiming) {
4124
- console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(this.adRequestQueue.length, "), pausing fetching..."));
4125
- }
4126
- return [
4127
- 4,
4128
- new Promise(function(resolve) {
4129
- return setTimeout(resolve, 2e3);
4130
- })
4131
- ];
4238
+ _loop = function() {
4239
+ var remaining, maxQueueSize, newAdUrl, _this_ima_hasPreloadedAd, _this_ima, _this_ima_hasPreloadedAd1, hasPreloadedAd, backoffDelay, error, backoffDelay1;
4240
+ return _ts_generator(this, function(_state) {
4241
+ switch(_state.label){
4242
+ case 0:
4243
+ remaining = _this.getRemainingAdMs();
4244
+ if (remaining <= 0) {
4245
+ if (_this.config.debugAdTiming) {
4246
+ console.log("[CONTINUOUS-FETCH] \u23F9\uFE0F Ad break time expired, stopping fetch loop");
4247
+ }
4248
+ return [
4249
+ 2,
4250
+ "break"
4251
+ ];
4252
+ }
4253
+ if (_this.totalAdRequestsInBreak >= _this.maxTotalAdRequestsPerBreak) {
4254
+ if (_this.config.debugAdTiming) {
4255
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Maximum ad requests reached (".concat(_this.maxTotalAdRequestsPerBreak, "), stopping fetch loop to prevent server blocks"));
4256
+ }
4257
+ return [
4258
+ 2,
4259
+ "break"
4260
+ ];
4261
+ }
4262
+ if (_this.consecutiveEmptyResponses >= _this.maxConsecutiveEmptyResponses) {
4263
+ if (_this.config.debugAdTiming) {
4264
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive empty responses (".concat(_this.maxConsecutiveEmptyResponses, "), stopping fetch loop"));
4265
+ }
4266
+ return [
4267
+ 2,
4268
+ "break"
4269
+ ];
4270
+ }
4271
+ maxQueueSize = 3;
4272
+ if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
4273
+ 3,
4274
+ 2
4275
+ ];
4276
+ if (_this.config.debugAdTiming) {
4277
+ console.log("[CONTINUOUS-FETCH] ⏸️ Queue full (".concat(_this.adRequestQueue.length, "), pausing fetching..."));
4278
+ }
4279
+ return [
4280
+ 4,
4281
+ new Promise(function(resolve) {
4282
+ return setTimeout(resolve, 2e3);
4283
+ })
4284
+ ];
4285
+ case 1:
4286
+ _state.sent();
4287
+ return [
4288
+ 2,
4289
+ "continue"
4290
+ ];
4291
+ case 2:
4292
+ newAdUrl = _this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4293
+ if (!(!newAdUrl || _this.failedVastUrls.has(newAdUrl))) return [
4294
+ 3,
4295
+ 4
4296
+ ];
4297
+ return [
4298
+ 4,
4299
+ new Promise(function(resolve) {
4300
+ return setTimeout(resolve, 1e3);
4301
+ })
4302
+ ];
4303
+ case 3:
4304
+ _state.sent();
4305
+ return [
4306
+ 2,
4307
+ "continue"
4308
+ ];
4309
+ case 4:
4310
+ _this.totalAdRequestsInBreak++;
4311
+ if (_this.config.debugAdTiming) {
4312
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (request ".concat(_this.totalAdRequestsInBreak, "/").concat(_this.maxTotalAdRequestsPerBreak, ", queue: ").concat(_this.adRequestQueue.length, ")..."));
4313
+ }
4314
+ _state.label = 5;
4315
+ case 5:
4316
+ _state.trys.push([
4317
+ 5,
4318
+ 11,
4319
+ ,
4320
+ 13
4321
+ ]);
4322
+ if (!_this.ima.preloadAds) return [
4323
+ 3,
4324
+ 7
4325
+ ];
4326
+ return [
4327
+ 4,
4328
+ _this.ima.preloadAds(newAdUrl)
4329
+ ];
4330
+ case 6:
4331
+ _state.sent();
4332
+ _state.label = 7;
4333
+ case 7:
4334
+ 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;
4335
+ if (!!hasPreloadedAd) return [
4336
+ 3,
4337
+ 9
4338
+ ];
4339
+ _this.consecutiveEmptyResponses++;
4340
+ _this.lastEmptyResponseTimeMs = Date.now();
4341
+ backoffDelay = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4342
+ if (_this.config.debugAdTiming) {
4343
+ console.log("[CONTINUOUS-FETCH] ⚠️ Empty/invalid VAST response (".concat(_this.consecutiveEmptyResponses, "/").concat(_this.maxConsecutiveEmptyResponses, " consecutive), backing off for ").concat(backoffDelay, "ms"));
4344
+ }
4345
+ _this.failedVastUrls.add(newAdUrl);
4346
+ return [
4347
+ 4,
4348
+ new Promise(function(resolve) {
4349
+ return setTimeout(resolve, backoffDelay);
4350
+ })
4351
+ ];
4352
+ case 8:
4353
+ _state.sent();
4354
+ return [
4355
+ 2,
4356
+ "continue"
4357
+ ];
4358
+ case 9:
4359
+ _this.consecutiveEmptyResponses = 0;
4360
+ if (_this.config.debugAdTiming) {
4361
+ console.log("[CONTINUOUS-FETCH] ✅ Successfully preloaded ad, adding to queue (queue size: ".concat(_this.adRequestQueue.length + 1, ")"));
4362
+ }
4363
+ _this.adRequestQueue.push(newAdUrl);
4364
+ _this.totalAdsInBreak++;
4365
+ return [
4366
+ 4,
4367
+ new Promise(function(resolve) {
4368
+ return setTimeout(resolve, 500);
4369
+ })
4370
+ ];
4371
+ case 10:
4372
+ _state.sent();
4373
+ return [
4374
+ 3,
4375
+ 13
4376
+ ];
4377
+ case 11:
4378
+ error = _state.sent();
4379
+ if (_this.config.debugAdTiming) {
4380
+ console.log("[CONTINUOUS-FETCH] \u274C Ad preload failed:", error.message);
4381
+ }
4382
+ _this.failedVastUrls.add(newAdUrl);
4383
+ _this.consecutiveEmptyResponses++;
4384
+ backoffDelay1 = Math.min(_this.baseEmptyResponseDelayMs * Math.pow(2, _this.consecutiveEmptyResponses - 1), _this.maxEmptyResponseDelayMs);
4385
+ return [
4386
+ 4,
4387
+ new Promise(function(resolve) {
4388
+ return setTimeout(resolve, backoffDelay1);
4389
+ })
4390
+ ];
4391
+ case 12:
4392
+ _state.sent();
4393
+ return [
4394
+ 3,
4395
+ 13
4396
+ ];
4397
+ case 13:
4398
+ return [
4399
+ 2
4400
+ ];
4401
+ }
4402
+ });
4403
+ };
4404
+ _state.label = 1;
4132
4405
  case 1:
4133
- _state.sent();
4134
- return [
4135
- 3,
4136
- 0
4137
- ];
4138
- case 2:
4139
- newAdUrl = this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
4140
- if (!(!newAdUrl || this.failedVastUrls.has(newAdUrl))) return [
4406
+ if (!(this.continuousFetchingActive && this.inAdBreak)) return [
4141
4407
  3,
4142
- 4
4143
- ];
4144
- return [
4145
- 4,
4146
- new Promise(function(resolve) {
4147
- return setTimeout(resolve, 1e3);
4148
- })
4408
+ 3
4149
4409
  ];
4150
- case 3:
4151
- _state.sent();
4410
+ _this = this;
4152
4411
  return [
4153
- 3,
4154
- 0
4155
- ];
4156
- case 4:
4157
- if (this.config.debugAdTiming) {
4158
- console.log("[CONTINUOUS-FETCH] \uD83D\uDCE1 Attempting to fetch ad (".concat(this.successfulAdRequests.length + this.adRequestQueue.length + 1, " total)..."));
4159
- }
4160
- _state.label = 5;
4161
- case 5:
4162
- _state.trys.push([
4163
4412
  5,
4164
- 11,
4165
- ,
4166
- 13
4167
- ]);
4168
- return [
4169
- 4,
4170
- fetch(newAdUrl, {
4171
- mode: "cors"
4172
- })
4173
- ];
4174
- case 6:
4175
- response = _state.sent();
4176
- if (!response.ok) {
4177
- throw new Error("Failed to fetch VAST: ".concat(response.status));
4178
- }
4179
- return [
4180
- 4,
4181
- response.text()
4182
- ];
4183
- case 7:
4184
- xmlText = _state.sent();
4185
- parser = new DOMParser();
4186
- xmlDoc = parser.parseFromString(xmlText, "text/xml");
4187
- mediaFiles = xmlDoc.querySelectorAll("MediaFile");
4188
- if (!(mediaFiles.length === 0)) return [
4189
- 3,
4190
- 9
4191
- ];
4192
- if (this.config.debugAdTiming) {
4193
- console.log("[CONTINUOUS-FETCH] \u26A0\uFE0F VAST response has no media files, skipping");
4194
- }
4195
- this.failedVastUrls.add(newAdUrl);
4196
- return [
4197
- 4,
4198
- new Promise(function(resolve) {
4199
- return setTimeout(resolve, 1e3);
4200
- })
4201
- ];
4202
- case 8:
4203
- _state.sent();
4204
- return [
4205
- 3,
4206
- 0
4207
- ];
4208
- case 9:
4209
- if (this.config.debugAdTiming) {
4210
- console.log("[CONTINUOUS-FETCH] ✅ Successfully fetched ad, adding to queue (queue size: ".concat(this.adRequestQueue.length + 1, ")"));
4211
- }
4212
- this.adRequestQueue.push(newAdUrl);
4213
- this.totalAdsInBreak++;
4214
- return [
4215
- 4,
4216
- new Promise(function(resolve) {
4217
- return setTimeout(resolve, 500);
4218
- })
4219
- ];
4220
- case 10:
4221
- _state.sent();
4222
- return [
4223
- 3,
4224
- 13
4413
+ _ts_values(_loop())
4225
4414
  ];
4226
- case 11:
4227
- error = _state.sent();
4228
- if (this.config.debugAdTiming) {
4229
- console.log("[CONTINUOUS-FETCH] \u274C Ad fetch failed:", error.message);
4230
- }
4231
- this.failedVastUrls.add(newAdUrl);
4232
- return [
4233
- 4,
4234
- new Promise(function(resolve) {
4235
- return setTimeout(resolve, 2e3);
4236
- })
4237
- ];
4238
- case 12:
4239
- _state.sent();
4240
- return [
4415
+ case 2:
4416
+ _ret = _state.sent();
4417
+ if (_ret === "break") return [
4241
4418
  3,
4242
- 13
4419
+ 3
4243
4420
  ];
4244
- case 13:
4245
4421
  return [
4246
4422
  3,
4247
- 0
4423
+ 1
4248
4424
  ];
4249
- case 14:
4425
+ case 3:
4250
4426
  if (this.config.debugAdTiming) {
4251
- console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended");
4427
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Continuous fetch loop ended (total requests: ".concat(this.totalAdRequestsInBreak, ", empty responses: ").concat(this.consecutiveEmptyResponses, ")"));
4252
4428
  }
4253
4429
  return [
4254
4430
  2
@@ -4938,7 +5114,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4938
5114
  return [
4939
5115
  4,
4940
5116
  fetch(vastTagUrl, {
4941
- mode: "cors"
5117
+ mode: "cors",
5118
+ credentials: "include",
5119
+ headers: {
5120
+ "Accept": "application/xml, text/xml, */*"
5121
+ },
5122
+ referrerPolicy: "no-referrer-when-downgrade"
4942
5123
  })
4943
5124
  ];
4944
5125
  case 1:
@@ -5037,7 +5218,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5037
5218
  return [
5038
5219
  4,
5039
5220
  fetch(vastTagUrl, {
5040
- mode: "cors"
5221
+ mode: "cors",
5222
+ credentials: "include",
5223
+ headers: {
5224
+ "Accept": "application/xml, text/xml, */*"
5225
+ },
5226
+ referrerPolicy: "no-referrer-when-downgrade"
5041
5227
  })
5042
5228
  ];
5043
5229
  case 1:
@@ -5204,10 +5390,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5204
5390
  4,
5205
5391
  fetch(mediaUrl, {
5206
5392
  mode: "cors",
5393
+ credentials: "include",
5207
5394
  method: "GET",
5208
5395
  headers: {
5209
5396
  Range: "bytes=0-1048576"
5210
- }
5397
+ },
5398
+ referrerPolicy: "no-referrer-when-downgrade"
5211
5399
  })
5212
5400
  ];
5213
5401
  case 2: