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.
@@ -152,12 +152,22 @@ function _object_spread_props(target, source) {
152
152
  }
153
153
  function _object_without_properties(source, excluded) {
154
154
  if (source == null) return {};
155
- var target = _object_without_properties_loose(source, excluded);
156
- var key, i;
155
+ var target = {}, sourceKeys, key, i;
156
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
157
+ sourceKeys = Reflect.ownKeys(Object(source));
158
+ for(i = 0; i < sourceKeys.length; i++){
159
+ key = sourceKeys[i];
160
+ if (excluded.indexOf(key) >= 0) continue;
161
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
162
+ target[key] = source[key];
163
+ }
164
+ return target;
165
+ }
166
+ target = _object_without_properties_loose(source, excluded);
157
167
  if (Object.getOwnPropertySymbols) {
158
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
159
- for(i = 0; i < sourceSymbolKeys.length; i++){
160
- key = sourceSymbolKeys[i];
168
+ sourceKeys = Object.getOwnPropertySymbols(source);
169
+ for(i = 0; i < sourceKeys.length; i++){
170
+ key = sourceKeys[i];
161
171
  if (excluded.indexOf(key) >= 0) continue;
162
172
  if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
163
173
  target[key] = source[key];
@@ -167,12 +177,11 @@ function _object_without_properties(source, excluded) {
167
177
  }
168
178
  function _object_without_properties_loose(source, excluded) {
169
179
  if (source == null) return {};
170
- var target = {};
171
- var sourceKeys = Object.keys(source);
172
- var key, i;
180
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
173
181
  for(i = 0; i < sourceKeys.length; i++){
174
182
  key = sourceKeys[i];
175
183
  if (excluded.indexOf(key) >= 0) continue;
184
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
176
185
  target[key] = source[key];
177
186
  }
178
187
  return target;
@@ -204,9 +213,17 @@ function _ts_generator(thisArg, body) {
204
213
  },
205
214
  trys: [],
206
215
  ops: []
207
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
208
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
209
- return this;
216
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
217
+ return d(g, "next", {
218
+ value: verb(0)
219
+ }), d(g, "throw", {
220
+ value: verb(1)
221
+ }), d(g, "return", {
222
+ value: verb(2)
223
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
224
+ value: function() {
225
+ return this;
226
+ }
210
227
  }), g;
211
228
  function verb(n) {
212
229
  return function(v) {
@@ -306,20 +323,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
306
323
  var __getOwnPropNames = Object.getOwnPropertyNames;
307
324
  var __getProtoOf = Object.getPrototypeOf;
308
325
  var __hasOwnProp = Object.prototype.hasOwnProperty;
309
- var __export = function(target, all) {
326
+ var __export = function __export(target, all) {
310
327
  for(var name in all)__defProp(target, name, {
311
328
  get: all[name],
312
329
  enumerable: true
313
330
  });
314
331
  };
315
- var __copyProps = function(to, from, except, desc) {
332
+ var __copyProps = function __copyProps(to, from, except, desc) {
316
333
  if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
317
334
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
318
335
  try {
319
336
  var _loop = function() {
320
337
  var key = _step.value;
321
338
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
322
- get: function() {
339
+ get: function get() {
323
340
  return from[key];
324
341
  },
325
342
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
@@ -343,7 +360,7 @@ var __copyProps = function(to, from, except, desc) {
343
360
  }
344
361
  return to;
345
362
  };
346
- var __toESM = function(mod, isNodeMode, target) {
363
+ var __toESM = function __toESM(mod, isNodeMode, target) {
347
364
  return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
348
365
  // file that has been converted to a CommonJS file using a Babel-
349
366
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -353,7 +370,7 @@ var __toESM = function(mod, isNodeMode, target) {
353
370
  enumerable: true
354
371
  }) : target, mod);
355
372
  };
356
- var __toCommonJS = function(mod) {
373
+ var __toCommonJS = function __toCommonJS(mod) {
357
374
  return __copyProps(__defProp({}, "__esModule", {
358
375
  value: true
359
376
  }), mod);
@@ -361,7 +378,7 @@ var __toCommonJS = function(mod) {
361
378
  // src/ui/StormcloudVideoPlayer.tsx
362
379
  var StormcloudVideoPlayer_exports = {};
363
380
  __export(StormcloudVideoPlayer_exports, {
364
- StormcloudVideoPlayerComponent: function() {
381
+ StormcloudVideoPlayerComponent: function StormcloudVideoPlayerComponent1() {
365
382
  return StormcloudVideoPlayerComponent;
366
383
  }
367
384
  });
@@ -696,7 +713,7 @@ function createImaController(video, options) {
696
713
  var fn = _step.value;
697
714
  try {
698
715
  fn(payload);
699
- } catch (e) {}
716
+ } catch (unused) {}
700
717
  }
701
718
  } catch (err) {
702
719
  _didIteratorError = true;
@@ -734,7 +751,7 @@ function createImaController(video, options) {
734
751
  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'.");
735
752
  }
736
753
  }
737
- } catch (e) {}
754
+ } catch (unused) {}
738
755
  if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
739
756
  var existing = document.querySelector('script[data-ima="true"]');
740
757
  if (existing) {
@@ -982,7 +999,7 @@ function createImaController(video, options) {
982
999
  if (adsManager) {
983
1000
  try {
984
1001
  adsManager.destroy();
985
- } catch (e) {}
1002
+ } catch (unused) {}
986
1003
  adsManager = void 0;
987
1004
  }
988
1005
  if (adVideoElement) {
@@ -993,7 +1010,7 @@ function createImaController(video, options) {
993
1010
  if (adsLoader) {
994
1011
  try {
995
1012
  adsLoader.destroy();
996
- } catch (e) {}
1013
+ } catch (unused) {}
997
1014
  adsLoader = void 0;
998
1015
  }
999
1016
  }
@@ -1011,7 +1028,7 @@ function createImaController(video, options) {
1011
1028
  try {
1012
1029
  var _adDisplayContainer_initialize;
1013
1030
  (_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
1014
- } catch (e) {}
1031
+ } catch (unused) {}
1015
1032
  }
1016
1033
  }).catch(function() {});
1017
1034
  },
@@ -1170,7 +1187,7 @@ function createImaController(video, options) {
1170
1187
  window.setTimeout(function() {
1171
1188
  try {
1172
1189
  makeAdsRequest(google, lastAdTagUrl);
1173
- } catch (e) {}
1190
+ } catch (unused) {}
1174
1191
  }, delay);
1175
1192
  } else {
1176
1193
  emit("ad_error", {
@@ -1202,7 +1219,7 @@ function createImaController(video, options) {
1202
1219
  if (adsManager) {
1203
1220
  try {
1204
1221
  adsManager.setVolume(adVolume);
1205
- } catch (e) {}
1222
+ } catch (unused) {}
1206
1223
  }
1207
1224
  emit("content_pause");
1208
1225
  });
@@ -1216,7 +1233,7 @@ function createImaController(video, options) {
1216
1233
  if (adsManager) {
1217
1234
  try {
1218
1235
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1219
- } catch (e) {}
1236
+ } catch (unused) {}
1220
1237
  }
1221
1238
  }
1222
1239
  if (adContainerEl) {
@@ -1377,7 +1394,7 @@ function createImaController(video, options) {
1377
1394
  }
1378
1395
  try {
1379
1396
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1380
- } catch (e) {}
1397
+ } catch (unused) {}
1381
1398
  adsManager.start();
1382
1399
  return [
1383
1400
  2,
@@ -1459,7 +1476,7 @@ function createImaController(video, options) {
1459
1476
  try {
1460
1477
  ;
1461
1478
  adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
1462
- } catch (e) {}
1479
+ } catch (unused) {}
1463
1480
  destroyAdsManager();
1464
1481
  return [
1465
1482
  2
@@ -1490,7 +1507,7 @@ function createImaController(video, options) {
1490
1507
  try {
1491
1508
  var _adsLoader_destroy;
1492
1509
  adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
1493
- } catch (e) {}
1510
+ } catch (unused) {}
1494
1511
  adDisplayContainer = void 0;
1495
1512
  adsLoader = void 0;
1496
1513
  contentVideoHidden = false;
@@ -1539,7 +1556,7 @@ function createImaController(video, options) {
1539
1556
  if (adsManager && adPlaying) {
1540
1557
  try {
1541
1558
  adsManager.setVolume(clampedVolume);
1542
- } catch (e) {}
1559
+ } catch (unused) {}
1543
1560
  }
1544
1561
  },
1545
1562
  getAdVolume: function getAdVolume() {
@@ -2455,8 +2472,8 @@ var DEFAULT_TIMEOUT_MS = 3e3;
2455
2472
  var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
2456
2473
  function createPrebidManager() {
2457
2474
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2458
- var initialized = false;
2459
2475
  var _options_debug;
2476
+ var initialized = false;
2460
2477
  var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
2461
2478
  function log() {
2462
2479
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
@@ -2958,6 +2975,8 @@ function createPrebidController(contentVideo, options) {
2958
2975
  adContainerEl.style.display = "none";
2959
2976
  adContainerEl.style.pointerEvents = "none";
2960
2977
  }
2978
+ contentVideo.style.visibility = "visible";
2979
+ contentVideo.style.opacity = "1";
2961
2980
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
2962
2981
  if (contentVideo.paused) {
2963
2982
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
@@ -4266,7 +4285,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4266
4285
  });
4267
4286
  this.hls.on(import_hls3.default.Events.MANIFEST_PARSED, function(_, data) {
4268
4287
  return _async_to_generator(function() {
4269
- var _this_hls_levels, _this_hls, _this_hls_levels_some, adBehavior, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
4288
+ var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
4270
4289
  return _ts_generator(this, function(_state) {
4271
4290
  switch(_state.label){
4272
4291
  case 0:
@@ -4275,10 +4294,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4275
4294
  } else {
4276
4295
  ;
4277
4296
  ;
4278
- 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) {
4297
+ 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) {
4279
4298
  var _level_details, _level_details1;
4280
4299
  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";
4281
- })) !== null && _this_hls_levels_some !== void 0 ? _this_hls_levels_some : false;
4300
+ })) !== null && _ref !== void 0 ? _ref : false;
4282
4301
  }
4283
4302
  if (this.config.debugAdTiming) {
4284
4303
  adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
@@ -4342,9 +4361,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4342
4361
  var tag = "";
4343
4362
  var value = "";
4344
4363
  if (Array.isArray(entry)) {
4345
- var _entry_;
4364
+ var _entry_, _entry_1;
4346
4365
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4347
- var _entry_1;
4348
4366
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4349
4367
  } else if (typeof entry === "string") {
4350
4368
  var idx = entry.indexOf(":");
@@ -4467,9 +4485,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4467
4485
  var tag = "";
4468
4486
  var value = "";
4469
4487
  if (Array.isArray(entry)) {
4470
- var _entry_;
4488
+ var _entry_, _entry_1;
4471
4489
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4472
- var _entry_1;
4473
4490
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4474
4491
  } else if (typeof entry === "string") {
4475
4492
  var idx = entry.indexOf(":");
@@ -4519,10 +4536,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4519
4536
  }
4520
4537
  });
4521
4538
  } else if (tag.includes("EXT-X-DATERANGE")) {
4539
+ var _attrs_CLASS;
4522
4540
  var attrs = _this.parseAttributeList(value);
4523
4541
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4524
4542
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4525
- var _attrs_CLASS;
4526
4543
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4527
4544
  var duration = _this.toNumber(attrs["DURATION"]);
4528
4545
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -4924,11 +4941,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4924
4941
  }
4925
4942
  var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
4926
4943
  if (daterangeMatch) {
4927
- var _daterangeMatch_;
4944
+ var _daterangeMatch_, _attrs_CLASS;
4928
4945
  var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
4929
4946
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4930
4947
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4931
- var _attrs_CLASS;
4932
4948
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4933
4949
  var duration = this.toNumber(attrs["DURATION"]);
4934
4950
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5004,7 +5020,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5004
5020
  var out = "";
5005
5021
  for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
5006
5022
  return out;
5007
- } catch (e) {
5023
+ } catch (unused) {
5008
5024
  return void 0;
5009
5025
  }
5010
5026
  }
@@ -5023,6 +5039,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5023
5039
  });
5024
5040
  }
5025
5041
  if (marker.type === "start") {
5042
+ var _this_config_immediateManifestAds;
5026
5043
  var _this_pendingAdBreak;
5027
5044
  if (!this.video.muted) {
5028
5045
  this.video.muted = true;
@@ -5047,7 +5064,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5047
5064
  this.expectedAdBreakDurationMs = durationMs;
5048
5065
  this.currentAdBreakStartWallClockMs = Date.now();
5049
5066
  var isManifestMarker = this.isManifestBasedMarker(marker);
5050
- var _this_config_immediateManifestAds;
5051
5067
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
5052
5068
  if (this.config.debugAdTiming) {
5053
5069
  console.log("[StormcloudVideoPlayer] Ad start decision:", {
@@ -5202,9 +5218,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5202
5218
  var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
5203
5219
  var match;
5204
5220
  while((match = regex.exec(value)) !== null){
5205
- var _match_;
5221
+ var _match_, _ref, _match_1;
5206
5222
  var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
5207
- var _match_1, _ref;
5208
5223
  var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
5209
5224
  if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
5210
5225
  rawVal = rawVal.slice(1, -1);
@@ -5563,13 +5578,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5563
5578
  {
5564
5579
  key: "shouldShowNativeControls",
5565
5580
  value: function shouldShowNativeControls() {
5581
+ var _this_config_showCustomControls;
5566
5582
  var streamType = this.getStreamType();
5567
5583
  if (streamType === "other") {
5568
- var _this_config_showCustomControls;
5569
- return !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false);
5584
+ var _this_config_showCustomControls1;
5585
+ return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
5570
5586
  }
5571
- var _this_config_showCustomControls1;
5572
- return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
5587
+ return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
5573
5588
  }
5574
5589
  },
5575
5590
  {
@@ -5728,12 +5743,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5728
5743
  continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
5729
5744
  preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
5730
5745
  preloadIma.initialize();
5731
- errorListener = function(payload) {
5746
+ errorListener = function errorListener(payload) {
5732
5747
  hasAdError = true;
5733
5748
  adErrorPayload = payload;
5734
5749
  };
5735
5750
  preloadIma.on("ad_error", errorListener);
5736
- errorListenerCleanup = function() {
5751
+ errorListenerCleanup = function errorListenerCleanup() {
5737
5752
  return preloadIma.off("ad_error", errorListener);
5738
5753
  };
5739
5754
  return [
@@ -5784,7 +5799,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5784
5799
  isReady: true,
5785
5800
  loadPromise: Promise.resolve()
5786
5801
  };
5787
- lateErrorListener = function(payload) {
5802
+ lateErrorListener = function lateErrorListener(payload) {
5788
5803
  var index = _this.preloadPool.findIndex(function(entry) {
5789
5804
  return entry.vastUrl === vastUrl;
5790
5805
  });
@@ -5795,7 +5810,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5795
5810
  }
5796
5811
  try {
5797
5812
  preloadIma.destroy();
5798
- } catch (e) {}
5813
+ } catch (unused) {}
5799
5814
  }
5800
5815
  };
5801
5816
  preloadIma.on("ad_error", lateErrorListener);
@@ -6620,7 +6635,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6620
6635
  10
6621
6636
  ];
6622
6637
  nextAdUrl = this.adRequestQueue.shift();
6623
- if (!nextAdUrl) {
6638
+ if (nextAdUrl == null) {
6624
6639
  return [
6625
6640
  3,
6626
6641
  4
@@ -6806,7 +6821,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6806
6821
  9
6807
6822
  ];
6808
6823
  nextAdUrl = this.adRequestQueue.shift();
6809
- if (!nextAdUrl) {
6824
+ if (nextAdUrl == null) {
6810
6825
  return [
6811
6826
  3,
6812
6827
  3
@@ -7011,11 +7026,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7011
7026
  {
7012
7027
  key: "ensureAdStoppedByTimer",
7013
7028
  value: function ensureAdStoppedByTimer() {
7029
+ var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
7014
7030
  if (!this.inAdBreak) return;
7015
7031
  this.adStopTimerId = void 0;
7016
7032
  var adPlaying = this.ima.isAdPlaying();
7017
7033
  var pendingAds = this.adPodQueue.length > 0;
7018
- var _this_config_adBreakCheckIntervalMs;
7019
7034
  var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
7020
7035
  var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
7021
7036
  var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
@@ -7023,7 +7038,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7023
7038
  if (this.currentAdBreakStartWallClockMs != null) {
7024
7039
  elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
7025
7040
  }
7026
- var _this_expectedAdBreakDurationMs;
7027
7041
  var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
7028
7042
  var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
7029
7043
  var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
@@ -7280,15 +7294,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7280
7294
  9
7281
7295
  ];
7282
7296
  case 9:
7283
- if (this.isTemporaryAdError(playError)) {
7284
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7285
- if (this.config.debugAdTiming) {
7286
- console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7287
- }
7288
- } else {
7289
- this.failedVastUrls.add(vastTagUrl);
7290
- if (this.config.debugAdTiming) {
7291
- console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7297
+ if (vastTagUrl) {
7298
+ if (this.isTemporaryAdError(playError)) {
7299
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7300
+ if (this.config.debugAdTiming) {
7301
+ console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7302
+ }
7303
+ } else {
7304
+ this.failedVastUrls.add(vastTagUrl);
7305
+ if (this.config.debugAdTiming) {
7306
+ console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7307
+ }
7292
7308
  }
7293
7309
  }
7294
7310
  this.clearAdFailsafeTimer();
@@ -7357,15 +7373,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7357
7373
  15
7358
7374
  ];
7359
7375
  case 15:
7360
- if (this.isTemporaryAdError(error)) {
7361
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7362
- if (this.config.debugAdTiming) {
7363
- console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7364
- }
7365
- } else {
7366
- this.failedVastUrls.add(vastTagUrl);
7367
- if (this.config.debugAdTiming) {
7368
- console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7376
+ if (vastTagUrl) {
7377
+ if (this.isTemporaryAdError(error)) {
7378
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7379
+ if (this.config.debugAdTiming) {
7380
+ console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7381
+ }
7382
+ } else {
7383
+ this.failedVastUrls.add(vastTagUrl);
7384
+ if (this.config.debugAdTiming) {
7385
+ console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7386
+ }
7369
7387
  }
7370
7388
  }
7371
7389
  this.clearAdRequestWatchdog();
@@ -7468,8 +7486,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7468
7486
  key: "startAdRequestWatchdog",
7469
7487
  value: function startAdRequestWatchdog(token) {
7470
7488
  var _this = this;
7471
- this.clearAdRequestWatchdog();
7472
7489
  var _this_config_adFailsafeTimeoutMs;
7490
+ this.clearAdRequestWatchdog();
7473
7491
  var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7474
7492
  this.adRequestWatchdogToken = token;
7475
7493
  this.adRequestWatchdogId = window.setTimeout(function() {
@@ -7512,8 +7530,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7512
7530
  key: "startAdFailsafeTimer",
7513
7531
  value: function startAdFailsafeTimer(token) {
7514
7532
  var _this = this;
7515
- this.clearAdFailsafeTimer();
7516
7533
  var _this_config_adFailsafeTimeoutMs;
7534
+ this.clearAdFailsafeTimer();
7517
7535
  var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7518
7536
  this.adFailsafeToken = token;
7519
7537
  this.adFailsafeTimerId = window.setTimeout(function() {
@@ -7894,21 +7912,21 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7894
7912
  var _import_react_default_useState14 = _sliced_to_array(import_react.default.useState(false), 2), showLicenseWarning = _import_react_default_useState14[0], setShowLicenseWarning = _import_react_default_useState14[1];
7895
7913
  var _import_react_default_useState15 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react_default_useState15[0], setViewportWidth = _import_react_default_useState15[1];
7896
7914
  var _import_react_default_useState16 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react_default_useState16[0], setIsPortrait = _import_react_default_useState16[1];
7897
- var getResponsiveScale = function() {
7915
+ var getResponsiveScale = function getResponsiveScale() {
7898
7916
  if (viewportWidth < 480) return 0.7;
7899
7917
  if (viewportWidth < 768) return 0.8;
7900
7918
  if (viewportWidth < 1024) return 0.9;
7901
7919
  return 1;
7902
7920
  };
7903
7921
  var responsiveScale = getResponsiveScale();
7904
- var formatTime = function(seconds) {
7922
+ var formatTime = function formatTime(seconds) {
7905
7923
  if (!isFinite(seconds)) return "0:00:00";
7906
7924
  var hours = Math.floor(seconds / 3600);
7907
7925
  var minutes = Math.floor(seconds % 3600 / 60);
7908
7926
  var remainingSeconds = Math.floor(seconds % 60);
7909
7927
  return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
7910
7928
  };
7911
- var handlePlayPause = function() {
7929
+ var handlePlayPause = function handlePlayPause() {
7912
7930
  if (videoRef.current) {
7913
7931
  if (videoRef.current.paused) {
7914
7932
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
@@ -7927,7 +7945,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7927
7945
  }
7928
7946
  }
7929
7947
  };
7930
- var handleCenterPlayClick = function() {
7948
+ var handleCenterPlayClick = function handleCenterPlayClick() {
7931
7949
  if (videoRef.current && videoRef.current.paused) {
7932
7950
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
7933
7951
  if (hasValidSource) {
@@ -7941,7 +7959,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7941
7959
  }
7942
7960
  }
7943
7961
  };
7944
- var handleTimelineSeek = function(e) {
7962
+ var handleTimelineSeek = function handleTimelineSeek(e) {
7945
7963
  if (videoRef.current && duration > 0 && isFinite(duration)) {
7946
7964
  var rect = e.currentTarget.getBoundingClientRect();
7947
7965
  var clickX = e.clientX - rect.left;
@@ -7952,13 +7970,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7952
7970
  }
7953
7971
  }
7954
7972
  };
7955
- var handleVolumeChange = function(newVolume) {
7973
+ var handleVolumeChange = function handleVolumeChange(newVolume) {
7956
7974
  if (playerRef.current && isFinite(newVolume)) {
7957
7975
  var clampedVolume = Math.max(0, Math.min(1, newVolume));
7958
7976
  playerRef.current.setVolume(clampedVolume);
7959
7977
  }
7960
7978
  };
7961
- var handlePlaybackRateChange = function(rate) {
7979
+ var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
7962
7980
  if (videoRef.current && isFinite(rate) && rate > 0) {
7963
7981
  videoRef.current.playbackRate = rate;
7964
7982
  }
@@ -7996,7 +8014,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7996
8014
  if (playerRef.current) {
7997
8015
  try {
7998
8016
  playerRef.current.destroy();
7999
- } catch (e) {}
8017
+ } catch (unused) {}
8000
8018
  playerRef.current = null;
8001
8019
  }
8002
8020
  var cfg = {
@@ -8036,7 +8054,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8036
8054
  return function() {
8037
8055
  try {
8038
8056
  player.destroy();
8039
- } catch (e) {}
8057
+ } catch (unused) {}
8040
8058
  playerRef.current = null;
8041
8059
  };
8042
8060
  }, [
@@ -8060,7 +8078,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8060
8078
  ]);
8061
8079
  (0, import_react.useEffect)(function() {
8062
8080
  if (!playerRef.current) return;
8063
- var checkAdStatus = function() {
8081
+ var checkAdStatus = function checkAdStatus() {
8064
8082
  if (playerRef.current) {
8065
8083
  var _videoRef_current_dataset, _videoRef_current;
8066
8084
  var showAdsFromMethod = playerRef.current.isShowingAds();
@@ -8090,7 +8108,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8090
8108
  }, []);
8091
8109
  (0, import_react.useEffect)(function() {
8092
8110
  if (typeof window === "undefined" || !playerRef.current) return;
8093
- var handleResize = function() {
8111
+ var handleResize = function handleResize() {
8094
8112
  if (playerRef.current && videoRef.current) {
8095
8113
  if (typeof playerRef.current.resize === "function") {
8096
8114
  playerRef.current.resize();
@@ -8106,7 +8124,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8106
8124
  }, []);
8107
8125
  (0, import_react.useEffect)(function() {
8108
8126
  if (!playerRef.current || !videoRef.current) return;
8109
- var updateStates = function() {
8127
+ var updateStates = function updateStates() {
8110
8128
  var _videoRef_current;
8111
8129
  if (playerRef.current && videoRef.current) {
8112
8130
  setIsMuted(playerRef.current.isMuted());
@@ -8123,7 +8141,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8123
8141
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8124
8142
  };
8125
8143
  var interval = setInterval(updateStates, 200);
8126
- var handleFullscreenChange = function() {
8144
+ var handleFullscreenChange = function handleFullscreenChange() {
8127
8145
  var _videoRef_current;
8128
8146
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8129
8147
  };
@@ -8135,7 +8153,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8135
8153
  }, []);
8136
8154
  (0, import_react.useEffect)(function() {
8137
8155
  if (!videoRef.current) return;
8138
- var handleLoadedMetadata = function() {
8156
+ var handleLoadedMetadata = function handleLoadedMetadata() {
8139
8157
  if (videoRef.current) {
8140
8158
  var video2 = videoRef.current;
8141
8159
  void video2.offsetHeight;
@@ -8145,19 +8163,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8145
8163
  console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8146
8164
  }
8147
8165
  };
8148
- var handleLoadedData = function() {
8166
+ var handleLoadedData = function handleLoadedData() {
8149
8167
  if (debugAdTiming) {
8150
8168
  var _videoRef_current;
8151
8169
  console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8152
8170
  }
8153
8171
  };
8154
- var handleLoadStart = function() {
8172
+ var handleLoadStart = function handleLoadStart() {
8155
8173
  if (debugAdTiming) {
8156
8174
  var _videoRef_current;
8157
8175
  console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8158
8176
  }
8159
8177
  };
8160
- var handleCanPlay = function() {
8178
+ var handleCanPlay = function handleCanPlay() {
8161
8179
  setIsLoading(false);
8162
8180
  if (bufferingTimeoutRef.current) {
8163
8181
  clearTimeout(bufferingTimeoutRef.current);
@@ -8169,7 +8187,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8169
8187
  console.log("[StormcloudUI] Video event: canplay, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- clearing loading state, isLoading=false");
8170
8188
  }
8171
8189
  };
8172
- var handleCanPlayThrough = function() {
8190
+ var handleCanPlayThrough = function handleCanPlayThrough() {
8173
8191
  setIsLoading(false);
8174
8192
  if (bufferingTimeoutRef.current) {
8175
8193
  clearTimeout(bufferingTimeoutRef.current);
@@ -8181,7 +8199,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8181
8199
  console.log("[StormcloudUI] Video event: canplaythrough, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- clearing loading state, isLoading=false");
8182
8200
  }
8183
8201
  };
8184
- var handleWaiting = function() {
8202
+ var handleWaiting = function handleWaiting() {
8185
8203
  if (bufferingTimeoutRef.current) {
8186
8204
  clearTimeout(bufferingTimeoutRef.current);
8187
8205
  }
@@ -8197,7 +8215,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8197
8215
  console.log("[StormcloudUI] Video event: waiting, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- buffering delay started (300ms)");
8198
8216
  }
8199
8217
  };
8200
- var handlePlaying = function() {
8218
+ var handlePlaying = function handlePlaying() {
8201
8219
  setIsLoading(false);
8202
8220
  if (bufferingTimeoutRef.current) {
8203
8221
  clearTimeout(bufferingTimeoutRef.current);
@@ -8210,7 +8228,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8210
8228
  console.log("[StormcloudUI] Video event: playing, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- playback started, isLoading=false, isBuffering=false");
8211
8229
  }
8212
8230
  };
8213
- var handlePause = function() {
8231
+ var handlePause = function handlePause() {
8214
8232
  var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
8215
8233
  var isAdActive = ((_playerRef_current = playerRef.current) === null || _playerRef_current === void 0 ? void 0 : _playerRef_current.isShowingAds()) || ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : (_videoRef_current_dataset = _videoRef_current.dataset) === null || _videoRef_current_dataset === void 0 ? void 0 : _videoRef_current_dataset.stormcloudAdPlaying) === "true";
8216
8234
  if (playerRef.current && !isAdActive) {
@@ -8219,7 +8237,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8219
8237
  setShowCenterPlay(false);
8220
8238
  }
8221
8239
  };
8222
- var handleEnded = function() {
8240
+ var handleEnded = function handleEnded() {
8223
8241
  setShowCenterPlay(true);
8224
8242
  };
8225
8243
  var video = videoRef.current;
@@ -8377,14 +8395,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8377
8395
  boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
8378
8396
  transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
8379
8397
  },
8380
- onMouseEnter: function(e) {
8398
+ onMouseEnter: function onMouseEnter(e) {
8381
8399
  var target = e.currentTarget;
8382
8400
  target.style.transform = "translate(-50%, -50%)";
8383
8401
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
8384
8402
  target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8385
8403
  target.style.borderColor = "rgba(255, 255, 255, 0.9)";
8386
8404
  },
8387
- onMouseLeave: function(e) {
8405
+ onMouseLeave: function onMouseLeave(e) {
8388
8406
  var target = e.currentTarget;
8389
8407
  target.style.transform = "translate(-50%, -50%)";
8390
8408
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
@@ -8491,12 +8509,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8491
8509
  minWidth: "".concat(48 * responsiveScale, "px"),
8492
8510
  minHeight: "".concat(48 * responsiveScale, "px")
8493
8511
  },
8494
- onMouseEnter: function(e) {
8512
+ onMouseEnter: function onMouseEnter(e) {
8495
8513
  var target = e.target;
8496
8514
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8497
8515
  target.style.boxShadow = "0 12px 48px rgba(0, 0, 0, 0.6), 0 6px 24px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8498
8516
  },
8499
- onMouseLeave: function(e) {
8517
+ onMouseLeave: function onMouseLeave(e) {
8500
8518
  var target = e.target;
8501
8519
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8502
8520
  target.style.boxShadow = "0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
@@ -8522,15 +8540,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8522
8540
  padding: "8px",
8523
8541
  margin: "-8px"
8524
8542
  },
8525
- onMouseEnter: function() {
8543
+ onMouseEnter: function onMouseEnter() {
8526
8544
  return setShowVolumeSlider(true);
8527
8545
  },
8528
- onMouseLeave: function() {
8546
+ onMouseLeave: function onMouseLeave() {
8529
8547
  return setShowVolumeSlider(false);
8530
8548
  },
8531
8549
  children: [
8532
8550
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8533
- onClick: function() {
8551
+ onClick: function onClick() {
8534
8552
  if (playerRef.current) {
8535
8553
  playerRef.current.toggleMute();
8536
8554
  }
@@ -8554,12 +8572,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8554
8572
  minWidth: "".concat(44 * responsiveScale, "px"),
8555
8573
  minHeight: "".concat(44 * responsiveScale, "px")
8556
8574
  },
8557
- onMouseEnter: function(e) {
8575
+ onMouseEnter: function onMouseEnter(e) {
8558
8576
  var target = e.target;
8559
8577
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8560
8578
  target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
8561
8579
  },
8562
- onMouseLeave: function(e) {
8580
+ onMouseLeave: function onMouseLeave(e) {
8563
8581
  var target = e.target;
8564
8582
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8565
8583
  target.style.boxShadow = "0 6px 28px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
@@ -8595,10 +8613,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8595
8613
  marginBottom: "-16px",
8596
8614
  zIndex: 9
8597
8615
  },
8598
- onMouseEnter: function() {
8616
+ onMouseEnter: function onMouseEnter() {
8599
8617
  return setShowVolumeSlider(true);
8600
8618
  },
8601
- onMouseLeave: function() {
8619
+ onMouseLeave: function onMouseLeave() {
8602
8620
  return setShowVolumeSlider(false);
8603
8621
  }
8604
8622
  }),
@@ -8623,12 +8641,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8623
8641
  zIndex: 10,
8624
8642
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8625
8643
  },
8626
- onMouseEnter: function(e) {
8644
+ onMouseEnter: function onMouseEnter(e) {
8627
8645
  setShowVolumeSlider(true);
8628
8646
  e.currentTarget.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 24px rgba(59, 130, 246, 0.3)";
8629
8647
  e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
8630
8648
  },
8631
- onMouseLeave: function(e) {
8649
+ onMouseLeave: function onMouseLeave(e) {
8632
8650
  setShowVolumeSlider(false);
8633
8651
  e.currentTarget.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)";
8634
8652
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
@@ -8641,19 +8659,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8641
8659
  cursor: "pointer",
8642
8660
  transition: "transform 0.2s ease-in-out"
8643
8661
  },
8644
- onMouseEnter: function(e) {},
8645
- onMouseLeave: function(e) {},
8646
- onMouseDown: function(e) {
8662
+ onMouseEnter: function onMouseEnter(e) {},
8663
+ onMouseLeave: function onMouseLeave(e) {},
8664
+ onMouseDown: function onMouseDown(e) {
8647
8665
  e.preventDefault();
8648
8666
  var sliderElement = e.currentTarget;
8649
- var handleMouseMove = function(moveEvent) {
8667
+ var handleMouseMove = function handleMouseMove(moveEvent) {
8650
8668
  if (!sliderElement) return;
8651
8669
  var rect2 = sliderElement.getBoundingClientRect();
8652
8670
  var y2 = moveEvent.clientY - rect2.top;
8653
8671
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8654
8672
  handleVolumeChange(percentage2);
8655
8673
  };
8656
- var handleMouseUp = function() {
8674
+ var handleMouseUp = function handleMouseUp1() {
8657
8675
  document.removeEventListener("mousemove", handleMouseMove);
8658
8676
  document.removeEventListener("mouseup", handleMouseUp);
8659
8677
  };
@@ -8664,7 +8682,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8664
8682
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8665
8683
  handleVolumeChange(percentage);
8666
8684
  },
8667
- onClick: function(e) {
8685
+ onClick: function onClick(e) {
8668
8686
  e.stopPropagation();
8669
8687
  var rect = e.currentTarget.getBoundingClientRect();
8670
8688
  var y = e.clientY - rect.top;
@@ -8711,17 +8729,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8711
8729
  transition: "bottom 0.15s ease-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out",
8712
8730
  cursor: "grab"
8713
8731
  },
8714
- onMouseEnter: function(e) {
8732
+ onMouseEnter: function onMouseEnter(e) {
8715
8733
  e.currentTarget.style.boxShadow = "0 3px 10px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.6)";
8716
8734
  e.currentTarget.style.cursor = "grab";
8717
8735
  },
8718
- onMouseLeave: function(e) {
8736
+ onMouseLeave: function onMouseLeave(e) {
8719
8737
  e.currentTarget.style.boxShadow = "0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(59, 130, 246, 0.3), 0 0 12px rgba(59, 130, 246, 0.4)";
8720
8738
  },
8721
- onMouseDown: function(e) {
8739
+ onMouseDown: function onMouseDown(e) {
8722
8740
  e.currentTarget.style.cursor = "grabbing";
8723
8741
  },
8724
- onMouseUp: function(e) {
8742
+ onMouseUp: function onMouseUp(e) {
8725
8743
  e.currentTarget.style.cursor = "grab";
8726
8744
  }
8727
8745
  })
@@ -8761,7 +8779,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8761
8779
  },
8762
8780
  children: [
8763
8781
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8764
- onClick: function() {
8782
+ onClick: function onClick() {
8765
8783
  return setShowSpeedMenu(!showSpeedMenu);
8766
8784
  },
8767
8785
  style: {
@@ -8780,12 +8798,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8780
8798
  minWidth: "".concat(56 * responsiveScale, "px"),
8781
8799
  minHeight: "".concat(40 * responsiveScale, "px")
8782
8800
  },
8783
- onMouseEnter: function(e) {
8801
+ onMouseEnter: function onMouseEnter(e) {
8784
8802
  var target = e.target;
8785
8803
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8786
8804
  target.style.boxShadow = "0 10px 32px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
8787
8805
  },
8788
- onMouseLeave: function(e) {
8806
+ onMouseLeave: function onMouseLeave(e) {
8789
8807
  var target = e.target;
8790
8808
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8791
8809
  target.style.boxShadow = "0 6px 24px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
@@ -8821,7 +8839,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8821
8839
  2
8822
8840
  ].map(function(speed) {
8823
8841
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8824
- onClick: function() {
8842
+ onClick: function onClick() {
8825
8843
  return handlePlaybackRateChange(speed);
8826
8844
  },
8827
8845
  style: {
@@ -8839,12 +8857,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8839
8857
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8840
8858
  borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
8841
8859
  },
8842
- onMouseEnter: function(e) {
8860
+ onMouseEnter: function onMouseEnter(e) {
8843
8861
  if (playbackRate !== speed) {
8844
8862
  e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
8845
8863
  }
8846
8864
  },
8847
- onMouseLeave: function(e) {
8865
+ onMouseLeave: function onMouseLeave(e) {
8848
8866
  if (playbackRate !== speed) {
8849
8867
  e.target.style.background = "transparent";
8850
8868
  }
@@ -8859,7 +8877,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8859
8877
  ]
8860
8878
  }),
8861
8879
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8862
- onClick: function() {
8880
+ onClick: function onClick() {
8863
8881
  if (onFullscreenToggle) {
8864
8882
  onFullscreenToggle();
8865
8883
  } else if (playerRef.current) {
@@ -8884,12 +8902,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8884
8902
  minWidth: "".concat(44 * responsiveScale, "px"),
8885
8903
  minHeight: "".concat(44 * responsiveScale, "px")
8886
8904
  },
8887
- onMouseEnter: function(e) {
8905
+ onMouseEnter: function onMouseEnter(e) {
8888
8906
  var target = e.target;
8889
8907
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8890
8908
  target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
8891
8909
  },
8892
- onMouseLeave: function(e) {
8910
+ onMouseLeave: function onMouseLeave(e) {
8893
8911
  var target = e.target;
8894
8912
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8895
8913
  target.style.boxShadow = "0 6px 28px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
@@ -8933,15 +8951,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8933
8951
  padding: "8px",
8934
8952
  margin: "-8px"
8935
8953
  },
8936
- onMouseEnter: function() {
8954
+ onMouseEnter: function onMouseEnter() {
8937
8955
  return setShowVolumeSlider(true);
8938
8956
  },
8939
- onMouseLeave: function() {
8957
+ onMouseLeave: function onMouseLeave() {
8940
8958
  return setShowVolumeSlider(false);
8941
8959
  },
8942
8960
  children: [
8943
8961
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8944
- onClick: function() {
8962
+ onClick: function onClick() {
8945
8963
  if (playerRef.current) {
8946
8964
  playerRef.current.toggleMute();
8947
8965
  }
@@ -8949,12 +8967,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8949
8967
  onVolumeToggle();
8950
8968
  }
8951
8969
  },
8952
- onMouseEnter: function(e) {
8970
+ onMouseEnter: function onMouseEnter(e) {
8953
8971
  var target = e.currentTarget;
8954
8972
  target.style.boxShadow = "0 14px 48px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 255, 255, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8955
8973
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8956
8974
  },
8957
- onMouseLeave: function(e) {
8975
+ onMouseLeave: function onMouseLeave(e) {
8958
8976
  var target = e.currentTarget;
8959
8977
  target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
8960
8978
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9009,10 +9027,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9009
9027
  marginBottom: "-16px",
9010
9028
  zIndex: 9
9011
9029
  },
9012
- onMouseEnter: function() {
9030
+ onMouseEnter: function onMouseEnter() {
9013
9031
  return setShowVolumeSlider(true);
9014
9032
  },
9015
- onMouseLeave: function() {
9033
+ onMouseLeave: function onMouseLeave() {
9016
9034
  return setShowVolumeSlider(false);
9017
9035
  }
9018
9036
  }),
@@ -9037,12 +9055,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9037
9055
  zIndex: 10,
9038
9056
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
9039
9057
  },
9040
- onMouseEnter: function(e) {
9058
+ onMouseEnter: function onMouseEnter(e) {
9041
9059
  setShowVolumeSlider(true);
9042
9060
  e.currentTarget.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), 0 6px 16px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 24px rgba(96, 165, 250, 0.4)";
9043
9061
  e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
9044
9062
  },
9045
- onMouseLeave: function(e) {
9063
+ onMouseLeave: function onMouseLeave(e) {
9046
9064
  setShowVolumeSlider(false);
9047
9065
  e.currentTarget.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.85), 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35)";
9048
9066
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
@@ -9055,17 +9073,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9055
9073
  cursor: "pointer",
9056
9074
  transition: "transform 0.2s ease-in-out"
9057
9075
  },
9058
- onMouseDown: function(e) {
9076
+ onMouseDown: function onMouseDown(e) {
9059
9077
  e.preventDefault();
9060
9078
  var sliderElement = e.currentTarget;
9061
- var handleMouseMove = function(moveEvent) {
9079
+ var handleMouseMove = function handleMouseMove(moveEvent) {
9062
9080
  if (!sliderElement) return;
9063
9081
  var rect2 = sliderElement.getBoundingClientRect();
9064
9082
  var y2 = moveEvent.clientY - rect2.top;
9065
9083
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
9066
9084
  handleVolumeChange(percentage2);
9067
9085
  };
9068
- var handleMouseUp = function() {
9086
+ var handleMouseUp = function handleMouseUp1() {
9069
9087
  document.removeEventListener("mousemove", handleMouseMove);
9070
9088
  document.removeEventListener("mouseup", handleMouseUp);
9071
9089
  };
@@ -9076,7 +9094,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9076
9094
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
9077
9095
  handleVolumeChange(percentage);
9078
9096
  },
9079
- onClick: function(e) {
9097
+ onClick: function onClick(e) {
9080
9098
  e.stopPropagation();
9081
9099
  var rect = e.currentTarget.getBoundingClientRect();
9082
9100
  var y = e.clientY - rect.top;
@@ -9125,17 +9143,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9125
9143
  transition: "bottom 0.15s ease-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out",
9126
9144
  cursor: "grab"
9127
9145
  },
9128
- onMouseEnter: function(e) {
9146
+ onMouseEnter: function onMouseEnter(e) {
9129
9147
  e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(96, 165, 250, 0.6), 0 0 24px rgba(96, 165, 250, 0.7)";
9130
9148
  e.currentTarget.style.cursor = "grab";
9131
9149
  },
9132
- onMouseLeave: function(e) {
9150
+ onMouseLeave: function onMouseLeave(e) {
9133
9151
  e.currentTarget.style.boxShadow = "0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(96, 165, 250, 0.4), 0 0 16px rgba(96, 165, 250, 0.5)";
9134
9152
  },
9135
- onMouseDown: function(e) {
9153
+ onMouseDown: function onMouseDown(e) {
9136
9154
  e.currentTarget.style.cursor = "grabbing";
9137
9155
  },
9138
- onMouseUp: function(e) {
9156
+ onMouseUp: function onMouseUp(e) {
9139
9157
  e.currentTarget.style.cursor = "grab";
9140
9158
  }
9141
9159
  })
@@ -9147,7 +9165,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9147
9165
  ]
9148
9166
  }),
9149
9167
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9150
- onClick: function() {
9168
+ onClick: function onClick() {
9151
9169
  if (onFullscreenToggle) {
9152
9170
  onFullscreenToggle();
9153
9171
  } else if (playerRef.current) {
@@ -9156,12 +9174,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9156
9174
  });
9157
9175
  }
9158
9176
  },
9159
- onMouseEnter: function(e) {
9177
+ onMouseEnter: function onMouseEnter(e) {
9160
9178
  var target = e.currentTarget;
9161
9179
  target.style.boxShadow = "0 14px 48px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 255, 255, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
9162
9180
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9163
9181
  },
9164
- onMouseLeave: function(e) {
9182
+ onMouseLeave: function onMouseLeave(e) {
9165
9183
  var target = e.currentTarget;
9166
9184
  target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
9167
9185
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";