stormcloud-video-player 0.5.3 → 0.5.4

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.
@@ -177,9 +177,17 @@ function _ts_generator(thisArg, body) {
177
177
  },
178
178
  trys: [],
179
179
  ops: []
180
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
181
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
182
- return this;
180
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
181
+ return d(g, "next", {
182
+ value: verb(0)
183
+ }), d(g, "throw", {
184
+ value: verb(1)
185
+ }), d(g, "return", {
186
+ value: verb(2)
187
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
188
+ value: function() {
189
+ return this;
190
+ }
183
191
  }), g;
184
192
  function verb(n) {
185
193
  return function(v) {
@@ -279,20 +287,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
279
287
  var __getOwnPropNames = Object.getOwnPropertyNames;
280
288
  var __getProtoOf = Object.getPrototypeOf;
281
289
  var __hasOwnProp = Object.prototype.hasOwnProperty;
282
- var __export = function(target, all) {
290
+ var __export = function __export(target, all) {
283
291
  for(var name in all)__defProp(target, name, {
284
292
  get: all[name],
285
293
  enumerable: true
286
294
  });
287
295
  };
288
- var __copyProps = function(to, from, except, desc) {
296
+ var __copyProps = function __copyProps(to, from, except, desc) {
289
297
  if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
290
298
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
291
299
  try {
292
300
  var _loop = function() {
293
301
  var key = _step.value;
294
302
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
295
- get: function() {
303
+ get: function get() {
296
304
  return from[key];
297
305
  },
298
306
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
@@ -316,7 +324,7 @@ var __copyProps = function(to, from, except, desc) {
316
324
  }
317
325
  return to;
318
326
  };
319
- var __toESM = function(mod, isNodeMode, target) {
327
+ var __toESM = function __toESM(mod, isNodeMode, target) {
320
328
  return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
321
329
  // file that has been converted to a CommonJS file using a Babel-
322
330
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -326,7 +334,7 @@ var __toESM = function(mod, isNodeMode, target) {
326
334
  enumerable: true
327
335
  }) : target, mod);
328
336
  };
329
- var __toCommonJS = function(mod) {
337
+ var __toCommonJS = function __toCommonJS(mod) {
330
338
  return __copyProps(__defProp({}, "__esModule", {
331
339
  value: true
332
340
  }), mod);
@@ -334,7 +342,7 @@ var __toCommonJS = function(mod) {
334
342
  // src/player/StormcloudVideoPlayer.ts
335
343
  var StormcloudVideoPlayer_exports = {};
336
344
  __export(StormcloudVideoPlayer_exports, {
337
- StormcloudVideoPlayer: function() {
345
+ StormcloudVideoPlayer: function StormcloudVideoPlayer1() {
338
346
  return StormcloudVideoPlayer;
339
347
  }
340
348
  });
@@ -667,7 +675,7 @@ function createImaController(video, options) {
667
675
  var fn = _step.value;
668
676
  try {
669
677
  fn(payload);
670
- } catch (e) {}
678
+ } catch (unused) {}
671
679
  }
672
680
  } catch (err) {
673
681
  _didIteratorError = true;
@@ -705,7 +713,7 @@ function createImaController(video, options) {
705
713
  console.error("StormcloudVideoPlayer: The host page is inside a sandboxed iframe without 'allow-scripts'. Google IMA cannot run ads within sandboxed frames. Remove the sandbox attribute or include 'allow-scripts allow-same-origin'.");
706
714
  }
707
715
  }
708
- } catch (e) {}
716
+ } catch (unused) {}
709
717
  if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
710
718
  var existing = document.querySelector('script[data-ima="true"]');
711
719
  if (existing) {
@@ -953,7 +961,7 @@ function createImaController(video, options) {
953
961
  if (adsManager) {
954
962
  try {
955
963
  adsManager.destroy();
956
- } catch (e) {}
964
+ } catch (unused) {}
957
965
  adsManager = void 0;
958
966
  }
959
967
  if (adVideoElement) {
@@ -964,7 +972,7 @@ function createImaController(video, options) {
964
972
  if (adsLoader) {
965
973
  try {
966
974
  adsLoader.destroy();
967
- } catch (e) {}
975
+ } catch (unused) {}
968
976
  adsLoader = void 0;
969
977
  }
970
978
  }
@@ -982,7 +990,7 @@ function createImaController(video, options) {
982
990
  try {
983
991
  var _adDisplayContainer_initialize;
984
992
  (_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
985
- } catch (e) {}
993
+ } catch (unused) {}
986
994
  }
987
995
  }).catch(function() {});
988
996
  },
@@ -1141,7 +1149,7 @@ function createImaController(video, options) {
1141
1149
  window.setTimeout(function() {
1142
1150
  try {
1143
1151
  makeAdsRequest(google, lastAdTagUrl);
1144
- } catch (e) {}
1152
+ } catch (unused) {}
1145
1153
  }, delay);
1146
1154
  } else {
1147
1155
  emit("ad_error", {
@@ -1173,7 +1181,7 @@ function createImaController(video, options) {
1173
1181
  if (adsManager) {
1174
1182
  try {
1175
1183
  adsManager.setVolume(adVolume);
1176
- } catch (e) {}
1184
+ } catch (unused) {}
1177
1185
  }
1178
1186
  emit("content_pause");
1179
1187
  });
@@ -1187,7 +1195,7 @@ function createImaController(video, options) {
1187
1195
  if (adsManager) {
1188
1196
  try {
1189
1197
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1190
- } catch (e) {}
1198
+ } catch (unused) {}
1191
1199
  }
1192
1200
  }
1193
1201
  if (adContainerEl) {
@@ -1348,7 +1356,7 @@ function createImaController(video, options) {
1348
1356
  }
1349
1357
  try {
1350
1358
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1351
- } catch (e) {}
1359
+ } catch (unused) {}
1352
1360
  adsManager.start();
1353
1361
  return [
1354
1362
  2,
@@ -1430,7 +1438,7 @@ function createImaController(video, options) {
1430
1438
  try {
1431
1439
  ;
1432
1440
  adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
1433
- } catch (e) {}
1441
+ } catch (unused) {}
1434
1442
  destroyAdsManager();
1435
1443
  return [
1436
1444
  2
@@ -1461,7 +1469,7 @@ function createImaController(video, options) {
1461
1469
  try {
1462
1470
  var _adsLoader_destroy;
1463
1471
  adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
1464
- } catch (e) {}
1472
+ } catch (unused) {}
1465
1473
  adDisplayContainer = void 0;
1466
1474
  adsLoader = void 0;
1467
1475
  contentVideoHidden = false;
@@ -1510,7 +1518,7 @@ function createImaController(video, options) {
1510
1518
  if (adsManager && adPlaying) {
1511
1519
  try {
1512
1520
  adsManager.setVolume(clampedVolume);
1513
- } catch (e) {}
1521
+ } catch (unused) {}
1514
1522
  }
1515
1523
  },
1516
1524
  getAdVolume: function getAdVolume() {
@@ -2426,8 +2434,8 @@ var DEFAULT_TIMEOUT_MS = 3e3;
2426
2434
  var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
2427
2435
  function createPrebidManager() {
2428
2436
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2429
- var initialized = false;
2430
2437
  var _options_debug;
2438
+ var initialized = false;
2431
2439
  var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
2432
2440
  function log() {
2433
2441
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
@@ -2929,6 +2937,8 @@ function createPrebidController(contentVideo, options) {
2929
2937
  adContainerEl.style.display = "none";
2930
2938
  adContainerEl.style.pointerEvents = "none";
2931
2939
  }
2940
+ contentVideo.style.visibility = "visible";
2941
+ contentVideo.style.opacity = "1";
2932
2942
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
2933
2943
  if (contentVideo.paused) {
2934
2944
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
@@ -4237,7 +4247,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4237
4247
  });
4238
4248
  this.hls.on(import_hls3.default.Events.MANIFEST_PARSED, function(_, data) {
4239
4249
  return _async_to_generator(function() {
4240
- var _this_hls_levels, _this_hls, _this_hls_levels_some, adBehavior, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
4250
+ var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
4241
4251
  return _ts_generator(this, function(_state) {
4242
4252
  switch(_state.label){
4243
4253
  case 0:
@@ -4246,10 +4256,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4246
4256
  } else {
4247
4257
  ;
4248
4258
  ;
4249
- this.isLiveStream = (_this_hls_levels_some = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : (_this_hls_levels = _this_hls.levels) === null || _this_hls_levels === void 0 ? void 0 : _this_hls_levels.some(function(level) {
4259
+ this.isLiveStream = (_ref = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : (_this_hls_levels = _this_hls.levels) === null || _this_hls_levels === void 0 ? void 0 : _this_hls_levels.some(function(level) {
4250
4260
  var _level_details, _level_details1;
4251
4261
  return (level === null || level === void 0 ? void 0 : (_level_details = level.details) === null || _level_details === void 0 ? void 0 : _level_details.live) === true || (level === null || level === void 0 ? void 0 : (_level_details1 = level.details) === null || _level_details1 === void 0 ? void 0 : _level_details1.type) === "LIVE";
4252
- })) !== null && _this_hls_levels_some !== void 0 ? _this_hls_levels_some : false;
4262
+ })) !== null && _ref !== void 0 ? _ref : false;
4253
4263
  }
4254
4264
  if (this.config.debugAdTiming) {
4255
4265
  adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
@@ -4313,9 +4323,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4313
4323
  var tag = "";
4314
4324
  var value = "";
4315
4325
  if (Array.isArray(entry)) {
4316
- var _entry_;
4326
+ var _entry_, _entry_1;
4317
4327
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4318
- var _entry_1;
4319
4328
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4320
4329
  } else if (typeof entry === "string") {
4321
4330
  var idx = entry.indexOf(":");
@@ -4438,9 +4447,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4438
4447
  var tag = "";
4439
4448
  var value = "";
4440
4449
  if (Array.isArray(entry)) {
4441
- var _entry_;
4450
+ var _entry_, _entry_1;
4442
4451
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4443
- var _entry_1;
4444
4452
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4445
4453
  } else if (typeof entry === "string") {
4446
4454
  var idx = entry.indexOf(":");
@@ -4490,10 +4498,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4490
4498
  }
4491
4499
  });
4492
4500
  } else if (tag.includes("EXT-X-DATERANGE")) {
4501
+ var _attrs_CLASS;
4493
4502
  var attrs = _this.parseAttributeList(value);
4494
4503
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4495
4504
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4496
- var _attrs_CLASS;
4497
4505
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4498
4506
  var duration = _this.toNumber(attrs["DURATION"]);
4499
4507
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -4895,11 +4903,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4895
4903
  }
4896
4904
  var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
4897
4905
  if (daterangeMatch) {
4898
- var _daterangeMatch_;
4906
+ var _daterangeMatch_, _attrs_CLASS;
4899
4907
  var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
4900
4908
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4901
4909
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4902
- var _attrs_CLASS;
4903
4910
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4904
4911
  var duration = this.toNumber(attrs["DURATION"]);
4905
4912
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -4975,7 +4982,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4975
4982
  var out = "";
4976
4983
  for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
4977
4984
  return out;
4978
- } catch (e) {
4985
+ } catch (unused) {
4979
4986
  return void 0;
4980
4987
  }
4981
4988
  }
@@ -4994,6 +5001,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4994
5001
  });
4995
5002
  }
4996
5003
  if (marker.type === "start") {
5004
+ var _this_config_immediateManifestAds;
4997
5005
  var _this_pendingAdBreak;
4998
5006
  if (!this.video.muted) {
4999
5007
  this.video.muted = true;
@@ -5018,7 +5026,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5018
5026
  this.expectedAdBreakDurationMs = durationMs;
5019
5027
  this.currentAdBreakStartWallClockMs = Date.now();
5020
5028
  var isManifestMarker = this.isManifestBasedMarker(marker);
5021
- var _this_config_immediateManifestAds;
5022
5029
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
5023
5030
  if (this.config.debugAdTiming) {
5024
5031
  console.log("[StormcloudVideoPlayer] Ad start decision:", {
@@ -5173,9 +5180,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5173
5180
  var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
5174
5181
  var match;
5175
5182
  while((match = regex.exec(value)) !== null){
5176
- var _match_;
5183
+ var _match_, _ref, _match_1;
5177
5184
  var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
5178
- var _match_1, _ref;
5179
5185
  var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
5180
5186
  if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
5181
5187
  rawVal = rawVal.slice(1, -1);
@@ -5534,13 +5540,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5534
5540
  {
5535
5541
  key: "shouldShowNativeControls",
5536
5542
  value: function shouldShowNativeControls() {
5543
+ var _this_config_showCustomControls;
5537
5544
  var streamType = this.getStreamType();
5538
5545
  if (streamType === "other") {
5539
- var _this_config_showCustomControls;
5540
- return !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false);
5546
+ var _this_config_showCustomControls1;
5547
+ return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
5541
5548
  }
5542
- var _this_config_showCustomControls1;
5543
- return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
5549
+ return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
5544
5550
  }
5545
5551
  },
5546
5552
  {
@@ -5699,12 +5705,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5699
5705
  continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
5700
5706
  preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
5701
5707
  preloadIma.initialize();
5702
- errorListener = function(payload) {
5708
+ errorListener = function errorListener(payload) {
5703
5709
  hasAdError = true;
5704
5710
  adErrorPayload = payload;
5705
5711
  };
5706
5712
  preloadIma.on("ad_error", errorListener);
5707
- errorListenerCleanup = function() {
5713
+ errorListenerCleanup = function errorListenerCleanup() {
5708
5714
  return preloadIma.off("ad_error", errorListener);
5709
5715
  };
5710
5716
  return [
@@ -5755,7 +5761,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5755
5761
  isReady: true,
5756
5762
  loadPromise: Promise.resolve()
5757
5763
  };
5758
- lateErrorListener = function(payload) {
5764
+ lateErrorListener = function lateErrorListener(payload) {
5759
5765
  var index = _this.preloadPool.findIndex(function(entry) {
5760
5766
  return entry.vastUrl === vastUrl;
5761
5767
  });
@@ -5766,7 +5772,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5766
5772
  }
5767
5773
  try {
5768
5774
  preloadIma.destroy();
5769
- } catch (e) {}
5775
+ } catch (unused) {}
5770
5776
  }
5771
5777
  };
5772
5778
  preloadIma.on("ad_error", lateErrorListener);
@@ -6591,7 +6597,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6591
6597
  10
6592
6598
  ];
6593
6599
  nextAdUrl = this.adRequestQueue.shift();
6594
- if (!nextAdUrl) {
6600
+ if (nextAdUrl == null) {
6595
6601
  return [
6596
6602
  3,
6597
6603
  4
@@ -6777,7 +6783,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6777
6783
  9
6778
6784
  ];
6779
6785
  nextAdUrl = this.adRequestQueue.shift();
6780
- if (!nextAdUrl) {
6786
+ if (nextAdUrl == null) {
6781
6787
  return [
6782
6788
  3,
6783
6789
  3
@@ -6982,11 +6988,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6982
6988
  {
6983
6989
  key: "ensureAdStoppedByTimer",
6984
6990
  value: function ensureAdStoppedByTimer() {
6991
+ var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
6985
6992
  if (!this.inAdBreak) return;
6986
6993
  this.adStopTimerId = void 0;
6987
6994
  var adPlaying = this.ima.isAdPlaying();
6988
6995
  var pendingAds = this.adPodQueue.length > 0;
6989
- var _this_config_adBreakCheckIntervalMs;
6990
6996
  var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
6991
6997
  var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
6992
6998
  var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
@@ -6994,7 +7000,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6994
7000
  if (this.currentAdBreakStartWallClockMs != null) {
6995
7001
  elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
6996
7002
  }
6997
- var _this_expectedAdBreakDurationMs;
6998
7003
  var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
6999
7004
  var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
7000
7005
  var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
@@ -7251,15 +7256,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7251
7256
  9
7252
7257
  ];
7253
7258
  case 9:
7254
- if (this.isTemporaryAdError(playError)) {
7255
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7256
- if (this.config.debugAdTiming) {
7257
- console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7258
- }
7259
- } else {
7260
- this.failedVastUrls.add(vastTagUrl);
7261
- if (this.config.debugAdTiming) {
7262
- console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7259
+ if (vastTagUrl) {
7260
+ if (this.isTemporaryAdError(playError)) {
7261
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7262
+ if (this.config.debugAdTiming) {
7263
+ console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7264
+ }
7265
+ } else {
7266
+ this.failedVastUrls.add(vastTagUrl);
7267
+ if (this.config.debugAdTiming) {
7268
+ console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7269
+ }
7263
7270
  }
7264
7271
  }
7265
7272
  this.clearAdFailsafeTimer();
@@ -7328,15 +7335,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7328
7335
  15
7329
7336
  ];
7330
7337
  case 15:
7331
- if (this.isTemporaryAdError(error)) {
7332
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7333
- if (this.config.debugAdTiming) {
7334
- console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7335
- }
7336
- } else {
7337
- this.failedVastUrls.add(vastTagUrl);
7338
- if (this.config.debugAdTiming) {
7339
- console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7338
+ if (vastTagUrl) {
7339
+ if (this.isTemporaryAdError(error)) {
7340
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7341
+ if (this.config.debugAdTiming) {
7342
+ console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7343
+ }
7344
+ } else {
7345
+ this.failedVastUrls.add(vastTagUrl);
7346
+ if (this.config.debugAdTiming) {
7347
+ console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7348
+ }
7340
7349
  }
7341
7350
  }
7342
7351
  this.clearAdRequestWatchdog();
@@ -7439,8 +7448,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7439
7448
  key: "startAdRequestWatchdog",
7440
7449
  value: function startAdRequestWatchdog(token) {
7441
7450
  var _this = this;
7442
- this.clearAdRequestWatchdog();
7443
7451
  var _this_config_adFailsafeTimeoutMs;
7452
+ this.clearAdRequestWatchdog();
7444
7453
  var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7445
7454
  this.adRequestWatchdogToken = token;
7446
7455
  this.adRequestWatchdogId = window.setTimeout(function() {
@@ -7483,8 +7492,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7483
7492
  key: "startAdFailsafeTimer",
7484
7493
  value: function startAdFailsafeTimer(token) {
7485
7494
  var _this = this;
7486
- this.clearAdFailsafeTimer();
7487
7495
  var _this_config_adFailsafeTimeoutMs;
7496
+ this.clearAdFailsafeTimer();
7488
7497
  var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7489
7498
  this.adFailsafeToken = token;
7490
7499
  this.adFailsafeTimerId = window.setTimeout(function() {