stormcloud-video-player 0.5.2 → 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.
Files changed (43) hide show
  1. package/dist/stormcloud-vp.min.js +1 -1
  2. package/lib/index.cjs +370 -447
  3. package/lib/index.cjs.map +1 -1
  4. package/lib/index.d.cts +355 -267
  5. package/lib/index.d.ts +355 -267
  6. package/lib/index.js +329 -406
  7. package/lib/index.js.map +1 -1
  8. package/lib/player/StormcloudVideoPlayer.cjs +96 -178
  9. package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
  10. package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
  11. package/lib/players/FilePlayer.cjs +99 -116
  12. package/lib/players/FilePlayer.cjs.map +1 -1
  13. package/lib/players/HlsPlayer.cjs +148 -230
  14. package/lib/players/HlsPlayer.cjs.map +1 -1
  15. package/lib/players/HlsPlayer.d.cts +1 -1
  16. package/lib/players/index.cjs +227 -309
  17. package/lib/players/index.cjs.map +1 -1
  18. package/lib/sdk/hlsAdPlayer.cjs +17 -9
  19. package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
  20. package/lib/sdk/hlsAdPlayer.d.cts +1 -1
  21. package/lib/sdk/ima.cjs +28 -20
  22. package/lib/sdk/ima.cjs.map +1 -1
  23. package/lib/sdk/ima.d.cts +1 -1
  24. package/lib/sdk/prebid.cjs +27 -85
  25. package/lib/sdk/prebid.cjs.map +1 -1
  26. package/lib/sdk/prebid.d.cts +6 -3
  27. package/lib/sdk/prebidController.cjs +35 -108
  28. package/lib/sdk/prebidController.cjs.map +1 -1
  29. package/lib/sdk/prebidController.d.cts +3 -2
  30. package/lib/sdk/vastParser.cjs +19 -11
  31. package/lib/sdk/vastParser.cjs.map +1 -1
  32. package/lib/{types-g2d4Akez.d.cts → types-CRi_KrjM.d.cts} +1 -45
  33. package/lib/ui/StormcloudVideoPlayer.cjs +190 -267
  34. package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
  35. package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
  36. package/lib/utils/browserCompat.cjs +11 -11
  37. package/lib/utils/browserCompat.cjs.map +1 -1
  38. package/lib/utils/polyfills.cjs +13 -13
  39. package/lib/utils/polyfills.cjs.map +1 -1
  40. package/lib/utils/tracking.cjs +19 -11
  41. package/lib/utils/tracking.cjs.map +1 -1
  42. package/lib/utils/tracking.d.cts +1 -1
  43. package/package.json +1 -1
