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
package/lib/index.js CHANGED
@@ -180,12 +180,22 @@ function _object_spread_props(target, source) {
180
180
  }
181
181
  function _object_without_properties(source, excluded) {
182
182
  if (source == null) return {};
183
- var target = _object_without_properties_loose(source, excluded);
184
- var key, i;
183
+ var target = {}, sourceKeys, key, i;
184
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
185
+ sourceKeys = Reflect.ownKeys(Object(source));
186
+ for(i = 0; i < sourceKeys.length; i++){
187
+ key = sourceKeys[i];
188
+ if (excluded.indexOf(key) >= 0) continue;
189
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
190
+ target[key] = source[key];
191
+ }
192
+ return target;
193
+ }
194
+ target = _object_without_properties_loose(source, excluded);
185
195
  if (Object.getOwnPropertySymbols) {
186
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
187
- for(i = 0; i < sourceSymbolKeys.length; i++){
188
- key = sourceSymbolKeys[i];
196
+ sourceKeys = Object.getOwnPropertySymbols(source);
197
+ for(i = 0; i < sourceKeys.length; i++){
198
+ key = sourceKeys[i];
189
199
  if (excluded.indexOf(key) >= 0) continue;
190
200
  if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
191
201
  target[key] = source[key];
@@ -195,12 +205,11 @@ function _object_without_properties(source, excluded) {
195
205
  }
196
206
  function _object_without_properties_loose(source, excluded) {
197
207
  if (source == null) return {};
198
- var target = {};
199
- var sourceKeys = Object.keys(source);
200
- var key, i;
208
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
201
209
  for(i = 0; i < sourceKeys.length; i++){
202
210
  key = sourceKeys[i];
203
211
  if (excluded.indexOf(key) >= 0) continue;
212
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
204
213
  target[key] = source[key];
205
214
  }
206
215
  return target;
@@ -253,9 +262,17 @@ function _ts_generator(thisArg, body) {
253
262
  },
254
263
  trys: [],
255
264
  ops: []
256
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
257
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
258
- return this;
265
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
266
+ return d(g, "next", {
267
+ value: verb(0)
268
+ }), d(g, "throw", {
269
+ value: verb(1)
270
+ }), d(g, "return", {
271
+ value: verb(2)
272
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
273
+ value: function() {
274
+ return this;
275
+ }
259
276
  }), g;
260
277
  function verb(n) {
261
278
  return function(v) {
@@ -709,7 +726,7 @@ function createImaController(video, options) {
709
726
  var fn = _step.value;
710
727
  try {
711
728
  fn(payload);
712
- } catch (e) {}
729
+ } catch (unused) {}
713
730
  }
714
731
  } catch (err) {
715
732
  _didIteratorError = true;
@@ -747,7 +764,7 @@ function createImaController(video, options) {
747
764
  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'.");
748
765
  }
749
766
  }
750
- } catch (e) {}
767
+ } catch (unused) {}
751
768
  if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
752
769
  var existing = document.querySelector('script[data-ima="true"]');
753
770
  if (existing) {
@@ -995,7 +1012,7 @@ function createImaController(video, options) {
995
1012
  if (adsManager) {
996
1013
  try {
997
1014
  adsManager.destroy();
998
- } catch (e) {}
1015
+ } catch (unused) {}
999
1016
  adsManager = void 0;
1000
1017
  }
1001
1018
  if (adVideoElement) {
@@ -1006,7 +1023,7 @@ function createImaController(video, options) {
1006
1023
  if (adsLoader) {
1007
1024
  try {
1008
1025
  adsLoader.destroy();
1009
- } catch (e) {}
1026
+ } catch (unused) {}
1010
1027
  adsLoader = void 0;
1011
1028
  }
1012
1029
  }
@@ -1024,7 +1041,7 @@ function createImaController(video, options) {
1024
1041
  try {
1025
1042
  var _adDisplayContainer_initialize;
1026
1043
  (_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
1027
- } catch (e) {}
1044
+ } catch (unused) {}
1028
1045
  }
1029
1046
  }).catch(function() {});
1030
1047
  },
@@ -1183,7 +1200,7 @@ function createImaController(video, options) {
1183
1200
  window.setTimeout(function() {
1184
1201
  try {
1185
1202
  makeAdsRequest(google, lastAdTagUrl);
1186
- } catch (e) {}
1203
+ } catch (unused) {}
1187
1204
  }, delay);
1188
1205
  } else {
1189
1206
  emit("ad_error", {
@@ -1215,7 +1232,7 @@ function createImaController(video, options) {
1215
1232
  if (adsManager) {
1216
1233
  try {
1217
1234
  adsManager.setVolume(adVolume);
1218
- } catch (e) {}
1235
+ } catch (unused) {}
1219
1236
  }
1220
1237
  emit("content_pause");
1221
1238
  });
@@ -1229,7 +1246,7 @@ function createImaController(video, options) {
1229
1246
  if (adsManager) {
1230
1247
  try {
1231
1248
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1232
- } catch (e) {}
1249
+ } catch (unused) {}
1233
1250
  }
1234
1251
  }
1235
1252
  if (adContainerEl) {
@@ -1390,7 +1407,7 @@ function createImaController(video, options) {
1390
1407
  }
1391
1408
  try {
1392
1409
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1393
- } catch (e) {}
1410
+ } catch (unused) {}
1394
1411
  adsManager.start();