@@ -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() {
@@ -2452,12 +2469,12 @@ function createHlsAdPlayer(contentVideo, options) {
2452
2469
  }
2453
2470
  // src/sdk/prebid.ts
2454
2471
  var DEFAULT_TIMEOUT_MS = 3e3;
2455
- var AUCTION_PATH = "/openrtb2/auction";
2456
- function createPrebidManager(config) {
2472
+ var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
2473
+ function createPrebidManager() {
2474
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2475
+ var _options_debug;
2457
2476
  var initialized = false;
2458
- var serverUrl = "";
2459
- var _config_debug;
2460
- var debug = (_config_debug = config.debug) !== null && _config_debug !== void 0 ? _config_debug : false;
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++){
2463
2480
  args[_key] = arguments[_key];
@@ -2478,49 +2495,6 @@ function createPrebidManager(config) {
2478
2495
  "[Prebid]"
2479
2496
  ].concat(_to_consumable_array(args)));
2480
2497
  }
2481
- function resolveServerUrl() {
2482
- var _config_ortbRequest_ext_prebid_server, _config_ortbRequest_ext_prebid, _config_ortbRequest_ext, _config_ortbRequest;
2483
- if (config.serverUrl) {
2484
- return config.serverUrl.replace(/\/$/, "");
2485
- }
2486
- var extUrl = (_config_ortbRequest = config.ortbRequest) === null || _config_ortbRequest === void 0 ? void 0 : (_config_ortbRequest_ext = _config_ortbRequest.ext) === null || _config_ortbRequest_ext === void 0 ? void 0 : (_config_ortbRequest_ext_prebid = _config_ortbRequest_ext.prebid) === null || _config_ortbRequest_ext_prebid === void 0 ? void 0 : (_config_ortbRequest_ext_prebid_server = _config_ortbRequest_ext_prebid.server) === null || _config_ortbRequest_ext_prebid_server === void 0 ? void 0 : _config_ortbRequest_ext_prebid_server.externalurl;
2487
- if (typeof extUrl === "string" && extUrl.length > 0) {
2488
- return extUrl.replace(/\/$/, "");
2489
- }
2490
- throw new Error("Prebid Server URL not configured. Provide serverUrl in PrebidConfig or ext.prebid.server.externalurl in the OpenRTB request.");
2491
- }
2492
- function buildRequest() {
2493
- var req = JSON.parse(JSON.stringify(config.ortbRequest));
2494
- req.id = "".concat(req.id || "prebid", "-").concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 8));
2495
- if (!req.ext) req.ext = {};
2496
- if (!req.ext.prebid) req.ext.prebid = {};
2497
- if (!req.ext.prebid.cache) req.ext.prebid.cache = {};
2498
- if (!req.ext.prebid.cache.vastxml) req.ext.prebid.cache.vastxml = {};
2499
- if (!req.ext.prebid.targeting) {
2500
- req.ext.prebid.targeting = {
2501
- includewinners: true,
2502
- includebidderkeys: false
2503
- };
2504
- }
2505
- if (!req.device) req.device = {};
2506
- if (typeof navigator !== "undefined") {
2507
- if (!req.device.ua) req.device.ua = navigator.userAgent;
2508
- if (!req.device.language) {
2509
- req.device.language = (navigator.language || "").split("-")[0] || "en";
2510
- }
2511
- }
2512
- if (typeof window !== "undefined") {
2513
- var _window_screen, _window_screen1;
2514
- if (!req.device.w) req.device.w = ((_window_screen = window.screen) === null || _window_screen === void 0 ? void 0 : _window_screen.width) || window.innerWidth;
2515
- if (!req.device.h) req.device.h = ((_window_screen1 = window.screen) === null || _window_screen1 === void 0 ? void 0 : _window_screen1.height) || window.innerHeight;
2516
- }
2517
- if (!req.site) req.site = {};
2518
- if (typeof window !== "undefined") {
2519
- if (!req.site.page) req.site.page = window.location.href;
2520
- if (!req.site.domain) req.site.domain = window.location.hostname;
2521
- }
2522
- return req;
2523
- }
2524
2498
  function parseResponse(data) {
2525
2499
  var bids = [];
2526
2500
  var seatbids = (data === null || data === void 0 ? void 0 : data.seatbid) || [];
@@ -2590,12 +2564,6 @@ function createPrebidManager(config) {
2590
2564
  function extractVastUrl(bids) {
2591
2565
  if (bids.length === 0) return null;
2592
2566
  var winner = bids[0];
2593
- var _config_cpmFloor;
2594
- var cpmFloor = (_config_cpmFloor = config.cpmFloor) !== null && _config_cpmFloor !== void 0 ? _config_cpmFloor : 0;
2595
- if (cpmFloor > 0 && winner.cpm < cpmFloor) {
2596
- log("Winning bid $".concat(winner.cpm.toFixed(2), " below CPM floor $").concat(cpmFloor.toFixed(2), ", rejecting"));
2597
- return null;
2598
- }
2599
2567
  if (winner.vastUrl) {
2600
2568
  log("Using cached VAST URL from ".concat(winner.bidder, " ($").concat(winner.cpm.toFixed(2), " ").concat(winner.currency, ")"));
2601
2569
  return winner.vastUrl;
@@ -2617,22 +2585,12 @@ function createPrebidManager(config) {
2617
2585
  }
2618
2586
  function initialize() {
2619
2587
  return _async_to_generator(function() {
2620
- var _config_ortbRequest;
2621
2588
  return _ts_generator(this, function(_state) {
2622
2589
  if (initialized) return [
2623
2590
  2
2624
2591
  ];
2625
- serverUrl = resolveServerUrl();
2626
- if (!((_config_ortbRequest = config.ortbRequest) === null || _config_ortbRequest === void 0 ? void 0 : _config_ortbRequest.imp) || config.ortbRequest.imp.length === 0) {
2627
- throw new Error("No impressions (imp) defined in the OpenRTB request.");
2628
- }
2629
2592
  initialized = true;
2630
- log("Initialized with server:", serverUrl);
2631
- log("Bidders:", config.ortbRequest.imp.map(function(imp) {
2632
- var _imp_ext_prebid, _imp_ext;
2633
- var bidders = (_imp_ext = imp.ext) === null || _imp_ext === void 0 ? void 0 : (_imp_ext_prebid = _imp_ext.prebid) === null || _imp_ext_prebid === void 0 ? void 0 : _imp_ext_prebid.bidder;
2634
- return bidders ? Object.keys(bidders).join(", ") : "none";
2635
- }).join("; "));
2593
+ log("Initialized, auction URL:", AUCTION_URL);
2636
2594
  return [
2637
2595
  2
2638
2596
  ];
@@ -2641,17 +2599,15 @@ function createPrebidManager(config) {
2641
2599
  }
2642
2600
  function requestBids() {
2643
2601
  return _async_to_generator(function() {
2644
- var auctionUrl, request, _config_timeout, _ref, timeout, controller, timeoutId, _data_ext, _data_ext1, fetchOptions, response, body, data, bids, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, b, error;
2602
+ var timeout, controller, timeoutId, _data_ext, _data_ext1, fetchOptions, response, body, data, bids, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, b, error;
2645
2603
  return _ts_generator(this, function(_state) {
2646
2604
  switch(_state.label){
2647
2605
  case 0:
2648
2606
  if (!initialized) {
2649
2607
  throw new Error("Prebid not initialized. Call initialize() first.");
2650
2608
  }
2651
- auctionUrl = "".concat(serverUrl).concat(AUCTION_PATH);
2652
- request = buildRequest();
2653
- timeout = (_ref = (_config_timeout = config.timeout) !== null && _config_timeout !== void 0 ? _config_timeout : config.ortbRequest.tmax) !== null && _ref !== void 0 ? _ref : DEFAULT_TIMEOUT_MS;
2654
- log("Sending auction request to:", auctionUrl);
2609
+ timeout = DEFAULT_TIMEOUT_MS;
2610
+ log("Fetching auction response from:", AUCTION_URL);
2655
2611
  controller = typeof AbortController !== "undefined" ? new AbortController() : null;
2656
2612
  timeoutId = setTimeout(function() {
2657
2613
  controller === null || controller === void 0 ? void 0 : controller.abort();
@@ -2665,18 +2621,14 @@ function createPrebidManager(config) {
2665
2621
  7
2666
2622
  ]);
2667
2623
  fetchOptions = {
2668
- method: "POST",
2669
- headers: {
2670
- "Content-Type": "application/json"
2671
- },
2672
- body: JSON.stringify(request)
2624
+ method: "POST"
2673
2625
  };
2674
2626
  if (controller) {
2675
2627
  fetchOptions.signal = controller.signal;
2676
2628
  }
2677
2629
  return [
2678
2630
  4,
2679
- fetch(auctionUrl, fetchOptions)
2631
+ fetch(AUCTION_URL, fetchOptions)
2680
2632
  ];
2681
2633
  case 2:
2682
2634
  response = _state.sent();
@@ -2793,7 +2745,6 @@ function createPrebidManager(config) {
2793
2745
  }
2794
2746
  function destroy() {
2795
2747
  initialized = false;
2796
- serverUrl = "";
2797
2748
  log("Destroyed");
2798
2749
  }
2799
2750
  return {
@@ -2809,7 +2760,7 @@ function createPrebidManager(config) {
2809
2760
  // src/sdk/prebidController.ts
2810
2761
  var import_hls2 = __toESM(require("hls.js"), 1);
2811
2762
  var LOG = "[PrebidController]";
2812
- function createPrebidController(contentVideo, prebidConfig, options) {
2763
+ function createPrebidController(contentVideo, options) {
2813
2764
  var adPlaying = false;
2814
2765
  var originalMutedState = false;
2815
2766
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -2823,11 +2774,9 @@ function createPrebidController(contentVideo, prebidConfig, options) {
2823
2774
  var sessionId;
2824
2775
  var destroyed = false;
2825
2776
  var trackingFired = createEmptyTrackingState();
2826
- var _prebidConfig_debug;
2827
- var prebidDebug = (_prebidConfig_debug = prebidConfig.debug) !== null && _prebidConfig_debug !== void 0 ? _prebidConfig_debug : false;
2828
- var prebidManager = createPrebidManager(_object_spread_props(_object_spread({}, prebidConfig), {
2829
- debug: prebidDebug
2830
- }));
2777
+ var prebidManager = createPrebidManager((options === null || options === void 0 ? void 0 : options.debug) !== void 0 ? {
2778
+ debug: options.debug
2779
+ } : {});
2831
2780
  var prebidInitialized = false;
2832
2781
  function emit(event, payload) {
2833
2782
  var set = listeners.get(event);
@@ -3026,6 +2975,8 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3026
2975
  adContainerEl.style.display = "none";
3027
2976
  adContainerEl.style.pointerEvents = "none";
3028
2977
  }
2978
+ contentVideo.style.visibility = "visible";
2979
+ contentVideo.style.opacity = "1";
3029
2980
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
3030
2981
  if (contentVideo.paused) {
3031
2982
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
@@ -3050,19 +3001,12 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3050
3001
  }
3051
3002
  function ensurePrebidInitialized() {
3052
3003
  return _async_to_generator(function() {
3053
- var _prebidConfig_ortbRequest_imp, _prebidConfig_ortbRequest;
3054
3004
  return _ts_generator(this, function(_state) {
3055
3005
  switch(_state.label){
3056
3006
  case 0:
3057
3007
  if (prebidInitialized) return [
3058
3008
  2
3059
3009
  ];
3060
- if (prebidConfig.enabled === false) {
3061
- throw new Error("Prebid is disabled in config");
3062
- }
3063
- if (!((_prebidConfig_ortbRequest = prebidConfig.ortbRequest) === null || _prebidConfig_ortbRequest === void 0 ? void 0 : (_prebidConfig_ortbRequest_imp = _prebidConfig_ortbRequest.imp) === null || _prebidConfig_ortbRequest_imp === void 0 ? void 0 : _prebidConfig_ortbRequest_imp.length)) {
3064
- throw new Error("No impressions configured in ortbRequest");
3065
- }
3066
3010
  return [
3067
3011
  4,
3068
3012
  prebidManager.initialize()
@@ -3080,7 +3024,7 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3080
3024
  }
3081
3025
  function runPrebidAuction() {
3082
3026
  return _async_to_generator(function() {
3083
- var bids, _prebidConfig_cpmFloor, cpmFloor, winner;
3027
+ var bids, winner;
3084
3028
  return _ts_generator(this, function(_state) {
3085
3029
  switch(_state.label){
3086
3030
  case 0:
@@ -3103,15 +3047,7 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3103
3047
  null
3104
3048
  ];
3105
3049
  }
3106
- cpmFloor = (_prebidConfig_cpmFloor = prebidConfig.cpmFloor) !== null && _prebidConfig_cpmFloor !== void 0 ? _prebidConfig_cpmFloor : 0;
3107
3050
  winner = bids[0];
3108
- if (cpmFloor > 0 && winner.cpm < cpmFloor) {
3109
- console.log("".concat(LOG, " Winning bid $").concat(winner.cpm.toFixed(2), " below CPM floor $").concat(cpmFloor.toFixed(2), ", rejecting"));
3110
- return [
3111
- 2,
3112
- null
3113
- ];
3114
- }
3115
3051
  console.log("".concat(LOG, " Winning bid: ").concat(winner.bidder, " $").concat(winner.cpm.toFixed(2), " ").concat(winner.currency));
3116
3052
  if (winner.vastXml) {
3117
3053
  console.log("".concat(LOG, " Parsing VAST XML from bid response (inline)"));
@@ -4216,22 +4152,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4216
4152
  adPlayerType = "hls";
4217
4153
  }
4218
4154
  if (adPlayerType === "prebid") {
4219
- if (!this.config.prebid) {
4220
- console.warn("[StormcloudVideoPlayer] adPlayerType is 'prebid' but no prebid config provided, falling back to HLS ad player");
4221
- return createHlsAdPlayer(this.video, _object_spread({
4222
- continueLiveStreamDuringAds: continueLiveStreamDuringAds
4223
- }, this.config.licenseKey ? {
4224
- licenseKey: this.config.licenseKey
4225
- } : {}, this.hls ? {
4226
- mainHlsInstance: this.hls
4227
- } : {}));
4228
- }
4229
4155
  if (this.config.debugAdTiming) {
4230
4156
  console.log("[StormcloudVideoPlayer] Creating Prebid ad controller (standalone, no IMA SDK)");
4231
4157
  }
4232
- return createPrebidController(this.video, this.config.prebid, _object_spread({
4158
+ return createPrebidController(this.video, _object_spread({
4233
4159
  continueLiveStreamDuringAds: continueLiveStreamDuringAds
4234
- }, this.config.licenseKey ? {
4160
+ }, this.config.debugAdTiming !== void 0 ? {
4161
+ debug: this.config.debugAdTiming
4162
+ } : {}, this.config.licenseKey ? {
4235
4163
  licenseKey: this.config.licenseKey
4236
4164
  } : {}, this.hls ? {
4237
4165
  mainHlsInstance: this.hls
@@ -4357,7 +4285,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4357
4285
  });
4358
4286
  this.hls.on(import_hls3.default.Events.MANIFEST_PARSED, function(_, data) {
4359
4287
  return _async_to_generator(function() {
4360
- 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;
4361
4289
  return _ts_generator(this, function(_state) {
4362
4290
  switch(_state.label){
4363
4291
  case 0:
@@ -4366,10 +4294,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4366
4294
  } else {
4367
4295
  ;
4368
4296
  ;
4369
- 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) {
4370
4298
  var _level_details, _level_details1;
4371
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";
4372
- })) !== null && _this_hls_levels_some !== void 0 ? _this_hls_levels_some : false;
4300
+ })) !== null && _ref !== void 0 ? _ref : false;
4373
4301
  }
4374
4302
  if (this.config.debugAdTiming) {
4375
4303
  adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
@@ -4433,9 +4361,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4433
4361
  var tag = "";
4434
4362
  var value = "";
4435
4363
  if (Array.isArray(entry)) {
4436
- var _entry_;
4364
+ var _entry_, _entry_1;
4437
4365
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4438
- var _entry_1;
4439
4366
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4440
4367
  } else if (typeof entry === "string") {
4441
4368
  var idx = entry.indexOf(":");
@@ -4558,9 +4485,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4558
4485
  var tag = "";
4559
4486
  var value = "";
4560
4487
  if (Array.isArray(entry)) {
4561
- var _entry_;
4488
+ var _entry_, _entry_1;
4562
4489
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4563
- var _entry_1;
4564
4490
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4565
4491
  } else if (typeof entry === "string") {
4566
4492
  var idx = entry.indexOf(":");
@@ -4610,10 +4536,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4610
4536
  }
4611
4537
  });
4612
4538
  } else if (tag.includes("EXT-X-DATERANGE")) {
4539
+ var _attrs_CLASS;
4613
4540
  var attrs = _this.parseAttributeList(value);
4614
4541
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4615
4542
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4616
- var _attrs_CLASS;
4617
4543
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4618
4544
  var duration = _this.toNumber(attrs["DURATION"]);
4619
4545
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5015,11 +4941,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5015
4941
  }
5016
4942
  var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
5017
4943
  if (daterangeMatch) {
5018
- var _daterangeMatch_;
4944
+ var _daterangeMatch_, _attrs_CLASS;
5019
4945
  var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
5020
4946
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
5021
4947
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
5022
- var _attrs_CLASS;
5023
4948
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
5024
4949
  var duration = this.toNumber(attrs["DURATION"]);
5025
4950
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5095,7 +5020,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5095
5020
  var out = "";
5096
5021
  for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
5097
5022
  return out;
5098
- } catch (e) {
5023
+ } catch (unused) {
5099
5024
  return void 0;
5100
5025
  }
5101
5026
  }
@@ -5114,6 +5039,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5114
5039
  });
5115
5040
  }
5116
5041
  if (marker.type === "start") {
5042
+ var _this_config_immediateManifestAds;
5117
5043
  var _this_pendingAdBreak;
5118
5044
  if (!this.video.muted) {
5119
5045
  this.video.muted = true;
@@ -5138,7 +5064,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5138
5064
  this.expectedAdBreakDurationMs = durationMs;
5139
5065
  this.currentAdBreakStartWallClockMs = Date.now();
5140
5066
  var isManifestMarker = this.isManifestBasedMarker(marker);
5141
- var _this_config_immediateManifestAds;
5142
5067
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
5143
5068
  if (this.config.debugAdTiming) {
5144
5069
  console.log("[StormcloudVideoPlayer] Ad start decision:", {
@@ -5293,9 +5218,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5293
5218
  var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
5294
5219
  var match;
5295
5220
  while((match = regex.exec(value)) !== null){
5296
- var _match_;
5221
+ var _match_, _ref, _match_1;
5297
5222
  var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
5298
- var _match_1, _ref;
5299
5223
  var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
5300
5224
  if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
5301
5225
  rawVal = rawVal.slice(1, -1);
@@ -5654,13 +5578,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5654
5578
  {
5655
5579
  key: "shouldShowNativeControls",
5656
5580
  value: function shouldShowNativeControls() {
5581
+ var _this_config_showCustomControls;
5657
5582
  var streamType = this.getStreamType();
5658
5583
  if (streamType === "other") {
5659
- var _this_config_showCustomControls;
5660
- 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);
5661
5586
  }
5662
- var _this_config_showCustomControls1;
5663
- 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));
5664
5588
  }
5665
5589
  },
5666
5590
  {
@@ -5819,12 +5743,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5819
5743
  continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
5820
5744
  preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
5821
5745
  preloadIma.initialize();
5822
- errorListener = function(payload) {
5746
+ errorListener = function errorListener(payload) {
5823
5747
  hasAdError = true;
5824
5748
  adErrorPayload = payload;
5825
5749
  };
5826
5750
  preloadIma.on("ad_error", errorListener);
5827
- errorListenerCleanup = function() {
5751
+ errorListenerCleanup = function errorListenerCleanup() {
5828
5752
  return preloadIma.off("ad_error", errorListener);
5829
5753
  };
5830
5754
  return [
@@ -5875,7 +5799,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5875
5799
  isReady: true,
5876
5800
  loadPromise: Promise.resolve()
5877
5801
  };
5878
- lateErrorListener = function(payload) {
5802
+ lateErrorListener = function lateErrorListener(payload) {
5879
5803
  var index = _this.preloadPool.findIndex(function(entry) {
5880
5804
  return entry.vastUrl === vastUrl;
5881
5805
  });
@@ -5886,7 +5810,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5886
5810
  }
5887
5811
  try {
5888
5812
  preloadIma.destroy();
5889
- } catch (e) {}
5813
+ } catch (unused) {}
5890
5814
  }
5891
5815
  };
5892
5816
  preloadIma.on("ad_error", lateErrorListener);
@@ -6711,7 +6635,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6711
6635
  10
6712
6636
  ];
6713
6637
  nextAdUrl = this.adRequestQueue.shift();
6714
- if (!nextAdUrl) {
6638
+ if (nextAdUrl == null) {
6715
6639
  return [
6716
6640
  3,
6717
6641
  4
@@ -6897,7 +6821,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6897
6821
  9
6898
6822
  ];
6899
6823
  nextAdUrl = this.adRequestQueue.shift();
6900
- if (!nextAdUrl) {
6824
+ if (nextAdUrl == null) {
6901
6825
  return [
6902
6826
  3,
6903
6827
  3
@@ -7102,11 +7026,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7102
7026
  {
7103
7027
  key: "ensureAdStoppedByTimer",
7104
7028
  value: function ensureAdStoppedByTimer() {
7029
+ var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
7105
7030
  if (!this.inAdBreak) return;
7106
7031
  this.adStopTimerId = void 0;
7107
7032
  var adPlaying = this.ima.isAdPlaying();
7108
7033
  var pendingAds = this.adPodQueue.length > 0;
7109
- var _this_config_adBreakCheckIntervalMs;
7110
7034
  var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
7111
7035
  var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
7112
7036
  var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
@@ -7114,7 +7038,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7114
7038
  if (this.currentAdBreakStartWallClockMs != null) {
7115
7039
  elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
7116
7040
  }
7117
- var _this_expectedAdBreakDurationMs;
7118
7041
  var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
7119
7042
  var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
7120
7043
  var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
@@ -7371,15 +7294,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7371
7294
  9
7372
7295
  ];
7373
7296
  case 9:
7374
- if (this.isTemporaryAdError(playError)) {
7375
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7376
- if (this.config.debugAdTiming) {
7377
- console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7378
- }
7379
- } else {
7380
- this.failedVastUrls.add(vastTagUrl);
7381
- if (this.config.debugAdTiming) {
7382
- 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
+ }
7383
7308
  }
7384
7309
  }
7385
7310
  this.clearAdFailsafeTimer();
@@ -7448,15 +7373,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7448
7373
  15
7449
7374
  ];
7450
7375
  case 15:
7451
- if (this.isTemporaryAdError(error)) {
7452
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7453
- if (this.config.debugAdTiming) {
7454
- console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7455
- }
7456
- } else {
7457
- this.failedVastUrls.add(vastTagUrl);
7458
- if (this.config.debugAdTiming) {
7459
- 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
+ }
7460
7387
  }
7461
7388
  }
7462
7389
  this.clearAdRequestWatchdog();
@@ -7559,8 +7486,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7559
7486
  key: "startAdRequestWatchdog",
7560
7487
  value: function startAdRequestWatchdog(token) {
7561
7488
  var _this = this;
7562
- this.clearAdRequestWatchdog();
7563
7489
  var _this_config_adFailsafeTimeoutMs;
7490
+ this.clearAdRequestWatchdog();
7564
7491
  var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7565
7492
  this.adRequestWatchdogToken = token;
7566
7493
  this.adRequestWatchdogId = window.setTimeout(function() {
@@ -7603,8 +7530,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7603
7530
  key: "startAdFailsafeTimer",
7604
7531
  value: function startAdFailsafeTimer(token) {
7605
7532
  var _this = this;
7606
- this.clearAdFailsafeTimer();
7607
7533
  var _this_config_adFailsafeTimeoutMs;
7534
+ this.clearAdFailsafeTimer();
7608
7535
  var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7609
7536
  this.adFailsafeToken = token;
7610
7537
  this.adFailsafeTimerId = window.setTimeout(function() {
@@ -7928,11 +7855,10 @@ var CRITICAL_PROPS = [
7928
7855
  "lowLatencyMode",
7929
7856
  "driftToleranceMs",
7930
7857
  "vastMode",
7931
- "adPlayerType",
7932
- "prebid"
7858
+ "adPlayerType"
7933
7859
  ];
7934
7860
  var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7935
- var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, adPlayerType = props.adPlayerType, prebid = props.prebid, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7861
+ var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, adPlayerType = props.adPlayerType, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7936
7862
  "src",
7937
7863
  "autoplay",
7938
7864
  "muted",
@@ -7960,7 +7886,6 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7960
7886
  "vastMode",
7961
7887
  "vastTagUrl",
7962
7888
  "adPlayerType",
7963
- "prebid",
7964
7889
  "minSegmentsBeforePlay"
7965
7890
  ]);
7966
7891
  var videoRef = (0, import_react.useRef)(null);
@@ -7987,21 +7912,21 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7987
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];
7988
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];
7989
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];
7990
- var getResponsiveScale = function() {
7915
+ var getResponsiveScale = function getResponsiveScale() {
7991
7916
  if (viewportWidth < 480) return 0.7;
7992
7917
  if (viewportWidth < 768) return 0.8;
7993
7918
  if (viewportWidth < 1024) return 0.9;
7994
7919
  return 1;
7995
7920
  };
7996
7921
  var responsiveScale = getResponsiveScale();
7997
- var formatTime = function(seconds) {
7922
+ var formatTime = function formatTime(seconds) {
7998
7923
  if (!isFinite(seconds)) return "0:00:00";
7999
7924
  var hours = Math.floor(seconds / 3600);
8000
7925
  var minutes = Math.floor(seconds % 3600 / 60);
8001
7926
  var remainingSeconds = Math.floor(seconds % 60);
8002
7927
  return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
8003
7928
  };
8004
- var handlePlayPause = function() {
7929
+ var handlePlayPause = function handlePlayPause() {
8005
7930
  if (videoRef.current) {
8006
7931
  if (videoRef.current.paused) {
8007
7932
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
@@ -8020,7 +7945,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8020
7945
  }
8021
7946
  }
8022
7947
  };
8023
- var handleCenterPlayClick = function() {
7948
+ var handleCenterPlayClick = function handleCenterPlayClick() {
8024
7949
  if (videoRef.current && videoRef.current.paused) {
8025
7950
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
8026
7951
  if (hasValidSource) {
@@ -8034,7 +7959,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8034
7959
  }
8035
7960
  }
8036
7961
  };
8037
- var handleTimelineSeek = function(e) {
7962
+ var handleTimelineSeek = function handleTimelineSeek(e) {
8038
7963
  if (videoRef.current && duration > 0 && isFinite(duration)) {
8039
7964
  var rect = e.currentTarget.getBoundingClientRect();
8040
7965
  var clickX = e.clientX - rect.left;
@@ -8045,13 +7970,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8045
7970
  }
8046
7971
  }
8047
7972
  };
8048
- var handleVolumeChange = function(newVolume) {
7973
+ var handleVolumeChange = function handleVolumeChange(newVolume) {
8049
7974
  if (playerRef.current && isFinite(newVolume)) {
8050
7975
  var clampedVolume = Math.max(0, Math.min(1, newVolume));
8051
7976
  playerRef.current.setVolume(clampedVolume);
8052
7977
  }
8053
7978
  };
8054
- var handlePlaybackRateChange = function(rate) {
7979
+ var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
8055
7980
  if (videoRef.current && isFinite(rate) && rate > 0) {
8056
7981
  videoRef.current.playbackRate = rate;
8057
7982
  }
@@ -8070,8 +7995,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8070
7995
  lowLatencyMode,
8071
7996
  driftToleranceMs,
8072
7997
  vastMode,
8073
- adPlayerType,
8074
- prebid
7998
+ adPlayerType
8075
7999
  ]);
8076
8000
  (0, import_react.useEffect)(function() {
8077
8001
  if (typeof window === "undefined") return;
@@ -8090,7 +8014,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8090
8014
  if (playerRef.current) {
8091
8015
  try {
8092
8016
  playerRef.current.destroy();
8093
- } catch (e) {}
8017
+ } catch (unused) {}
8094
8018
  playerRef.current = null;
8095
8019
  }
8096
8020
  var cfg = {
@@ -8112,7 +8036,6 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8112
8036
  if (vastMode !== void 0) cfg.vastMode = vastMode;
8113
8037
  if (vastTagUrl !== void 0) cfg.vastTagUrl = vastTagUrl;
8114
8038
  if (adPlayerType !== void 0) cfg.adPlayerType = adPlayerType;
8115
- if (prebid !== void 0) cfg.prebid = prebid;
8116
8039
  if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
8117
8040
  var player = new StormcloudVideoPlayer(cfg);
8118
8041
  playerRef.current = player;
@@ -8131,7 +8054,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8131
8054
  return function() {
8132
8055
  try {
8133
8056
  player.destroy();
8134
- } catch (e) {}
8057
+ } catch (unused) {}
8135
8058
  playerRef.current = null;
8136
8059
  };
8137
8060
  }, [
@@ -8155,7 +8078,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8155
8078
  ]);
8156
8079
  (0, import_react.useEffect)(function() {
8157
8080
  if (!playerRef.current) return;
8158
- var checkAdStatus = function() {
8081
+ var checkAdStatus = function checkAdStatus() {
8159
8082
  if (playerRef.current) {
8160
8083
  var _videoRef_current_dataset, _videoRef_current;
8161
8084
  var showAdsFromMethod = playerRef.current.isShowingAds();
@@ -8185,7 +8108,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8185
8108
  }, []);
8186
8109
  (0, import_react.useEffect)(function() {
8187
8110
  if (typeof window === "undefined" || !playerRef.current) return;
8188
- var handleResize = function() {
8111
+ var handleResize = function handleResize() {
8189
8112
  if (playerRef.current && videoRef.current) {
8190
8113
  if (typeof playerRef.current.resize === "function") {
8191
8114
  playerRef.current.resize();
@@ -8201,7 +8124,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8201
8124
  }, []);
8202
8125
  (0, import_react.useEffect)(function() {
8203
8126
  if (!playerRef.current || !videoRef.current) return;
8204
- var updateStates = function() {
8127
+ var updateStates = function updateStates() {
8205
8128
  var _videoRef_current;
8206
8129
  if (playerRef.current && videoRef.current) {
8207
8130
  setIsMuted(playerRef.current.isMuted());
@@ -8218,7 +8141,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8218
8141
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8219
8142
  };
8220
8143
  var interval = setInterval(updateStates, 200);
8221
- var handleFullscreenChange = function() {
8144
+ var handleFullscreenChange = function handleFullscreenChange() {
8222
8145
  var _videoRef_current;
8223
8146
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8224
8147
  };
@@ -8230,7 +8153,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8230
8153
  }, []);
8231
8154
  (0, import_react.useEffect)(function() {
8232
8155
  if (!videoRef.current) return;
8233
- var handleLoadedMetadata = function() {
8156
+ var handleLoadedMetadata = function handleLoadedMetadata() {
8234
8157
  if (videoRef.current) {
8235
8158
  var video2 = videoRef.current;
8236
8159
  void video2.offsetHeight;
@@ -8240,19 +8163,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8240
8163
  console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8241
8164
  }
8242
8165
  };
8243
- var handleLoadedData = function() {
8166
+ var handleLoadedData = function handleLoadedData() {
8244
8167
  if (debugAdTiming) {
8245
8168
  var _videoRef_current;
8246
8169
  console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8247
8170
  }
8248
8171
  };
8249
- var handleLoadStart = function() {
8172
+ var handleLoadStart = function handleLoadStart() {
8250
8173
  if (debugAdTiming) {
8251
8174
  var _videoRef_current;
8252
8175
  console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8253
8176
  }
8254
8177
  };
8255
- var handleCanPlay = function() {
8178
+ var handleCanPlay = function handleCanPlay() {
8256
8179
  setIsLoading(false);
8257
8180
  if (bufferingTimeoutRef.current) {
8258
8181
  clearTimeout(bufferingTimeoutRef.current);
@@ -8264,7 +8187,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8264
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");
8265
8188
  }
8266
8189
  };
8267
- var handleCanPlayThrough = function() {
8190
+ var handleCanPlayThrough = function handleCanPlayThrough() {
8268
8191
  setIsLoading(false);
8269
8192
  if (bufferingTimeoutRef.current) {
8270
8193
  clearTimeout(bufferingTimeoutRef.current);
@@ -8276,7 +8199,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8276
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");
8277
8200
  }
8278
8201
  };
8279
- var handleWaiting = function() {
8202
+ var handleWaiting = function handleWaiting() {
8280
8203
  if (bufferingTimeoutRef.current) {
8281
8204
  clearTimeout(bufferingTimeoutRef.current);
8282
8205
  }
@@ -8292,7 +8215,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8292
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)");
8293
8216
  }
8294
8217
  };
8295
- var handlePlaying = function() {
8218
+ var handlePlaying = function handlePlaying() {
8296
8219
  setIsLoading(false);
8297
8220
  if (bufferingTimeoutRef.current) {
8298
8221
  clearTimeout(bufferingTimeoutRef.current);
@@ -8305,7 +8228,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8305
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");
8306
8229
  }
8307
8230
  };
8308
- var handlePause = function() {
8231
+ var handlePause = function handlePause() {
8309
8232
  var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
8310
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";
8311
8234
  if (playerRef.current && !isAdActive) {
@@ -8314,7 +8237,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8314
8237
  setShowCenterPlay(false);
8315
8238
  }
8316
8239
  };
8317
- var handleEnded = function() {
8240
+ var handleEnded = function handleEnded() {
8318
8241
  setShowCenterPlay(true);
8319
8242
  };
8320
8243
  var video = videoRef.current;
@@ -8472,14 +8395,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8472
8395
  boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
8473
8396
  transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
8474
8397
  },
8475
- onMouseEnter: function(e) {
8398
+ onMouseEnter: function onMouseEnter(e) {
8476
8399
  var target = e.currentTarget;
8477
8400
  target.style.transform = "translate(-50%, -50%)";
8478
8401
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
8479
8402
  target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8480
8403
  target.style.borderColor = "rgba(255, 255, 255, 0.9)";
8481
8404
  },
8482
- onMouseLeave: function(e) {
8405
+ onMouseLeave: function onMouseLeave(e) {
8483
8406
  var target = e.currentTarget;
8484
8407
  target.style.transform = "translate(-50%, -50%)";
8485
8408
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
@@ -8586,12 +8509,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8586
8509
  minWidth: "".concat(48 * responsiveScale, "px"),
8587
8510
  minHeight: "".concat(48 * responsiveScale, "px")
8588
8511
  },
8589
- onMouseEnter: function(e) {
8512
+ onMouseEnter: function onMouseEnter(e) {
8590
8513
  var target = e.target;
8591
8514
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8592
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)";
8593
8516
  },
8594
- onMouseLeave: function(e) {
8517
+ onMouseLeave: function onMouseLeave(e) {
8595
8518
  var target = e.target;
8596
8519
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8597
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)";
@@ -8617,15 +8540,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8617
8540
  padding: "8px",
8618
8541
  margin: "-8px"
8619
8542
  },
8620
- onMouseEnter: function() {
8543
+ onMouseEnter: function onMouseEnter() {
8621
8544
  return setShowVolumeSlider(true);
8622
8545
  },
8623
- onMouseLeave: function() {
8546
+ onMouseLeave: function onMouseLeave() {
8624
8547
  return setShowVolumeSlider(false);
8625
8548
  },
8626
8549
  children: [
8627
8550
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8628
- onClick: function() {
8551
+ onClick: function onClick() {
8629
8552
  if (playerRef.current) {
8630
8553
  playerRef.current.toggleMute();
8631
8554
  }
@@ -8649,12 +8572,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8649
8572
  minWidth: "".concat(44 * responsiveScale, "px"),
8650
8573
  minHeight: "".concat(44 * responsiveScale, "px")
8651
8574
  },
8652
- onMouseEnter: function(e) {
8575
+ onMouseEnter: function onMouseEnter(e) {
8653
8576
  var target = e.target;
8654
8577
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8655
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)";
8656
8579
  },
8657
- onMouseLeave: function(e) {
8580
+ onMouseLeave: function onMouseLeave(e) {
8658
8581
  var target = e.target;
8659
8582
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8660
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)";
@@ -8690,10 +8613,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8690
8613
  marginBottom: "-16px",
8691
8614
  zIndex: 9
8692
8615
  },
8693
- onMouseEnter: function() {
8616
+ onMouseEnter: function onMouseEnter() {
8694
8617
  return setShowVolumeSlider(true);
8695
8618
  },
8696
- onMouseLeave: function() {
8619
+ onMouseLeave: function onMouseLeave() {
8697
8620
  return setShowVolumeSlider(false);
8698
8621
  }
8699
8622
  }),
@@ -8718,12 +8641,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8718
8641
  zIndex: 10,
8719
8642
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8720
8643
  },
8721
- onMouseEnter: function(e) {
8644
+ onMouseEnter: function onMouseEnter(e) {
8722
8645
  setShowVolumeSlider(true);
8723
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)";
8724
8647
  e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
8725
8648
  },
8726
- onMouseLeave: function(e) {
8649
+ onMouseLeave: function onMouseLeave(e) {
8727
8650
  setShowVolumeSlider(false);
8728
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)";
8729
8652
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
@@ -8736,19 +8659,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8736
8659
  cursor: "pointer",
8737
8660
  transition: "transform 0.2s ease-in-out"
8738
8661
  },
8739
- onMouseEnter: function(e) {},
8740
- onMouseLeave: function(e) {},
8741
- onMouseDown: function(e) {
8662
+ onMouseEnter: function onMouseEnter(e) {},
8663
+ onMouseLeave: function onMouseLeave(e) {},
8664
+ onMouseDown: function onMouseDown(e) {
8742
8665
  e.preventDefault();
8743
8666
  var sliderElement = e.currentTarget;
8744
- var handleMouseMove = function(moveEvent) {
8667
+ var handleMouseMove = function handleMouseMove(moveEvent) {
8745
8668
  if (!sliderElement) return;
8746
8669
  var rect2 = sliderElement.getBoundingClientRect();
8747
8670
  var y2 = moveEvent.clientY - rect2.top;
8748
8671
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8749
8672
  handleVolumeChange(percentage2);
8750
8673
  };
8751
- var handleMouseUp = function() {
8674
+ var handleMouseUp = function handleMouseUp1() {
8752
8675
  document.removeEventListener("mousemove", handleMouseMove);
8753
8676
  document.removeEventListener("mouseup", handleMouseUp);
8754
8677
  };
@@ -8759,7 +8682,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8759
8682
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8760
8683
  handleVolumeChange(percentage);
8761
8684
  },
8762
- onClick: function(e) {
8685
+ onClick: function onClick(e) {
8763
8686
  e.stopPropagation();
8764
8687
  var rect = e.currentTarget.getBoundingClientRect();
8765
8688
  var y = e.clientY - rect.top;
@@ -8806,17 +8729,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8806
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",
8807
8730
  cursor: "grab"
8808
8731
  },
8809
- onMouseEnter: function(e) {
8732
+ onMouseEnter: function onMouseEnter(e) {
8810
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)";
8811
8734
  e.currentTarget.style.cursor = "grab";
8812
8735
  },
8813
- onMouseLeave: function(e) {
8736
+ onMouseLeave: function onMouseLeave(e) {
8814
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)";
8815
8738
  },
8816
- onMouseDown: function(e) {
8739
+ onMouseDown: function onMouseDown(e) {
8817
8740
  e.currentTarget.style.cursor = "grabbing";
8818
8741
  },
8819
- onMouseUp: function(e) {
8742
+ onMouseUp: function onMouseUp(e) {
8820
8743
  e.currentTarget.style.cursor = "grab";
8821
8744
  }
8822
8745
  })
@@ -8856,7 +8779,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8856
8779
  },
8857
8780
  children: [
8858
8781
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8859
- onClick: function() {
8782
+ onClick: function onClick() {
8860
8783
  return setShowSpeedMenu(!showSpeedMenu);
8861
8784
  },
8862
8785
  style: {
@@ -8875,12 +8798,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8875
8798
  minWidth: "".concat(56 * responsiveScale, "px"),
8876
8799
  minHeight: "".concat(40 * responsiveScale, "px")
8877
8800
  },
8878
- onMouseEnter: function(e) {
8801
+ onMouseEnter: function onMouseEnter(e) {
8879
8802
  var target = e.target;
8880
8803
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8881
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)";
8882
8805
  },
8883
- onMouseLeave: function(e) {
8806
+ onMouseLeave: function onMouseLeave(e) {
8884
8807
  var target = e.target;
8885
8808
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8886
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)";
@@ -8916,7 +8839,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8916
8839
  2
8917
8840
  ].map(function(speed) {
8918
8841
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8919
- onClick: function() {
8842
+ onClick: function onClick() {
8920
8843
  return handlePlaybackRateChange(speed);
8921
8844
  },
8922
8845
  style: {
@@ -8934,12 +8857,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8934
8857
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8935
8858
  borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
8936
8859
  },
8937
- onMouseEnter: function(e) {
8860
+ onMouseEnter: function onMouseEnter(e) {
8938
8861
  if (playbackRate !== speed) {
8939
8862
  e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
8940
8863
  }
8941
8864
  },
8942
- onMouseLeave: function(e) {
8865
+ onMouseLeave: function onMouseLeave(e) {
8943
8866
  if (playbackRate !== speed) {
8944
8867
  e.target.style.background = "transparent";
8945
8868
  }
@@ -8954,7 +8877,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8954
8877
  ]
8955
8878
  }),
8956
8879
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8957
- onClick: function() {
8880
+ onClick: function onClick() {
8958
8881
  if (onFullscreenToggle) {
8959
8882
  onFullscreenToggle();
8960
8883
  } else if (playerRef.current) {
@@ -8979,12 +8902,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8979
8902
  minWidth: "".concat(44 * responsiveScale, "px"),
8980
8903
  minHeight: "".concat(44 * responsiveScale, "px")
8981
8904
  },
8982
- onMouseEnter: function(e) {
8905
+ onMouseEnter: function onMouseEnter(e) {
8983
8906
  var target = e.target;
8984
8907
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8985
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)";
8986
8909
  },
8987
- onMouseLeave: function(e) {
8910
+ onMouseLeave: function onMouseLeave(e) {
8988
8911
  var target = e.target;
8989
8912
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8990
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)";
@@ -9028,15 +8951,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9028
8951
  padding: "8px",
9029
8952
  margin: "-8px"
9030
8953
  },
9031
- onMouseEnter: function() {
8954
+ onMouseEnter: function onMouseEnter() {
9032
8955
  return setShowVolumeSlider(true);
9033
8956
  },
9034
- onMouseLeave: function() {
8957
+ onMouseLeave: function onMouseLeave() {
9035
8958
  return setShowVolumeSlider(false);
9036
8959
  },
9037
8960
  children: [
9038
8961
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9039
- onClick: function() {
8962
+ onClick: function onClick() {
9040
8963
  if (playerRef.current) {
9041
8964
  playerRef.current.toggleMute();
9042
8965
  }
@@ -9044,12 +8967,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9044
8967
  onVolumeToggle();
9045
8968
  }
9046
8969
  },
9047
- onMouseEnter: function(e) {
8970
+ onMouseEnter: function onMouseEnter(e) {
9048
8971
  var target = e.currentTarget;
9049
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)";
9050
8973
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9051
8974
  },
9052
- onMouseLeave: function(e) {
8975
+ onMouseLeave: function onMouseLeave(e) {
9053
8976
  var target = e.currentTarget;
9054
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)";
9055
8978
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9104,10 +9027,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9104
9027
  marginBottom: "-16px",
9105
9028
  zIndex: 9
9106
9029
  },
9107
- onMouseEnter: function() {
9030
+ onMouseEnter: function onMouseEnter() {
9108
9031
  return setShowVolumeSlider(true);
9109
9032
  },
9110
- onMouseLeave: function() {
9033
+ onMouseLeave: function onMouseLeave() {
9111
9034
  return setShowVolumeSlider(false);
9112
9035
  }
9113
9036
  }),
@@ -9132,12 +9055,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9132
9055
  zIndex: 10,
9133
9056
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
9134
9057
  },
9135
- onMouseEnter: function(e) {
9058
+ onMouseEnter: function onMouseEnter(e) {
9136
9059
  setShowVolumeSlider(true);
9137
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)";
9138
9061
  e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
9139
9062
  },
9140
- onMouseLeave: function(e) {
9063
+ onMouseLeave: function onMouseLeave(e) {
9141
9064
  setShowVolumeSlider(false);
9142
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)";
9143
9066
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
@@ -9150,17 +9073,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9150
9073
  cursor: "pointer",
9151
9074
  transition: "transform 0.2s ease-in-out"
9152
9075
  },
9153
- onMouseDown: function(e) {
9076
+ onMouseDown: function onMouseDown(e) {
9154
9077
  e.preventDefault();
9155
9078
  var sliderElement = e.currentTarget;
9156
- var handleMouseMove = function(moveEvent) {
9079
+ var handleMouseMove = function handleMouseMove(moveEvent) {
9157
9080
  if (!sliderElement) return;
9158
9081
  var rect2 = sliderElement.getBoundingClientRect();
9159
9082
  var y2 = moveEvent.clientY - rect2.top;
9160
9083
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
9161
9084
  handleVolumeChange(percentage2);
9162
9085
  };
9163
- var handleMouseUp = function() {
9086
+ var handleMouseUp = function handleMouseUp1() {
9164
9087
  document.removeEventListener("mousemove", handleMouseMove);
9165
9088
  document.removeEventListener("mouseup", handleMouseUp);
9166
9089
  };
@@ -9171,7 +9094,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9171
9094
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
9172
9095
  handleVolumeChange(percentage);
9173
9096
  },
9174
- onClick: function(e) {
9097
+ onClick: function onClick(e) {
9175
9098
  e.stopPropagation();
9176
9099
  var rect = e.currentTarget.getBoundingClientRect();
9177
9100
  var y = e.clientY - rect.top;
@@ -9220,17 +9143,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9220
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",
9221
9144
  cursor: "grab"
9222
9145
  },
9223
- onMouseEnter: function(e) {
9146
+ onMouseEnter: function onMouseEnter(e) {
9224
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)";
9225
9148
  e.currentTarget.style.cursor = "grab";
9226
9149
  },
9227
- onMouseLeave: function(e) {
9150
+ onMouseLeave: function onMouseLeave(e) {
9228
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)";
9229
9152
  },
9230
- onMouseDown: function(e) {
9153
+ onMouseDown: function onMouseDown(e) {
9231
9154
  e.currentTarget.style.cursor = "grabbing";
9232
9155
  },
9233
- onMouseUp: function(e) {
9156
+ onMouseUp: function onMouseUp(e) {
9234
9157
  e.currentTarget.style.cursor = "grab";
9235
9158
  }
9236
9159
  })
@@ -9242,7 +9165,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9242
9165
  ]
9243
9166
  }),
9244
9167
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9245
- onClick: function() {
9168
+ onClick: function onClick() {
9246
9169
  if (onFullscreenToggle) {
9247
9170
  onFullscreenToggle();
9248
9171
  } else if (playerRef.current) {
@@ -9251,12 +9174,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9251
9174
  });
9252
9175
  }
9253
9176
  },
9254
- onMouseEnter: function(e) {
9177
+ onMouseEnter: function onMouseEnter(e) {
9255
9178
  var target = e.currentTarget;
9256
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)";
9257
9180
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9258
9181
  },
9259
- onMouseLeave: function(e) {
9182
+ onMouseLeave: function onMouseLeave(e) {
9260
9183
  var target = e.currentTarget;
9261
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)";
9262
9185
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";