1395
1412
  return [
1396
1413
  2,
@@ -1472,7 +1489,7 @@ function createImaController(video, options) {
1472
1489
  try {
1473
1490
  ;
1474
1491
  adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
1475
- } catch (e) {}
1492
+ } catch (unused) {}
1476
1493
  destroyAdsManager();
1477
1494
  return [
1478
1495
  2
@@ -1503,7 +1520,7 @@ function createImaController(video, options) {
1503
1520
  try {
1504
1521
  var _adsLoader_destroy;
1505
1522
  adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
1506
- } catch (e) {}
1523
+ } catch (unused) {}
1507
1524
  adDisplayContainer = void 0;
1508
1525
  adsLoader = void 0;
1509
1526
  contentVideoHidden = false;
@@ -1552,7 +1569,7 @@ function createImaController(video, options) {
1552
1569
  if (adsManager && adPlaying) {
1553
1570
  try {
1554
1571
  adsManager.setVolume(clampedVolume);
1555
- } catch (e) {}
1572
+ } catch (unused) {}
1556
1573
  }
1557
1574
  },
1558
1575
  getAdVolume: function getAdVolume() {
@@ -2465,12 +2482,12 @@ function createHlsAdPlayer(contentVideo, options) {
2465
2482
  }
2466
2483
  // src/sdk/prebid.ts
2467
2484
  var DEFAULT_TIMEOUT_MS = 3e3;
2468
- var AUCTION_PATH = "/openrtb2/auction";
2469
- function createPrebidManager(config) {
2485
+ var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
2486
+ function createPrebidManager() {
2487
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2488
+ var _options_debug;
2470
2489
  var initialized = false;
2471
- var serverUrl = "";
2472
- var _config_debug;
2473
- var debug = (_config_debug = config.debug) !== null && _config_debug !== void 0 ? _config_debug : false;
2490
+ var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
2474
2491
  function log() {
2475
2492
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
2476
2493
  args[_key] = arguments[_key];
@@ -2491,49 +2508,6 @@ function createPrebidManager(config) {
2491
2508
  "[Prebid]"
2492
2509
  ].concat(_to_consumable_array(args)));
2493
2510
  }
2494
- function resolveServerUrl() {
2495
- var _config_ortbRequest_ext_prebid_server, _config_ortbRequest_ext_prebid, _config_ortbRequest_ext, _config_ortbRequest;
2496
- if (config.serverUrl) {
2497
- return config.serverUrl.replace(/\/$/, "");
2498
- }
2499
- 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;
2500
- if (typeof extUrl === "string" && extUrl.length > 0) {
2501
- return extUrl.replace(/\/$/, "");
2502
- }
2503
- throw new Error("Prebid Server URL not configured. Provide serverUrl in PrebidConfig or ext.prebid.server.externalurl in the OpenRTB request.");
2504
- }
2505
- function buildRequest() {
2506
- var req = JSON.parse(JSON.stringify(config.ortbRequest));
2507
- req.id = "".concat(req.id || "prebid", "-").concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 8));
2508
- if (!req.ext) req.ext = {};
2509
- if (!req.ext.prebid) req.ext.prebid = {};
2510
- if (!req.ext.prebid.cache) req.ext.prebid.cache = {};
2511
- if (!req.ext.prebid.cache.vastxml) req.ext.prebid.cache.vastxml = {};
2512
- if (!req.ext.prebid.targeting) {
2513
- req.ext.prebid.targeting = {
2514
- includewinners: true,
2515
- includebidderkeys: false
2516
- };
2517
- }
2518
- if (!req.device) req.device = {};
2519
- if (typeof navigator !== "undefined") {
2520
- if (!req.device.ua) req.device.ua = navigator.userAgent;
2521
- if (!req.device.language) {
2522
- req.device.language = (navigator.language || "").split("-")[0] || "en";
2523
- }
2524
- }
2525
- if (typeof window !== "undefined") {
2526
- var _window_screen, _window_screen1;
2527
- if (!req.device.w) req.device.w = ((_window_screen = window.screen) === null || _window_screen === void 0 ? void 0 : _window_screen.width) || window.innerWidth;
2528
- if (!req.device.h) req.device.h = ((_window_screen1 = window.screen) === null || _window_screen1 === void 0 ? void 0 : _window_screen1.height) || window.innerHeight;
2529
- }
2530
- if (!req.site) req.site = {};
2531
- if (typeof window !== "undefined") {
2532
- if (!req.site.page) req.site.page = window.location.href;
2533
- if (!req.site.domain) req.site.domain = window.location.hostname;
2534
- }
2535
- return req;
2536
- }
2537
2511
  function parseResponse(data) {
2538
2512
  var bids = [];
2539
2513
  var seatbids = (data === null || data === void 0 ? void 0 : data.seatbid) || [];
@@ -2603,12 +2577,6 @@ function createPrebidManager(config) {
2603
2577
  function extractVastUrl(bids) {
2604
2578
  if (bids.length === 0) return null;
2605
2579
  var winner = bids[0];
2606
- var _config_cpmFloor;
2607
- var cpmFloor = (_config_cpmFloor = config.cpmFloor) !== null && _config_cpmFloor !== void 0 ? _config_cpmFloor : 0;
2608
- if (cpmFloor > 0 && winner.cpm < cpmFloor) {
2609
- log("Winning bid $".concat(winner.cpm.toFixed(2), " below CPM floor $").concat(cpmFloor.toFixed(2), ", rejecting"));
2610
- return null;
2611
- }
2612
2580
  if (winner.vastUrl) {
2613
2581
  log("Using cached VAST URL from ".concat(winner.bidder, " ($").concat(winner.cpm.toFixed(2), " ").concat(winner.currency, ")"));
2614
2582
  return winner.vastUrl;
@@ -2630,22 +2598,12 @@ function createPrebidManager(config) {
2630
2598
  }
2631
2599
  function initialize() {
2632
2600
  return _async_to_generator(function() {
2633
- var _config_ortbRequest;
2634
2601
  return _ts_generator(this, function(_state) {
2635
2602
  if (initialized) return [
2636
2603
  2
2637
2604
  ];
2638
- serverUrl = resolveServerUrl();
2639
- if (!((_config_ortbRequest = config.ortbRequest) === null || _config_ortbRequest === void 0 ? void 0 : _config_ortbRequest.imp) || config.ortbRequest.imp.length === 0) {
2640
- throw new Error("No impressions (imp) defined in the OpenRTB request.");
2641
- }
2642
2605
  initialized = true;
2643
- log("Initialized with server:", serverUrl);
2644
- log("Bidders:", config.ortbRequest.imp.map(function(imp) {
2645
- var _imp_ext_prebid, _imp_ext;
2646
- 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;
2647
- return bidders ? Object.keys(bidders).join(", ") : "none";
2648
- }).join("; "));
2606
+ log("Initialized, auction URL:", AUCTION_URL);
2649
2607
  return [
2650
2608
  2
2651
2609
  ];
@@ -2654,17 +2612,15 @@ function createPrebidManager(config) {
2654
2612
  }
2655
2613
  function requestBids() {
2656
2614
  return _async_to_generator(function() {
2657
- 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;
2615
+ var timeout, controller, timeoutId, _data_ext, _data_ext1, fetchOptions, response, body, data, bids, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, b, error;
2658
2616
  return _ts_generator(this, function(_state) {
2659
2617
  switch(_state.label){
2660
2618
  case 0:
2661
2619
  if (!initialized) {
2662
2620
  throw new Error("Prebid not initialized. Call initialize() first.");
2663
2621
  }
2664
- auctionUrl = "".concat(serverUrl).concat(AUCTION_PATH);
2665
- request = buildRequest();
2666
- timeout = (_ref = (_config_timeout = config.timeout) !== null && _config_timeout !== void 0 ? _config_timeout : config.ortbRequest.tmax) !== null && _ref !== void 0 ? _ref : DEFAULT_TIMEOUT_MS;
2667
- log("Sending auction request to:", auctionUrl);
2622
+ timeout = DEFAULT_TIMEOUT_MS;
2623
+ log("Fetching auction response from:", AUCTION_URL);
2668
2624
  controller = typeof AbortController !== "undefined" ? new AbortController() : null;
2669
2625
  timeoutId = setTimeout(function() {
2670
2626
  controller === null || controller === void 0 ? void 0 : controller.abort();
@@ -2678,18 +2634,14 @@ function createPrebidManager(config) {
2678
2634
  7
2679
2635
  ]);
2680
2636
  fetchOptions = {
2681
- method: "POST",
2682
- headers: {
2683
- "Content-Type": "application/json"
2684
- },
2685
- body: JSON.stringify(request)
2637
+ method: "POST"
2686
2638
  };
2687
2639
  if (controller) {
2688
2640
  fetchOptions.signal = controller.signal;
2689
2641
  }
2690
2642
  return [
2691
2643
  4,
2692
- fetch(auctionUrl, fetchOptions)
2644
+ fetch(AUCTION_URL, fetchOptions)
2693
2645
  ];
2694
2646
  case 2:
2695
2647
  response = _state.sent();
@@ -2806,7 +2758,6 @@ function createPrebidManager(config) {
2806
2758
  }
2807
2759
  function destroy() {
2808
2760
  initialized = false;
2809
- serverUrl = "";
2810
2761
  log("Destroyed");
2811
2762
  }
2812
2763
  return {
@@ -2822,7 +2773,7 @@ function createPrebidManager(config) {
2822
2773
  // src/sdk/prebidController.ts
2823
2774
  import Hls2 from "hls.js";
2824
2775
  var LOG = "[PrebidController]";
2825
- function createPrebidController(contentVideo, prebidConfig, options) {
2776
+ function createPrebidController(contentVideo, options) {
2826
2777
  var adPlaying = false;
2827
2778
  var originalMutedState = false;
2828
2779
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -2836,11 +2787,9 @@ function createPrebidController(contentVideo, prebidConfig, options) {
2836
2787
  var sessionId;
2837
2788
  var destroyed = false;
2838
2789
  var trackingFired = createEmptyTrackingState();
2839
- var _prebidConfig_debug;
2840
- var prebidDebug = (_prebidConfig_debug = prebidConfig.debug) !== null && _prebidConfig_debug !== void 0 ? _prebidConfig_debug : false;
2841
- var prebidManager = createPrebidManager(_object_spread_props(_object_spread({}, prebidConfig), {
2842
- debug: prebidDebug
2843
- }));
2790
+ var prebidManager = createPrebidManager((options === null || options === void 0 ? void 0 : options.debug) !== void 0 ? {
2791
+ debug: options.debug
2792
+ } : {});
2844
2793
  var prebidInitialized = false;
2845
2794
  function emit(event, payload) {
2846
2795
  var set = listeners.get(event);
@@ -3039,6 +2988,8 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3039
2988
  adContainerEl.style.display = "none";
3040
2989
  adContainerEl.style.pointerEvents = "none";
3041
2990
  }
2991
+ contentVideo.style.visibility = "visible";
2992
+ contentVideo.style.opacity = "1";
3042
2993
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
3043
2994
  if (contentVideo.paused) {
3044
2995
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
@@ -3063,19 +3014,12 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3063
3014
  }
3064
3015
  function ensurePrebidInitialized() {
3065
3016
  return _async_to_generator(function() {
3066
- var _prebidConfig_ortbRequest_imp, _prebidConfig_ortbRequest;
3067
3017
  return _ts_generator(this, function(_state) {
3068
3018
  switch(_state.label){
3069
3019
  case 0:
3070
3020
  if (prebidInitialized) return [
3071
3021
  2
3072
3022
  ];
3073
- if (prebidConfig.enabled === false) {
3074
- throw new Error("Prebid is disabled in config");
3075
- }
3076
- 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)) {
3077
- throw new Error("No impressions configured in ortbRequest");
3078
- }
3079
3023
  return [
3080
3024
  4,
3081
3025
  prebidManager.initialize()
@@ -3093,7 +3037,7 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3093
3037
  }
3094
3038
  function runPrebidAuction() {
3095
3039
  return _async_to_generator(function() {
3096
- var bids, _prebidConfig_cpmFloor, cpmFloor, winner;
3040
+ var bids, winner;
3097
3041
  return _ts_generator(this, function(_state) {
3098
3042
  switch(_state.label){
3099
3043
  case 0:
@@ -3116,15 +3060,7 @@ function createPrebidController(contentVideo, prebidConfig, options) {
3116
3060
  null
3117
3061
  ];
3118
3062
  }
3119
- cpmFloor = (_prebidConfig_cpmFloor = prebidConfig.cpmFloor) !== null && _prebidConfig_cpmFloor !== void 0 ? _prebidConfig_cpmFloor : 0;
3120
3063
  winner = bids[0];
3121
- if (cpmFloor > 0 && winner.cpm < cpmFloor) {
3122
- console.log("".concat(LOG, " Winning bid $").concat(winner.cpm.toFixed(2), " below CPM floor $").concat(cpmFloor.toFixed(2), ", rejecting"));
3123
- return [
3124
- 2,
3125
- null
3126
- ];
3127
- }
3128
3064
  console.log("".concat(LOG, " Winning bid: ").concat(winner.bidder, " $").concat(winner.cpm.toFixed(2), " ").concat(winner.currency));
3129
3065
  if (winner.vastXml) {
3130
3066
  console.log("".concat(LOG, " Parsing VAST XML from bid response (inline)"));
@@ -4232,22 +4168,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4232
4168
  adPlayerType = "hls";
4233
4169
  }
4234
4170
  if (adPlayerType === "prebid") {
4235
- if (!this.config.prebid) {
4236
- console.warn("[StormcloudVideoPlayer] adPlayerType is 'prebid' but no prebid config provided, falling back to HLS ad player");
4237
- return createHlsAdPlayer(this.video, _object_spread({
4238
- continueLiveStreamDuringAds: continueLiveStreamDuringAds
4239
- }, this.config.licenseKey ? {
4240
- licenseKey: this.config.licenseKey
4241
- } : {}, this.hls ? {
4242
- mainHlsInstance: this.hls
4243
- } : {}));
4244
- }
4245
4171
  if (this.config.debugAdTiming) {
4246
4172
  console.log("[StormcloudVideoPlayer] Creating Prebid ad controller (standalone, no IMA SDK)");
4247
4173
  }
4248
- return createPrebidController(this.video, this.config.prebid, _object_spread({
4174
+ return createPrebidController(this.video, _object_spread({
4249
4175
  continueLiveStreamDuringAds: continueLiveStreamDuringAds
4250
- }, this.config.licenseKey ? {
4176
+ }, this.config.debugAdTiming !== void 0 ? {
4177
+ debug: this.config.debugAdTiming
4178
+ } : {}, this.config.licenseKey ? {
4251
4179
  licenseKey: this.config.licenseKey
4252
4180
  } : {}, this.hls ? {
4253
4181
  mainHlsInstance: this.hls
@@ -4373,7 +4301,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4373
4301
  });
4374
4302
  this.hls.on(Hls3.Events.MANIFEST_PARSED, function(_, data) {
4375
4303
  return _async_to_generator(function() {
4376
- var _this_hls_levels, _this_hls, _this_hls_levels_some, adBehavior, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
4304
+ var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
4377
4305
  return _ts_generator(this, function(_state) {
4378
4306
  switch(_state.label){
4379
4307
  case 0:
@@ -4382,10 +4310,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4382
4310
  } else {
4383
4311
  ;
4384
4312
  ;
4385
- 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) {
4313
+ 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) {
4386
4314
  var _level_details, _level_details1;
4387
4315
  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";
4388
- })) !== null && _this_hls_levels_some !== void 0 ? _this_hls_levels_some : false;
4316
+ })) !== null && _ref !== void 0 ? _ref : false;
4389
4317
  }
4390
4318
  if (this.config.debugAdTiming) {
4391
4319
  adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
@@ -4449,9 +4377,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4449
4377
  var tag = "";
4450
4378
  var value = "";
4451
4379
  if (Array.isArray(entry)) {
4452
- var _entry_;
4380
+ var _entry_, _entry_1;
4453
4381
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4454
- var _entry_1;
4455
4382
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4456
4383
  } else if (typeof entry === "string") {
4457
4384
  var idx = entry.indexOf(":");
@@ -4574,9 +4501,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4574
4501
  var tag = "";
4575
4502
  var value = "";
4576
4503
  if (Array.isArray(entry)) {
4577
- var _entry_;
4504
+ var _entry_, _entry_1;
4578
4505
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4579
- var _entry_1;
4580
4506
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4581
4507
  } else if (typeof entry === "string") {
4582
4508
  var idx = entry.indexOf(":");
@@ -4626,10 +4552,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4626
4552
  }
4627
4553
  });
4628
4554
  } else if (tag.includes("EXT-X-DATERANGE")) {
4555
+ var _attrs_CLASS;
4629
4556
  var attrs = _this.parseAttributeList(value);
4630
4557
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4631
4558
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4632
- var _attrs_CLASS;
4633
4559
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4634
4560
  var duration = _this.toNumber(attrs["DURATION"]);
4635
4561
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5031,11 +4957,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5031
4957
  }
5032
4958
  var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
5033
4959
  if (daterangeMatch) {
5034
- var _daterangeMatch_;
4960
+ var _daterangeMatch_, _attrs_CLASS;
5035
4961
  var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
5036
4962
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
5037
4963
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
5038
- var _attrs_CLASS;
5039
4964
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
5040
4965
  var duration = this.toNumber(attrs["DURATION"]);
5041
4966
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5111,7 +5036,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5111
5036
  var out = "";
5112
5037
  for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
5113
5038
  return out;
5114
- } catch (e) {
5039
+ } catch (unused) {
5115
5040
  return void 0;
5116
5041
  }
5117
5042
  }
@@ -5130,6 +5055,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5130
5055
  });
5131
5056
  }
5132
5057
  if (marker.type === "start") {
5058
+ var _this_config_immediateManifestAds;
5133
5059
  var _this_pendingAdBreak;
5134
5060
  if (!this.video.muted) {
5135
5061
  this.video.muted = true;
@@ -5154,7 +5080,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5154
5080
  this.expectedAdBreakDurationMs = durationMs;
5155
5081
  this.currentAdBreakStartWallClockMs = Date.now();
5156
5082
  var isManifestMarker = this.isManifestBasedMarker(marker);
5157
- var _this_config_immediateManifestAds;
5158
5083
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
5159
5084
  if (this.config.debugAdTiming) {
5160
5085
  console.log("[StormcloudVideoPlayer] Ad start decision:", {
@@ -5309,9 +5234,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5309
5234
  var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
5310
5235
  var match;
5311
5236
  while((match = regex.exec(value)) !== null){
5312
- var _match_;
5237
+ var _match_, _ref, _match_1;
5313
5238
  var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
5314
- var _match_1, _ref;
5315
5239
  var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
5316
5240
  if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
5317
5241
  rawVal = rawVal.slice(1, -1);
@@ -5670,13 +5594,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5670
5594
  {
5671
5595
  key: "shouldShowNativeControls",
5672
5596
  value: function shouldShowNativeControls() {
5597
+ var _this_config_showCustomControls;
5673
5598
  var streamType = this.getStreamType();
5674
5599
  if (streamType === "other") {
5675
- var _this_config_showCustomControls;
5676
- return !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false);
5600
+ var _this_config_showCustomControls1;
5601
+ return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
5677
5602
  }
5678
- var _this_config_showCustomControls1;
5679
- return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
5603
+ return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
5680
5604
  }
5681
5605
  },
5682
5606
  {
@@ -5835,12 +5759,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5835
5759
  continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
5836
5760
  preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
5837
5761
  preloadIma.initialize();
5838
- errorListener = function(payload) {
5762
+ errorListener = function errorListener(payload) {
5839
5763
  hasAdError = true;
5840
5764
  adErrorPayload = payload;
5841
5765
  };
5842
5766
  preloadIma.on("ad_error", errorListener);
5843
- errorListenerCleanup = function() {
5767
+ errorListenerCleanup = function errorListenerCleanup() {
5844
5768
  return preloadIma.off("ad_error", errorListener);
5845
5769
  };
5846
5770
  return [
@@ -5891,7 +5815,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5891
5815
  isReady: true,
5892
5816
  loadPromise: Promise.resolve()
5893
5817
  };
5894
- lateErrorListener = function(payload) {
5818
+ lateErrorListener = function lateErrorListener(payload) {
5895
5819
  var index = _this.preloadPool.findIndex(function(entry) {
5896
5820
  return entry.vastUrl === vastUrl;
5897
5821
  });
@@ -5902,7 +5826,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5902
5826
  }
5903
5827
  try {
5904
5828
  preloadIma.destroy();
5905
- } catch (e) {}
5829
+ } catch (unused) {}
5906
5830
  }
5907
5831
  };
5908
5832
  preloadIma.on("ad_error", lateErrorListener);
@@ -6727,7 +6651,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6727
6651
  10
6728
6652
  ];
6729
6653
  nextAdUrl = this.adRequestQueue.shift();
6730
- if (!nextAdUrl) {
6654
+ if (nextAdUrl == null) {
6731
6655
  return [
6732
6656
  3,
6733
6657
  4
@@ -6913,7 +6837,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6913
6837
  9
6914
6838
  ];
6915
6839
  nextAdUrl = this.adRequestQueue.shift();
6916
- if (!nextAdUrl) {
6840
+ if (nextAdUrl == null) {
6917
6841
  return [
6918
6842
  3,
6919
6843
  3
@@ -7118,11 +7042,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7118
7042
  {
7119
7043
  key: "ensureAdStoppedByTimer",
7120
7044
  value: function ensureAdStoppedByTimer() {
7045
+ var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
7121
7046
  if (!this.inAdBreak) return;
7122
7047
  this.adStopTimerId = void 0;
7123
7048
  var adPlaying = this.ima.isAdPlaying();
7124
7049
  var pendingAds = this.adPodQueue.length > 0;
7125
- var _this_config_adBreakCheckIntervalMs;
7126
7050
  var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
7127
7051
  var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
7128
7052
  var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
@@ -7130,7 +7054,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7130
7054
  if (this.currentAdBreakStartWallClockMs != null) {
7131
7055
  elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
7132
7056
  }
7133
- var _this_expectedAdBreakDurationMs;
7134
7057
  var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
7135
7058
  var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
7136
7059
  var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
@@ -7387,15 +7310,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7387
7310
  9
7388
7311
  ];
7389
7312
  case 9:
7390
- if (this.isTemporaryAdError(playError)) {
7391
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7392
- if (this.config.debugAdTiming) {
7393
- console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7394
- }
7395
- } else {
7396
- this.failedVastUrls.add(vastTagUrl);
7397
- if (this.config.debugAdTiming) {
7398
- console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7313
+ if (vastTagUrl) {
7314
+ if (this.isTemporaryAdError(playError)) {
7315
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7316
+ if (this.config.debugAdTiming) {
7317
+ console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7318
+ }
7319
+ } else {
7320
+ this.failedVastUrls.add(vastTagUrl);
7321
+ if (this.config.debugAdTiming) {
7322
+ console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7323
+ }
7399
7324
  }
7400
7325
  }
7401
7326
  this.clearAdFailsafeTimer();
@@ -7464,15 +7389,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7464
7389
  15
7465
7390
  ];
7466
7391
  case 15:
7467
- if (this.isTemporaryAdError(error)) {
7468
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7469
- if (this.config.debugAdTiming) {
7470
- console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7471
- }
7472
- } else {
7473
- this.failedVastUrls.add(vastTagUrl);
7474
- if (this.config.debugAdTiming) {
7475
- console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7392
+ if (vastTagUrl) {
7393
+ if (this.isTemporaryAdError(error)) {
7394
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7395
+ if (this.config.debugAdTiming) {
7396
+ console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7397
+ }
7398
+ } else {
7399
+ this.failedVastUrls.add(vastTagUrl);
7400
+ if (this.config.debugAdTiming) {
7401
+ console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7402
+ }
7476
7403
  }
7477
7404
  }
7478
7405
  this.clearAdRequestWatchdog();
@@ -7575,8 +7502,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7575
7502
  key: "startAdRequestWatchdog",
7576
7503
  value: function startAdRequestWatchdog(token) {
7577
7504
  var _this = this;
7578
- this.clearAdRequestWatchdog();
7579
7505
  var _this_config_adFailsafeTimeoutMs;
7506
+ this.clearAdRequestWatchdog();
7580
7507
  var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7581
7508
  this.adRequestWatchdogToken = token;
7582
7509
  this.adRequestWatchdogId = window.setTimeout(function() {
@@ -7619,8 +7546,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7619
7546
  key: "startAdFailsafeTimer",
7620
7547
  value: function startAdFailsafeTimer(token) {
7621
7548
  var _this = this;
7622
- this.clearAdFailsafeTimer();
7623
7549
  var _this_config_adFailsafeTimeoutMs;
7550
+ this.clearAdFailsafeTimer();
7624
7551
  var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7625
7552
  this.adFailsafeToken = token;
7626
7553
  this.adFailsafeTimerId = window.setTimeout(function() {
@@ -7944,11 +7871,10 @@ var CRITICAL_PROPS = [
7944
7871
  "lowLatencyMode",
7945
7872
  "driftToleranceMs",
7946
7873
  "vastMode",
7947
- "adPlayerType",
7948
- "prebid"
7874
+ "adPlayerType"
7949
7875
  ];
7950
7876
  var StormcloudVideoPlayerComponent = React.memo(function(props) {
7951
- 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, [
7877
+ 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, [
7952
7878
  "src",
7953
7879
  "autoplay",
7954
7880
  "muted",
@@ -7976,7 +7902,6 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7976
7902
  "vastMode",
7977
7903
  "vastTagUrl",
7978
7904
  "adPlayerType",
7979
- "prebid",
7980
7905
  "minSegmentsBeforePlay"
7981
7906
  ]);
7982
7907
  var videoRef = useRef(null);
@@ -8003,21 +7928,21 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8003
7928
  var _React_useState14 = _sliced_to_array(React.useState(false), 2), showLicenseWarning = _React_useState14[0], setShowLicenseWarning = _React_useState14[1];
8004
7929
  var _React_useState15 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React_useState15[0], setViewportWidth = _React_useState15[1];
8005
7930
  var _React_useState16 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React_useState16[0], setIsPortrait = _React_useState16[1];
8006
- var getResponsiveScale = function() {
7931
+ var getResponsiveScale = function getResponsiveScale() {
8007
7932
  if (viewportWidth < 480) return 0.7;
8008
7933
  if (viewportWidth < 768) return 0.8;
8009
7934
  if (viewportWidth < 1024) return 0.9;
8010
7935
  return 1;
8011
7936
  };
8012
7937
  var responsiveScale = getResponsiveScale();
8013
- var formatTime = function(seconds) {
7938
+ var formatTime = function formatTime(seconds) {
8014
7939
  if (!isFinite(seconds)) return "0:00:00";
8015
7940
  var hours = Math.floor(seconds / 3600);
8016
7941
  var minutes = Math.floor(seconds % 3600 / 60);
8017
7942
  var remainingSeconds = Math.floor(seconds % 60);
8018
7943
  return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
8019
7944
  };
8020
- var handlePlayPause = function() {
7945
+ var handlePlayPause = function handlePlayPause() {
8021
7946
  if (videoRef.current) {
8022
7947
  if (videoRef.current.paused) {
8023
7948
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
@@ -8036,7 +7961,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8036
7961
  }
8037
7962
  }
8038
7963
  };
8039
- var handleCenterPlayClick = function() {
7964
+ var handleCenterPlayClick = function handleCenterPlayClick() {
8040
7965
  if (videoRef.current && videoRef.current.paused) {
8041
7966
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
8042
7967
  if (hasValidSource) {
@@ -8050,7 +7975,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8050
7975
  }
8051
7976
  }
8052
7977
  };
8053
- var handleTimelineSeek = function(e) {
7978
+ var handleTimelineSeek = function handleTimelineSeek(e) {
8054
7979
  if (videoRef.current && duration > 0 && isFinite(duration)) {
8055
7980
  var rect = e.currentTarget.getBoundingClientRect();
8056
7981
  var clickX = e.clientX - rect.left;
@@ -8061,13 +7986,13 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8061
7986
  }
8062
7987
  }
8063
7988
  };
8064
- var handleVolumeChange = function(newVolume) {
7989
+ var handleVolumeChange = function handleVolumeChange(newVolume) {
8065
7990
  if (playerRef.current && isFinite(newVolume)) {
8066
7991
  var clampedVolume = Math.max(0, Math.min(1, newVolume));
8067
7992
  playerRef.current.setVolume(clampedVolume);
8068
7993
  }
8069
7994
  };
8070
- var handlePlaybackRateChange = function(rate) {
7995
+ var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
8071
7996
  if (videoRef.current && isFinite(rate) && rate > 0) {
8072
7997
  videoRef.current.playbackRate = rate;
8073
7998
  }
@@ -8086,8 +8011,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8086
8011
  lowLatencyMode,
8087
8012
  driftToleranceMs,
8088
8013
  vastMode,
8089
- adPlayerType,
8090
- prebid
8014
+ adPlayerType
8091
8015
  ]);
8092
8016
  useEffect(function() {
8093
8017
  if (typeof window === "undefined") return;
@@ -8106,7 +8030,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8106
8030
  if (playerRef.current) {
8107
8031
  try {
8108
8032
  playerRef.current.destroy();
8109
- } catch (e) {}
8033
+ } catch (unused) {}
8110
8034
  playerRef.current = null;
8111
8035
  }
8112
8036
  var cfg = {
@@ -8128,7 +8052,6 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8128
8052
  if (vastMode !== void 0) cfg.vastMode = vastMode;
8129
8053
  if (vastTagUrl !== void 0) cfg.vastTagUrl = vastTagUrl;
8130
8054
  if (adPlayerType !== void 0) cfg.adPlayerType = adPlayerType;
8131
- if (prebid !== void 0) cfg.prebid = prebid;
8132
8055
  if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
8133
8056
  var player = new StormcloudVideoPlayer(cfg);
8134
8057
  playerRef.current = player;
@@ -8147,7 +8070,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8147
8070
  return function() {
8148
8071
  try {
8149
8072
  player.destroy();
8150
- } catch (e) {}
8073
+ } catch (unused) {}
8151
8074
  playerRef.current = null;
8152
8075
  };
8153
8076
  }, [
@@ -8171,7 +8094,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8171
8094
  ]);
8172
8095
  useEffect(function() {
8173
8096
  if (!playerRef.current) return;
8174
- var checkAdStatus = function() {
8097
+ var checkAdStatus = function checkAdStatus() {
8175
8098
  if (playerRef.current) {
8176
8099
  var _videoRef_current_dataset, _videoRef_current;
8177
8100
  var showAdsFromMethod = playerRef.current.isShowingAds();
@@ -8201,7 +8124,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8201
8124
  }, []);
8202
8125
  useEffect(function() {
8203
8126
  if (typeof window === "undefined" || !playerRef.current) return;
8204
- var handleResize = function() {
8127
+ var handleResize = function handleResize() {
8205
8128
  if (playerRef.current && videoRef.current) {
8206
8129
  if (typeof playerRef.current.resize === "function") {
8207
8130
  playerRef.current.resize();
@@ -8217,7 +8140,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8217
8140
  }, []);
8218
8141
  useEffect(function() {
8219
8142
  if (!playerRef.current || !videoRef.current) return;
8220
- var updateStates = function() {
8143
+ var updateStates = function updateStates() {
8221
8144
  var _videoRef_current;
8222
8145
  if (playerRef.current && videoRef.current) {
8223
8146
  setIsMuted(playerRef.current.isMuted());
@@ -8234,7 +8157,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8234
8157
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8235
8158
  };
8236
8159
  var interval = setInterval(updateStates, 200);
8237
- var handleFullscreenChange = function() {
8160
+ var handleFullscreenChange = function handleFullscreenChange() {
8238
8161
  var _videoRef_current;
8239
8162
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8240
8163
  };
@@ -8246,7 +8169,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8246
8169
  }, []);
8247
8170
  useEffect(function() {
8248
8171
  if (!videoRef.current) return;
8249
- var handleLoadedMetadata = function() {
8172
+ var handleLoadedMetadata = function handleLoadedMetadata() {
8250
8173
  if (videoRef.current) {
8251
8174
  var video2 = videoRef.current;
8252
8175
  void video2.offsetHeight;
@@ -8256,19 +8179,19 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8256
8179
  console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8257
8180
  }
8258
8181
  };
8259
- var handleLoadedData = function() {
8182
+ var handleLoadedData = function handleLoadedData() {
8260
8183
  if (debugAdTiming) {
8261
8184
  var _videoRef_current;
8262
8185
  console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8263
8186
  }
8264
8187
  };
8265
- var handleLoadStart = function() {
8188
+ var handleLoadStart = function handleLoadStart() {
8266
8189
  if (debugAdTiming) {
8267
8190
  var _videoRef_current;
8268
8191
  console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8269
8192
  }
8270
8193
  };
8271
- var handleCanPlay = function() {
8194
+ var handleCanPlay = function handleCanPlay() {
8272
8195
  setIsLoading(false);
8273
8196
  if (bufferingTimeoutRef.current) {
8274
8197
  clearTimeout(bufferingTimeoutRef.current);
@@ -8280,7 +8203,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8280
8203
  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");
8281
8204
  }
8282
8205
  };
8283
- var handleCanPlayThrough = function() {
8206
+ var handleCanPlayThrough = function handleCanPlayThrough() {
8284
8207
  setIsLoading(false);
8285
8208
  if (bufferingTimeoutRef.current) {
8286
8209
  clearTimeout(bufferingTimeoutRef.current);
@@ -8292,7 +8215,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8292
8215
  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");
8293
8216
  }
8294
8217
  };
8295
- var handleWaiting = function() {
8218
+ var handleWaiting = function handleWaiting() {
8296
8219
  if (bufferingTimeoutRef.current) {
8297
8220
  clearTimeout(bufferingTimeoutRef.current);
8298
8221
  }
@@ -8308,7 +8231,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8308
8231
  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)");
8309
8232
  }
8310
8233
  };
8311
- var handlePlaying = function() {
8234
+ var handlePlaying = function handlePlaying() {
8312
8235
  setIsLoading(false);
8313
8236
  if (bufferingTimeoutRef.current) {
8314
8237
  clearTimeout(bufferingTimeoutRef.current);
@@ -8321,7 +8244,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8321
8244
  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");
8322
8245
  }
8323
8246
  };
8324
- var handlePause = function() {
8247
+ var handlePause = function handlePause() {
8325
8248
  var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
8326
8249
  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";
8327
8250
  if (playerRef.current && !isAdActive) {
@@ -8330,7 +8253,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8330
8253
  setShowCenterPlay(false);
8331
8254
  }
8332
8255
  };
8333
- var handleEnded = function() {
8256
+ var handleEnded = function handleEnded() {
8334
8257
  setShowCenterPlay(true);
8335
8258
  };
8336
8259
  var video = videoRef.current;
@@ -8488,14 +8411,14 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8488
8411
  boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
8489
8412
  transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
8490
8413
  },
8491
- onMouseEnter: function(e) {
8414
+ onMouseEnter: function onMouseEnter(e) {
8492
8415
  var target = e.currentTarget;
8493
8416
  target.style.transform = "translate(-50%, -50%)";
8494
8417
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
8495
8418
  target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8496
8419
  target.style.borderColor = "rgba(255, 255, 255, 0.9)";
8497
8420
  },
8498
- onMouseLeave: function(e) {
8421
+ onMouseLeave: function onMouseLeave(e) {
8499
8422
  var target = e.currentTarget;
8500
8423
  target.style.transform = "translate(-50%, -50%)";
8501
8424
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
@@ -8602,12 +8525,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8602
8525
  minWidth: "".concat(48 * responsiveScale, "px"),
8603
8526
  minHeight: "".concat(48 * responsiveScale, "px")
8604
8527
  },
8605
- onMouseEnter: function(e) {
8528
+ onMouseEnter: function onMouseEnter(e) {
8606
8529
  var target = e.target;
8607
8530
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8608
8531
  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)";
8609
8532
  },
8610
- onMouseLeave: function(e) {
8533
+ onMouseLeave: function onMouseLeave(e) {
8611
8534
  var target = e.target;
8612
8535
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8613
8536
  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)";
@@ -8633,15 +8556,15 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8633
8556
  padding: "8px",
8634
8557
  margin: "-8px"
8635
8558
  },
8636
- onMouseEnter: function() {
8559
+ onMouseEnter: function onMouseEnter() {
8637
8560
  return setShowVolumeSlider(true);
8638
8561
  },
8639
- onMouseLeave: function() {
8562
+ onMouseLeave: function onMouseLeave() {
8640
8563
  return setShowVolumeSlider(false);
8641
8564
  },
8642
8565
  children: [
8643
8566
  /* @__PURE__ */ jsx("button", {
8644
- onClick: function() {
8567
+ onClick: function onClick() {
8645
8568
  if (playerRef.current) {
8646
8569
  playerRef.current.toggleMute();
8647
8570
  }
@@ -8665,12 +8588,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8665
8588
  minWidth: "".concat(44 * responsiveScale, "px"),
8666
8589
  minHeight: "".concat(44 * responsiveScale, "px")
8667
8590
  },
8668
- onMouseEnter: function(e) {
8591
+ onMouseEnter: function onMouseEnter(e) {
8669
8592
  var target = e.target;
8670
8593
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8671
8594
  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)";
8672
8595
  },
8673
- onMouseLeave: function(e) {
8596
+ onMouseLeave: function onMouseLeave(e) {
8674
8597
  var target = e.target;
8675
8598
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8676
8599
  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)";
@@ -8706,10 +8629,10 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8706
8629
  marginBottom: "-16px",
8707
8630
  zIndex: 9
8708
8631
  },
8709
- onMouseEnter: function() {
8632
+ onMouseEnter: function onMouseEnter() {
8710
8633
  return setShowVolumeSlider(true);
8711
8634
  },
8712
- onMouseLeave: function() {
8635
+ onMouseLeave: function onMouseLeave() {
8713
8636
  return setShowVolumeSlider(false);
8714
8637
  }
8715
8638
  }),
@@ -8734,12 +8657,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8734
8657
  zIndex: 10,
8735
8658
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8736
8659
  },
8737
- onMouseEnter: function(e) {
8660
+ onMouseEnter: function onMouseEnter(e) {
8738
8661
  setShowVolumeSlider(true);
8739
8662
  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)";
8740
8663
  e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
8741
8664
  },
8742
- onMouseLeave: function(e) {
8665
+ onMouseLeave: function onMouseLeave(e) {
8743
8666
  setShowVolumeSlider(false);
8744
8667
  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)";
8745
8668
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
@@ -8752,19 +8675,19 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8752
8675
  cursor: "pointer",
8753
8676
  transition: "transform 0.2s ease-in-out"
8754
8677
  },
8755
- onMouseEnter: function(e) {},
8756
- onMouseLeave: function(e) {},
8757
- onMouseDown: function(e) {
8678
+ onMouseEnter: function onMouseEnter(e) {},
8679
+ onMouseLeave: function onMouseLeave(e) {},
8680
+ onMouseDown: function onMouseDown(e) {
8758
8681
  e.preventDefault();
8759
8682
  var sliderElement = e.currentTarget;
8760
- var handleMouseMove = function(moveEvent) {
8683
+ var handleMouseMove = function handleMouseMove(moveEvent) {
8761
8684
  if (!sliderElement) return;
8762
8685
  var rect2 = sliderElement.getBoundingClientRect();
8763
8686
  var y2 = moveEvent.clientY - rect2.top;
8764
8687
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8765
8688
  handleVolumeChange(percentage2);
8766
8689
  };
8767
- var handleMouseUp = function() {
8690
+ var handleMouseUp = function handleMouseUp1() {
8768
8691
  document.removeEventListener("mousemove", handleMouseMove);
8769
8692
  document.removeEventListener("mouseup", handleMouseUp);
8770
8693
  };
@@ -8775,7 +8698,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8775
8698
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8776
8699
  handleVolumeChange(percentage);
8777
8700
  },
8778
- onClick: function(e) {
8701
+ onClick: function onClick(e) {
8779
8702
  e.stopPropagation();
8780
8703
  var rect = e.currentTarget.getBoundingClientRect();
8781
8704
  var y = e.clientY - rect.top;
@@ -8822,17 +8745,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8822
8745
  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",
8823
8746
  cursor: "grab"
8824
8747
  },
8825
- onMouseEnter: function(e) {
8748
+ onMouseEnter: function onMouseEnter(e) {
8826
8749
  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)";
8827
8750
  e.currentTarget.style.cursor = "grab";
8828
8751
  },
8829
- onMouseLeave: function(e) {
8752
+ onMouseLeave: function onMouseLeave(e) {
8830
8753
  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)";
8831
8754
  },
8832
- onMouseDown: function(e) {
8755
+ onMouseDown: function onMouseDown(e) {
8833
8756
  e.currentTarget.style.cursor = "grabbing";
8834
8757
  },
8835
- onMouseUp: function(e) {
8758
+ onMouseUp: function onMouseUp(e) {
8836
8759
  e.currentTarget.style.cursor = "grab";
8837
8760
  }
8838
8761
  })
@@ -8872,7 +8795,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8872
8795
  },
8873
8796
  children: [
8874
8797
  /* @__PURE__ */ jsxs("button", {
8875
- onClick: function() {
8798
+ onClick: function onClick() {
8876
8799
  return setShowSpeedMenu(!showSpeedMenu);
8877
8800
  },
8878
8801
  style: {
@@ -8891,12 +8814,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8891
8814
  minWidth: "".concat(56 * responsiveScale, "px"),
8892
8815
  minHeight: "".concat(40 * responsiveScale, "px")
8893
8816
  },
8894
- onMouseEnter: function(e) {
8817
+ onMouseEnter: function onMouseEnter(e) {
8895
8818
  var target = e.target;
8896
8819
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8897
8820
  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)";
8898
8821
  },
8899
- onMouseLeave: function(e) {
8822
+ onMouseLeave: function onMouseLeave(e) {
8900
8823
  var target = e.target;
8901
8824
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8902
8825
  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)";
@@ -8932,7 +8855,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8932
8855
  2
8933
8856
  ].map(function(speed) {
8934
8857
  return /* @__PURE__ */ jsxs("button", {
8935
- onClick: function() {
8858
+ onClick: function onClick() {
8936
8859
  return handlePlaybackRateChange(speed);
8937
8860
  },
8938
8861
  style: {
@@ -8950,12 +8873,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8950
8873
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8951
8874
  borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
8952
8875
  },
8953
- onMouseEnter: function(e) {
8876
+ onMouseEnter: function onMouseEnter(e) {
8954
8877
  if (playbackRate !== speed) {
8955
8878
  e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
8956
8879
  }
8957
8880
  },
8958
- onMouseLeave: function(e) {
8881
+ onMouseLeave: function onMouseLeave(e) {
8959
8882
  if (playbackRate !== speed) {
8960
8883
  e.target.style.background = "transparent";
8961
8884
  }
@@ -8970,7 +8893,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8970
8893
  ]
8971
8894
  }),
8972
8895
  /* @__PURE__ */ jsx("button", {
8973
- onClick: function() {
8896
+ onClick: function onClick() {
8974
8897
  if (onFullscreenToggle) {
8975
8898
  onFullscreenToggle();
8976
8899
  } else if (playerRef.current) {
@@ -8995,12 +8918,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8995
8918
  minWidth: "".concat(44 * responsiveScale, "px"),
8996
8919
  minHeight: "".concat(44 * responsiveScale, "px")
8997
8920
  },
8998
- onMouseEnter: function(e) {
8921
+ onMouseEnter: function onMouseEnter(e) {
8999
8922
  var target = e.target;
9000
8923
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
9001
8924
  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)";
9002
8925
  },
9003
- onMouseLeave: function(e) {
8926
+ onMouseLeave: function onMouseLeave(e) {
9004
8927
  var target = e.target;
9005
8928
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
9006
8929
  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)";
@@ -9044,15 +8967,15 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9044
8967
  padding: "8px",
9045
8968
  margin: "-8px"
9046
8969
  },
9047
- onMouseEnter: function() {
8970
+ onMouseEnter: function onMouseEnter() {
9048
8971
  return setShowVolumeSlider(true);
9049
8972
  },
9050
- onMouseLeave: function() {
8973
+ onMouseLeave: function onMouseLeave() {
9051
8974
  return setShowVolumeSlider(false);
9052
8975
  },
9053
8976
  children: [
9054
8977
  /* @__PURE__ */ jsx("button", {
9055
- onClick: function() {
8978
+ onClick: function onClick() {
9056
8979
  if (playerRef.current) {
9057
8980
  playerRef.current.toggleMute();
9058
8981
  }
@@ -9060,12 +8983,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9060
8983
  onVolumeToggle();
9061
8984
  }
9062
8985
  },
9063
- onMouseEnter: function(e) {
8986
+ onMouseEnter: function onMouseEnter(e) {
9064
8987
  var target = e.currentTarget;
9065
8988
  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)";
9066
8989
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9067
8990
  },
9068
- onMouseLeave: function(e) {
8991
+ onMouseLeave: function onMouseLeave(e) {
9069
8992
  var target = e.currentTarget;
9070
8993
  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)";
9071
8994
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9120,10 +9043,10 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9120
9043
  marginBottom: "-16px",
9121
9044
  zIndex: 9
9122
9045
  },
9123
- onMouseEnter: function() {
9046
+ onMouseEnter: function onMouseEnter() {
9124
9047
  return setShowVolumeSlider(true);
9125
9048
  },
9126
- onMouseLeave: function() {
9049
+ onMouseLeave: function onMouseLeave() {
9127
9050
  return setShowVolumeSlider(false);
9128
9051
  }
9129
9052
  }),
@@ -9148,12 +9071,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9148
9071
  zIndex: 10,
9149
9072
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
9150
9073
  },
9151
- onMouseEnter: function(e) {
9074
+ onMouseEnter: function onMouseEnter(e) {
9152
9075
  setShowVolumeSlider(true);
9153
9076
  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)";
9154
9077
  e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
9155
9078
  },
9156
- onMouseLeave: function(e) {
9079
+ onMouseLeave: function onMouseLeave(e) {
9157
9080
  setShowVolumeSlider(false);
9158
9081
  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)";
9159
9082
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
@@ -9166,17 +9089,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9166
9089
  cursor: "pointer",
9167
9090
  transition: "transform 0.2s ease-in-out"
9168
9091
  },
9169
- onMouseDown: function(e) {
9092
+ onMouseDown: function onMouseDown(e) {
9170
9093
  e.preventDefault();
9171
9094
  var sliderElement = e.currentTarget;
9172
- var handleMouseMove = function(moveEvent) {
9095
+ var handleMouseMove = function handleMouseMove(moveEvent) {
9173
9096
  if (!sliderElement) return;
9174
9097
  var rect2 = sliderElement.getBoundingClientRect();
9175
9098
  var y2 = moveEvent.clientY - rect2.top;
9176
9099
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
9177
9100
  handleVolumeChange(percentage2);
9178
9101
  };
9179
- var handleMouseUp = function() {
9102
+ var handleMouseUp = function handleMouseUp1() {
9180
9103
  document.removeEventListener("mousemove", handleMouseMove);
9181
9104
  document.removeEventListener("mouseup", handleMouseUp);
9182
9105
  };
@@ -9187,7 +9110,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9187
9110
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
9188
9111
  handleVolumeChange(percentage);
9189
9112
  },
9190
- onClick: function(e) {
9113
+ onClick: function onClick(e) {
9191
9114
  e.stopPropagation();
9192
9115
  var rect = e.currentTarget.getBoundingClientRect();
9193
9116
  var y = e.clientY - rect.top;
@@ -9236,17 +9159,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9236
9159
  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",
9237
9160
  cursor: "grab"
9238
9161
  },
9239
- onMouseEnter: function(e) {
9162
+ onMouseEnter: function onMouseEnter(e) {
9240
9163
  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)";
9241
9164
  e.currentTarget.style.cursor = "grab";
9242
9165
  },
9243
- onMouseLeave: function(e) {
9166
+ onMouseLeave: function onMouseLeave(e) {
9244
9167
  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)";
9245
9168
  },
9246
- onMouseDown: function(e) {
9169
+ onMouseDown: function onMouseDown(e) {
9247
9170
  e.currentTarget.style.cursor = "grabbing";
9248
9171
  },
9249
- onMouseUp: function(e) {
9172
+ onMouseUp: function onMouseUp(e) {
9250
9173
  e.currentTarget.style.cursor = "grab";
9251
9174
  }
9252
9175
  })
@@ -9258,7 +9181,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9258
9181
  ]
9259
9182
  }),
9260
9183
  /* @__PURE__ */ jsx("button", {
9261
- onClick: function() {
9184
+ onClick: function onClick() {
9262
9185
  if (onFullscreenToggle) {
9263
9186
  onFullscreenToggle();
9264
9187
  } else if (playerRef.current) {
@@ -9267,12 +9190,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9267
9190
  });
9268
9191
  }
9269
9192
  },
9270
- onMouseEnter: function(e) {
9193
+ onMouseEnter: function onMouseEnter(e) {
9271
9194
  var target = e.currentTarget;
9272
9195
  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)";
9273
9196
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9274
9197
  },
9275
- onMouseLeave: function(e) {
9198
+ onMouseLeave: function onMouseLeave(e) {
9276
9199
  var target = e.currentTarget;
9277
9200
  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)";
9278
9201
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9418,7 +9341,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
9418
9341
  // src/StormcloudPlayer.tsx
9419
9342
  import React3, { Component as Component4, Suspense } from "react";
9420
9343
  // src/props.ts
9421
- var noop = function() {};
9344
+ var noop = function noop() {};
9422
9345
  var defaultProps = {
9423
9346
  playing: false,
9424
9347
  loop: false,
@@ -9464,29 +9387,29 @@ var defaultProps = {
9464
9387
  // src/utils.ts
9465
9388
  import { lazy as reactLazy } from "react";
9466
9389
  var lazy = reactLazy;
9467
- var omit = function(object, keys) {
9390
+ var omit = function omit(object, keys) {
9468
9391
  var result = _object_spread({}, object);
9469
9392
  keys.forEach(function(key) {
9470
9393
  delete result[key];
9471
9394
  });
9472
9395
  return result;
9473
9396
  };
9474
- var isMediaStream = function(url) {
9397
+ var isMediaStream = function isMediaStream(url) {
9475
9398
  return typeof window !== "undefined" && window.MediaStream && _instanceof(url, window.MediaStream);
9476
9399
  };
9477
- var supportsWebKitPresentationMode = function() {
9400
+ var supportsWebKitPresentationMode = function supportsWebKitPresentationMode() {
9478
9401
  if (typeof window === "undefined") return false;
9479
9402
  var video = document.createElement("video");
9480
9403
  return "webkitSupportsPresentationMode" in video;
9481
9404
  };
9482
- var randomString = function() {
9405
+ var randomString = function randomString() {
9483
9406
  return Math.random().toString(36).substr(2, 9);
9484
9407
  };
9485
- var parseQuery = function(url) {
9408
+ var parseQuery = function parseQuery(url) {
9486
9409
  var query = {};
9487
9410
  var queryString = url.split("?")[1] || "";
9488
9411
  if (!queryString) return query;
9489
- var manualParse = function(qs) {
9412
+ var manualParse = function manualParse(qs) {
9490
9413
  qs.split("&").forEach(function(param) {
9491
9414
  var _param_split = _sliced_to_array(param.split("="), 2), key = _param_split[0], value = _param_split[1];
9492
9415
  if (key) {
@@ -9513,7 +9436,7 @@ var parseQuery = function(url) {
9513
9436
  }
9514
9437
  return query;
9515
9438
  };
9516
- var merge = function(target) {
9439
+ var merge = function merge1(target) {
9517
9440
  for(var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
9518
9441
  sources[_key - 1] = arguments[_key];
9519
9442
  }
@@ -9533,19 +9456,19 @@ var merge = function(target) {
9533
9456
  target
9534
9457
  ].concat(_to_consumable_array(sources)));
9535
9458
  };
9536
- var isObject = function(item) {
9459
+ var isObject = function isObject(item) {
9537
9460
  return item && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
9538
9461
  };
9539
9462
  var IS_BROWSER = typeof window !== "undefined" && window.document;
9540
9463
  var IS_GLOBAL = typeof globalThis !== "undefined" && globalThis.window && globalThis.window.document;
9541
9464
  var IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);
9542
9465
  var IS_SAFARI = IS_BROWSER && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
9543
- var SUPPORTS_HLS = function() {
9466
+ var SUPPORTS_HLS = function SUPPORTS_HLS() {
9544
9467
  if (!IS_BROWSER) return false;
9545
9468
  var video = document.createElement("video");
9546
9469
  return Boolean(video.canPlayType("application/vnd.apple.mpegurl"));
9547
9470
  };
9548
- var SUPPORTS_DASH = function() {
9471
+ var SUPPORTS_DASH = function SUPPORTS_DASH() {
9549
9472
  if (!IS_BROWSER) return false;
9550
9473
  var video = document.createElement("video");
9551
9474
  return Boolean(video.canPlayType("application/dash+xml"));
@@ -9557,23 +9480,23 @@ var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
9557
9480
  var VIDEO_EXTENSIONS = /\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)($|\?)/i;
9558
9481
  var AUDIO_EXTENSIONS = /\.(mp3|wav|ogg|aac|wma|flac|m4a)($|\?)/i;
9559
9482
  var canPlay = {
9560
- hls: function(url) {
9483
+ hls: function hls(url) {
9561
9484
  if (!url || typeof url !== "string") return false;
9562
9485
  return HLS_EXTENSIONS.test(url) || HLS_PATHS.test(url);
9563
9486
  },
9564
- dash: function(url) {
9487
+ dash: function dash(url) {
9565
9488
  if (!url || typeof url !== "string") return false;
9566
9489
  return DASH_EXTENSIONS.test(url);
9567
9490
  },
9568
- video: function(url) {
9491
+ video: function video(url) {
9569
9492
  if (!url || typeof url !== "string") return false;
9570
9493
  return VIDEO_EXTENSIONS.test(url);
9571
9494
  },
9572
- audio: function(url) {
9495
+ audio: function audio(url) {
9573
9496
  if (!url || typeof url !== "string") return false;
9574
9497
  return AUDIO_EXTENSIONS.test(url);
9575
9498
  },
9576
- file: function(url) {
9499
+ file: function file(url) {
9577
9500
  if (!url || typeof url !== "string") return false;
9578
9501
  return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url);
9579
9502
  }
@@ -9586,11 +9509,11 @@ var HlsPlayer = /*#__PURE__*/ function(Component) {
9586
9509
  function HlsPlayer() {
9587
9510
  _class_call_check(this, HlsPlayer);
9588
9511
  var _this;
9589
- var _this1, _arguments = arguments;
9590
- _this = _call_super(this, HlsPlayer, _to_consumable_array(_arguments)), _this1 = _this;
9591
- _this1.player = null;
9592
- _this1.mounted = false;
9593
- _this1.load = function() {
9512
+ var _this1;
9513
+ _this = _call_super(this, HlsPlayer, arguments), _this1 = _this;
9514
+ _this.player = null;
9515
+ _this.mounted = false;
9516
+ _this.load = function() {
9594
9517
  return _async_to_generator(function() {
9595
9518
  var _this_props_onMount, _this_props, config, _this_props_onReady, _this_props1, error, _this_props_onError, _this_props2;
9596
9519
  return _ts_generator(this, function(_state) {
@@ -9663,87 +9586,87 @@ var HlsPlayer = /*#__PURE__*/ function(Component) {
9663
9586
  });
9664
9587
  })();
9665
9588
  };
9666
- _this1.play = function() {
9667
- if (_this1.props.videoElement) {
9668
- var video = _this1.props.videoElement;
9589
+ _this.play = function() {
9590
+ if (_this.props.videoElement) {
9591
+ var video = _this.props.videoElement;
9669
9592
  var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
9670
9593
  if (hasValidSource) {
9671
9594
  var _video_play, _this_props_onPlay, _this_props;
9672
9595
  (_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
9673
9596
  var _this_props_onError, _this_props;
9674
9597
  console.error("[HlsPlayer] Failed to play:", error);
9675
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9598
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9676
9599
  });
9677
- (_this_props_onPlay = (_this_props = _this1.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9600
+ (_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9678
9601
  } else {
9679
9602
  console.warn("[HlsPlayer] Cannot play: video has no valid source");
9680
9603
  }
9681
9604
  }
9682
9605
  };
9683
- _this1.pause = function() {
9684
- if (_this1.props.videoElement) {
9606
+ _this.pause = function() {
9607
+ if (_this.props.videoElement) {
9685
9608
  var _this_props_onPause, _this_props;
9686
- _this1.props.videoElement.pause();
9687
- (_this_props_onPause = (_this_props = _this1.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9609
+ _this.props.videoElement.pause();
9610
+ (_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9688
9611
  }
9689
9612
  };
9690
- _this1.stop = function() {
9691
- _this1.pause();
9692
- if (_this1.props.videoElement) {
9693
- _this1.props.videoElement.currentTime = 0;
9613
+ _this.stop = function() {
9614
+ _this.pause();
9615
+ if (_this.props.videoElement) {
9616
+ _this.props.videoElement.currentTime = 0;
9694
9617
  }
9695
9618
  };
9696
- _this1.seekTo = function(seconds, keepPlaying) {
9697
- if (_this1.props.videoElement) {
9698
- _this1.props.videoElement.currentTime = seconds;
9619
+ _this.seekTo = function(seconds, keepPlaying) {
9620
+ if (_this.props.videoElement) {
9621
+ _this.props.videoElement.currentTime = seconds;
9699
9622
  if (!keepPlaying) {
9700
- _this1.pause();
9623
+ _this.pause();
9701
9624
  }
9702
9625
  }
9703
9626
  };
9704
- _this1.setVolume = function(volume) {
9705
- if (_this1.props.videoElement) {
9706
- _this1.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9627
+ _this.setVolume = function(volume) {
9628
+ if (_this.props.videoElement) {
9629
+ _this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9707
9630
  }
9708
9631
  };
9709
- _this1.mute = function() {
9710
- if (_this1.props.videoElement) {
9711
- _this1.props.videoElement.muted = true;
9632
+ _this.mute = function() {
9633
+ if (_this.props.videoElement) {
9634
+ _this.props.videoElement.muted = true;
9712
9635
  }
9713
9636
  };
9714
- _this1.unmute = function() {
9715
- if (_this1.props.videoElement) {
9716
- _this1.props.videoElement.muted = false;
9637
+ _this.unmute = function() {
9638
+ if (_this.props.videoElement) {
9639
+ _this.props.videoElement.muted = false;
9717
9640
  }
9718
9641
  };
9719
- _this1.setPlaybackRate = function(rate) {
9720
- if (_this1.props.videoElement && rate > 0) {
9721
- _this1.props.videoElement.playbackRate = rate;
9642
+ _this.setPlaybackRate = function(rate) {
9643
+ if (_this.props.videoElement && rate > 0) {
9644
+ _this.props.videoElement.playbackRate = rate;
9722
9645
  }
9723
9646
  };
9724
- _this1.getDuration = function() {
9725
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.duration)) {
9726
- return _this1.props.videoElement.duration;
9647
+ _this.getDuration = function() {
9648
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
9649
+ return _this.props.videoElement.duration;
9727
9650
  }
9728
9651
  return null;
9729
9652
  };
9730
- _this1.getCurrentTime = function() {
9731
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.currentTime)) {
9732
- return _this1.props.videoElement.currentTime;
9653
+ _this.getCurrentTime = function() {
9654
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
9655
+ return _this.props.videoElement.currentTime;
9733
9656
  }
9734
9657
  return null;
9735
9658
  };
9736
- _this1.getSecondsLoaded = function() {
9737
- if (_this1.props.videoElement && _this1.props.videoElement.buffered.length > 0) {
9738
- return _this1.props.videoElement.buffered.end(_this1.props.videoElement.buffered.length - 1);
9659
+ _this.getSecondsLoaded = function() {
9660
+ if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
9661
+ return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
9739
9662
  }
9740
9663
  return null;
9741
9664
  };
9742
- _this1.getInternalPlayer = function() {
9665
+ _this.getInternalPlayer = function() {
9743
9666
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
9744
- if (key === "player") return _this1.player;
9745
- if (key === "video") return _this1.props.videoElement;
9746
- if (key === "hls" && _this1.player) return _this1.player.hls;
9667
+ if (key === "player") return _this.player;
9668
+ if (key === "video") return _this.props.videoElement;
9669
+ if (key === "hls" && _this.player) return _this.player.hls;
9747
9670
  return null;
9748
9671
  };
9749
9672
  return _this;
@@ -9793,49 +9716,49 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
9793
9716
  function FilePlayer() {
9794
9717
  _class_call_check(this, FilePlayer);
9795
9718
  var _this;
9796
- var _this1, _arguments = arguments;
9797
- _this = _call_super(this, FilePlayer, _to_consumable_array(_arguments)), _this1 = _this;
9798
- _this1.mounted = false;
9799
- _this1.ready = false;
9800
- _this1.load = function() {
9719
+ var _this1;
9720
+ _this = _call_super(this, FilePlayer, arguments), _this1 = _this;
9721
+ _this.mounted = false;
9722
+ _this.ready = false;
9723
+ _this.load = function() {
9801
9724
  var _this_props_onMount, _this_props;
9802
- if (!_this1.props.videoElement || !_this1.props.src) return;
9803
- var video = _this1.props.videoElement;
9804
- var handleLoadedMetadata = function() {
9805
- if (_this1.mounted && !_this1.ready) {
9725
+ if (!_this.props.videoElement || !_this.props.src) return;
9726
+ var video = _this.props.videoElement;
9727
+ var handleLoadedMetadata = function handleLoadedMetadata() {
9728
+ if (_this.mounted && !_this.ready) {
9806
9729
  var _this_props_onReady, _this_props;
9807
- _this1.ready = true;
9808
- (_this_props_onReady = (_this_props = _this1.props).onReady) === null || _this_props_onReady === void 0 ? void 0 : _this_props_onReady.call(_this_props);
9730
+ _this.ready = true;
9731
+ (_this_props_onReady = (_this_props = _this.props).onReady) === null || _this_props_onReady === void 0 ? void 0 : _this_props_onReady.call(_this_props);
9809
9732
  }
9810
9733
  };
9811
- var handlePlay = function() {
9812
- if (_this1.mounted) {
9734
+ var handlePlay = function handlePlay() {
9735
+ if (_this.mounted) {
9813
9736
  var _this_props_onPlay, _this_props;
9814
- (_this_props_onPlay = (_this_props = _this1.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9737
+ (_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9815
9738
  }
9816
9739
  };
9817
- var handlePause = function() {
9818
- if (_this1.mounted) {
9740
+ var handlePause = function handlePause() {
9741
+ if (_this.mounted) {
9819
9742
  var _this_props_onPause, _this_props;
9820
- (_this_props_onPause = (_this_props = _this1.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9743
+ (_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9821
9744
  }
9822
9745
  };
9823
- var handleEnded = function() {
9824
- if (_this1.mounted) {
9746
+ var handleEnded = function handleEnded() {
9747
+ if (_this.mounted) {
9825
9748
  var _this_props_onEnded, _this_props;
9826
- (_this_props_onEnded = (_this_props = _this1.props).onEnded) === null || _this_props_onEnded === void 0 ? void 0 : _this_props_onEnded.call(_this_props);
9749
+ (_this_props_onEnded = (_this_props = _this.props).onEnded) === null || _this_props_onEnded === void 0 ? void 0 : _this_props_onEnded.call(_this_props);
9827
9750
  }
9828
9751
  };
9829
- var handleError = function(error) {
9830
- if (_this1.mounted) {
9752
+ var handleError = function handleError(error) {
9753
+ if (_this.mounted) {
9831
9754
  var _this_props_onError, _this_props;
9832
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9755
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9833
9756
  }
9834
9757
  };
9835
- var handleLoadedData = function() {
9836
- if (_this1.mounted) {
9758
+ var handleLoadedData = function handleLoadedData() {
9759
+ if (_this.mounted) {
9837
9760
  var _this_props_onLoaded, _this_props;
9838
- (_this_props_onLoaded = (_this_props = _this1.props).onLoaded) === null || _this_props_onLoaded === void 0 ? void 0 : _this_props_onLoaded.call(_this_props);
9761
+ (_this_props_onLoaded = (_this_props = _this.props).onLoaded) === null || _this_props_onLoaded === void 0 ? void 0 : _this_props_onLoaded.call(_this_props);
9839
9762
  }
9840
9763
  };
9841
9764
  video.addEventListener("loadedmetadata", handleLoadedMetadata);
@@ -9844,15 +9767,15 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
9844
9767
  video.addEventListener("ended", handleEnded);
9845
9768
  video.addEventListener("error", handleError);
9846
9769
  video.addEventListener("loadeddata", handleLoadedData);
9847
- video.src = _this1.props.src;
9848
- if (_this1.props.autoplay !== void 0) video.autoplay = _this1.props.autoplay;
9849
- if (_this1.props.muted !== void 0) video.muted = _this1.props.muted;
9850
- if (_this1.props.loop !== void 0) video.loop = _this1.props.loop;
9851
- if (_this1.props.controls !== void 0) video.controls = _this1.props.controls;
9852
- if (_this1.props.playsInline !== void 0) video.playsInline = _this1.props.playsInline;
9853
- if (_this1.props.preload !== void 0) video.preload = _this1.props.preload;
9854
- if (_this1.props.poster !== void 0) video.poster = _this1.props.poster;
9855
- (_this_props_onMount = (_this_props = _this1.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this1);
9770
+ video.src = _this.props.src;
9771
+ if (_this.props.autoplay !== void 0) video.autoplay = _this.props.autoplay;
9772
+ if (_this.props.muted !== void 0) video.muted = _this.props.muted;
9773
+ if (_this.props.loop !== void 0) video.loop = _this.props.loop;
9774
+ if (_this.props.controls !== void 0) video.controls = _this.props.controls;
9775
+ if (_this.props.playsInline !== void 0) video.playsInline = _this.props.playsInline;
9776
+ if (_this.props.preload !== void 0) video.preload = _this.props.preload;
9777
+ if (_this.props.poster !== void 0) video.poster = _this.props.poster;
9778
+ (_this_props_onMount = (_this_props = _this.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this);
9856
9779
  return function() {
9857
9780
  video.removeEventListener("loadedmetadata", handleLoadedMetadata);
9858
9781
  video.removeEventListener("play", handlePlay);
@@ -9862,90 +9785,90 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
9862
9785
  video.removeEventListener("loadeddata", handleLoadedData);
9863
9786
  };
9864
9787
  };
9865
- _this1.play = function() {
9866
- if (_this1.props.videoElement) {
9867
- var video = _this1.props.videoElement;
9788
+ _this.play = function() {
9789
+ if (_this.props.videoElement) {
9790
+ var video = _this.props.videoElement;
9868
9791
  var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
9869
9792
  if (hasValidSource) {
9870
9793
  var _video_play;
9871
9794
  (_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
9872
9795
  var _this_props_onError, _this_props;
9873
9796
  console.error("[FilePlayer] Failed to play:", error);
9874
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9797
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9875
9798
  });
9876
9799
  } else {
9877
9800
  console.warn("[FilePlayer] Cannot play: video has no valid source");
9878
9801
  }
9879
9802
  }
9880
9803
  };
9881
- _this1.pause = function() {
9882
- if (_this1.props.videoElement) {
9883
- _this1.props.videoElement.pause();
9804
+ _this.pause = function() {
9805
+ if (_this.props.videoElement) {
9806
+ _this.props.videoElement.pause();
9884
9807
  }
9885
9808
  };
9886
- _this1.stop = function() {
9887
- _this1.pause();
9888
- if (_this1.props.videoElement) {
9889
- _this1.props.videoElement.currentTime = 0;
9809
+ _this.stop = function() {
9810
+ _this.pause();
9811
+ if (_this.props.videoElement) {
9812
+ _this.props.videoElement.currentTime = 0;
9890
9813
  }
9891
9814
  };
9892
- _this1.seekTo = function(seconds, keepPlaying) {
9893
- if (_this1.props.videoElement) {
9894
- _this1.props.videoElement.currentTime = seconds;
9815
+ _this.seekTo = function(seconds, keepPlaying) {
9816
+ if (_this.props.videoElement) {
9817
+ _this.props.videoElement.currentTime = seconds;
9895
9818
  if (!keepPlaying) {
9896
- _this1.pause();
9819
+ _this.pause();
9897
9820
  }
9898
9821
  }
9899
9822
  };
9900
- _this1.setVolume = function(volume) {
9901
- if (_this1.props.videoElement) {
9902
- _this1.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9823
+ _this.setVolume = function(volume) {
9824
+ if (_this.props.videoElement) {
9825
+ _this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9903
9826
  }
9904
9827
  };
9905
- _this1.mute = function() {
9906
- if (_this1.props.videoElement) {
9907
- _this1.props.videoElement.muted = true;
9828
+ _this.mute = function() {
9829
+ if (_this.props.videoElement) {
9830
+ _this.props.videoElement.muted = true;
9908
9831
  }
9909
9832
  };
9910
- _this1.unmute = function() {
9911
- if (_this1.props.videoElement) {
9912
- _this1.props.videoElement.muted = false;
9833
+ _this.unmute = function() {
9834
+ if (_this.props.videoElement) {
9835
+ _this.props.videoElement.muted = false;
9913
9836
  }
9914
9837
  };
9915
- _this1.setPlaybackRate = function(rate) {
9916
- if (_this1.props.videoElement && rate > 0) {
9917
- _this1.props.videoElement.playbackRate = rate;
9838
+ _this.setPlaybackRate = function(rate) {
9839
+ if (_this.props.videoElement && rate > 0) {
9840
+ _this.props.videoElement.playbackRate = rate;
9918
9841
  }
9919
9842
  };
9920
- _this1.setLoop = function(loop) {
9921
- if (_this1.props.videoElement) {
9922
- _this1.props.videoElement.loop = loop;
9843
+ _this.setLoop = function(loop) {
9844
+ if (_this.props.videoElement) {
9845
+ _this.props.videoElement.loop = loop;
9923
9846
  }
9924
9847
  };
9925
- _this1.getDuration = function() {
9926
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.duration)) {
9927
- return _this1.props.videoElement.duration;
9848
+ _this.getDuration = function() {
9849
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
9850
+ return _this.props.videoElement.duration;
9928
9851
  }
9929
9852
  return null;
9930
9853
  };
9931
- _this1.getCurrentTime = function() {
9932
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.currentTime)) {
9933
- return _this1.props.videoElement.currentTime;
9854
+ _this.getCurrentTime = function() {
9855
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
9856
+ return _this.props.videoElement.currentTime;
9934
9857
  }
9935
9858
  return null;
9936
9859
  };
9937
- _this1.getSecondsLoaded = function() {
9938
- if (_this1.props.videoElement && _this1.props.videoElement.buffered.length > 0) {
9939
- return _this1.props.videoElement.buffered.end(_this1.props.videoElement.buffered.length - 1);
9860
+ _this.getSecondsLoaded = function() {
9861
+ if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
9862
+ return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
9940
9863
  }
9941
9864
  return null;
9942
9865
  };
9943
- _this1.getInternalPlayer = function() {
9866
+ _this.getInternalPlayer = function() {
9944
9867
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
9945
- if (key === "video") return _this1.props.videoElement;
9868
+ if (key === "video") return _this.props.videoElement;
9946
9869
  return null;
9947
9870
  };
9948
- _this1.enablePIP = function() {
9871
+ _this.enablePIP = function() {
9949
9872
  return _async_to_generator(function() {
9950
9873
  var error;
9951
9874
  return _ts_generator(this, function(_state) {
@@ -9988,7 +9911,7 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
9988
9911
  });
9989
9912
  })();
9990
9913
  };
9991
- _this1.disablePIP = function() {
9914
+ _this.disablePIP = function() {
9992
9915
  return _async_to_generator(function() {
9993
9916
  var error;
9994
9917
  return _ts_generator(this, function(_state) {
@@ -10082,7 +10005,7 @@ var players = [
10082
10005
  key: "file",
10083
10006
  name: "File Player",
10084
10007
  canPlay: canPlay.file,
10085
- canEnablePIP: function(url) {
10008
+ canEnablePIP: function canEnablePIP(url) {
10086
10009
  return canPlay.file(url) && (document.pictureInPictureEnabled || typeof document.webkitSupportsPresentationMode === "function");
10087
10010
  },
10088
10011
  lazyPlayer: lazy(function() {
@@ -10409,7 +10332,7 @@ var SUPPORTED_PROPS = [
10409
10332
  "onControlClick"
10410
10333
  ];
10411
10334
  var customPlayers = [];
10412
- var createStormcloudPlayer = function(playerList, fallback) {
10335
+ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallback) {
10413
10336
  var _a;
10414
10337
  return _a = /*#__PURE__*/ function(Component4) {
10415
10338
  "use strict";
@@ -10422,10 +10345,10 @@ var createStormcloudPlayer = function(playerList, fallback) {
10422
10345
  showPreview: false
10423
10346
  };
10424
10347
  _this.references = {
10425
- wrapper: function(wrapper) {
10348
+ wrapper: function wrapper(wrapper) {
10426
10349
  _this.wrapper = wrapper;
10427
10350
  },
10428
- player: function(player) {
10351
+ player: function player(player) {
10429
10352
  _this.player = player;
10430
10353
  }
10431
10354
  };