stormcloud-video-player 0.5.3 → 0.5.5

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.
package/lib/index.cjs CHANGED
@@ -181,12 +181,22 @@ function _object_spread_props(target, source) {
181
181
  }
182
182
  function _object_without_properties(source, excluded) {
183
183
  if (source == null) return {};
184
- var target = _object_without_properties_loose(source, excluded);
185
- var key, i;
184
+ var target = {}, sourceKeys, key, i;
185
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
186
+ sourceKeys = Reflect.ownKeys(Object(source));
187
+ for(i = 0; i < sourceKeys.length; i++){
188
+ key = sourceKeys[i];
189
+ if (excluded.indexOf(key) >= 0) continue;
190
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
191
+ target[key] = source[key];
192
+ }
193
+ return target;
194
+ }
195
+ target = _object_without_properties_loose(source, excluded);
186
196
  if (Object.getOwnPropertySymbols) {
187
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
188
- for(i = 0; i < sourceSymbolKeys.length; i++){
189
- key = sourceSymbolKeys[i];
197
+ sourceKeys = Object.getOwnPropertySymbols(source);
198
+ for(i = 0; i < sourceKeys.length; i++){
199
+ key = sourceKeys[i];
190
200
  if (excluded.indexOf(key) >= 0) continue;
191
201
  if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
192
202
  target[key] = source[key];
@@ -196,12 +206,11 @@ function _object_without_properties(source, excluded) {
196
206
  }
197
207
  function _object_without_properties_loose(source, excluded) {
198
208
  if (source == null) return {};
199
- var target = {};
200
- var sourceKeys = Object.keys(source);
201
- var key, i;
209
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
202
210
  for(i = 0; i < sourceKeys.length; i++){
203
211
  key = sourceKeys[i];
204
212
  if (excluded.indexOf(key) >= 0) continue;
213
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
205
214
  target[key] = source[key];
206
215
  }
207
216
  return target;
@@ -254,9 +263,17 @@ function _ts_generator(thisArg, body) {
254
263
  },
255
264
  trys: [],
256
265
  ops: []
257
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
258
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
259
- return this;
266
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
267
+ return d(g, "next", {
268
+ value: verb(0)
269
+ }), d(g, "throw", {
270
+ value: verb(1)
271
+ }), d(g, "return", {
272
+ value: verb(2)
273
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
274
+ value: function() {
275
+ return this;
276
+ }
260
277
  }), g;
261
278
  function verb(n) {
262
279
  return function(v) {
@@ -356,20 +373,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
356
373
  var __getOwnPropNames = Object.getOwnPropertyNames;
357
374
  var __getProtoOf = Object.getPrototypeOf;
358
375
  var __hasOwnProp = Object.prototype.hasOwnProperty;
359
- var __export = function(target, all) {
376
+ var __export = function __export(target, all) {
360
377
  for(var name in all)__defProp(target, name, {
361
378
  get: all[name],
362
379
  enumerable: true
363
380
  });
364
381
  };
365
- var __copyProps = function(to, from, except, desc) {
382
+ var __copyProps = function __copyProps(to, from, except, desc) {
366
383
  if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
367
384
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
368
385
  try {
369
386
  var _loop = function() {
370
387
  var key = _step.value;
371
388
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
372
- get: function() {
389
+ get: function get() {
373
390
  return from[key];
374
391
  },
375
392
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
@@ -393,7 +410,7 @@ var __copyProps = function(to, from, except, desc) {
393
410
  }
394
411
  return to;
395
412
  };
396
- var __toESM = function(mod, isNodeMode, target) {
413
+ var __toESM = function __toESM(mod, isNodeMode, target) {
397
414
  return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
398
415
  // file that has been converted to a CommonJS file using a Babel-
399
416
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -403,7 +420,7 @@ var __toESM = function(mod, isNodeMode, target) {
403
420
  enumerable: true
404
421
  }) : target, mod);
405
422
  };
406
- var __toCommonJS = function(mod) {
423
+ var __toCommonJS = function __toCommonJS(mod) {
407
424
  return __copyProps(__defProp({}, "__esModule", {
408
425
  value: true
409
426
  }), mod);
@@ -411,112 +428,112 @@ var __toCommonJS = function(mod) {
411
428
  // src/index.ts
412
429
  var index_exports = {};
413
430
  __export(index_exports, {
414
- IS_BROWSER: function() {
431
+ IS_BROWSER: function IS_BROWSER1() {
415
432
  return IS_BROWSER;
416
433
  },
417
- IS_GLOBAL: function() {
434
+ IS_GLOBAL: function IS_GLOBAL1() {
418
435
  return IS_GLOBAL;
419
436
  },
420
- IS_IOS: function() {
437
+ IS_IOS: function IS_IOS1() {
421
438
  return IS_IOS;
422
439
  },
423
- IS_SAFARI: function() {
440
+ IS_SAFARI: function IS_SAFARI1() {
424
441
  return IS_SAFARI;
425
442
  },
426
- SUPPORTS_DASH: function() {
443
+ SUPPORTS_DASH: function SUPPORTS_DASH1() {
427
444
  return SUPPORTS_DASH;
428
445
  },
429
- SUPPORTS_HLS: function() {
446
+ SUPPORTS_HLS: function SUPPORTS_HLS1() {
430
447
  return SUPPORTS_HLS;
431
448
  },
432
- StormcloudPlayer: function() {
449
+ StormcloudPlayer: function StormcloudPlayer() {
433
450
  return StormcloudPlayer_default;
434
451
  },
435
- StormcloudVideoPlayer: function() {
452
+ StormcloudVideoPlayer: function StormcloudVideoPlayer1() {
436
453
  return StormcloudVideoPlayer;
437
454
  },
438
- StormcloudVideoPlayerComponent: function() {
455
+ StormcloudVideoPlayerComponent: function StormcloudVideoPlayerComponent1() {
439
456
  return StormcloudVideoPlayerComponent;
440
457
  },
441
- canPlay: function() {
458
+ canPlay: function canPlay1() {
442
459
  return canPlay;
443
460
  },
444
- createHlsAdPlayer: function() {
461
+ createHlsAdPlayer: function createHlsAdPlayer1() {
445
462
  return createHlsAdPlayer;
446
463
  },
447
- createImaController: function() {
464
+ createImaController: function createImaController1() {
448
465
  return createImaController;
449
466
  },
450
- createPrebidController: function() {
467
+ createPrebidController: function createPrebidController1() {
451
468
  return createPrebidController;
452
469
  },
453
- createPrebidManager: function() {
470
+ createPrebidManager: function createPrebidManager1() {
454
471
  return createPrebidManager;
455
472
  },
456
- createStormcloudPlayer: function() {
473
+ createStormcloudPlayer: function createStormcloudPlayer1() {
457
474
  return createStormcloudPlayer;
458
475
  },
459
- default: function() {
476
+ default: function _default() {
460
477
  return StormcloudVideoPlayerComponent;
461
478
  },
462
- detectBrowser: function() {
479
+ detectBrowser: function detectBrowser1() {
463
480
  return detectBrowser;
464
481
  },
465
- getBrowserConfigOverrides: function() {
482
+ getBrowserConfigOverrides: function getBrowserConfigOverrides1() {
466
483
  return getBrowserConfigOverrides;
467
484
  },
468
- getBrowserID: function() {
485
+ getBrowserID: function getBrowserID1() {
469
486
  return getBrowserID;
470
487
  },
471
- getClientInfo: function() {
488
+ getClientInfo: function getClientInfo1() {
472
489
  return getClientInfo;
473
490
  },
474
- getRecommendedAdPlayer: function() {
491
+ getRecommendedAdPlayer: function getRecommendedAdPlayer1() {
475
492
  return getRecommendedAdPlayer;
476
493
  },
477
- initializePolyfills: function() {
494
+ initializePolyfills: function initializePolyfills1() {
478
495
  return initializePolyfills;
479
496
  },
480
- isMediaStream: function() {
497
+ isMediaStream: function isMediaStream1() {
481
498
  return isMediaStream;
482
499
  },
483
- lazy: function() {
500
+ lazy: function lazy1() {
484
501
  return lazy;
485
502
  },
486
- logBrowserInfo: function() {
503
+ logBrowserInfo: function logBrowserInfo1() {
487
504
  return logBrowserInfo;
488
505
  },
489
- merge: function() {
506
+ merge: function merge1() {
490
507
  return merge;
491
508
  },
492
- omit: function() {
509
+ omit: function omit1() {
493
510
  return omit;
494
511
  },
495
- parseQuery: function() {
512
+ parseQuery: function parseQuery1() {
496
513
  return parseQuery;
497
514
  },
498
- players: function() {
515
+ players: function players() {
499
516
  return players_default;
500
517
  },
501
- randomString: function() {
518
+ randomString: function randomString1() {
502
519
  return randomString;
503
520
  },
504
- sendHeartbeat: function() {
521
+ sendHeartbeat: function sendHeartbeat1() {
505
522
  return sendHeartbeat;
506
523
  },
507
- sendInitialTracking: function() {
524
+ sendInitialTracking: function sendInitialTracking1() {
508
525
  return sendInitialTracking;
509
526
  },
510
- supportsFeature: function() {
527
+ supportsFeature: function supportsFeature1() {
511
528
  return supportsFeature;
512
529
  },
513
- supportsGoogleIMA: function() {
530
+ supportsGoogleIMA: function supportsGoogleIMA1() {
514
531
  return supportsGoogleIMA;
515
532
  },
516
- supportsModernJS: function() {
533
+ supportsModernJS: function supportsModernJS1() {
517
534
  return supportsModernJS;
518
535
  },
519
- supportsWebKitPresentationMode: function() {
536
+ supportsWebKitPresentationMode: function supportsWebKitPresentationMode1() {
520
537
  return supportsWebKitPresentationMode;
521
538
  }
522
539
  });
@@ -881,7 +898,7 @@ function createImaController(video, options) {
881
898
  var fn = _step.value;
882
899
  try {
883
900
  fn(payload);
884
- } catch (e) {}
901
+ } catch (unused) {}
885
902
  }
886
903
  } catch (err) {
887
904
  _didIteratorError = true;
@@ -919,7 +936,7 @@ function createImaController(video, options) {
919
936
  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'.");
920
937
  }
921
938
  }
922
- } catch (e) {}
939
+ } catch (unused) {}
923
940
  if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
924
941
  var existing = document.querySelector('script[data-ima="true"]');
925
942
  if (existing) {
@@ -1167,7 +1184,7 @@ function createImaController(video, options) {
1167
1184
  if (adsManager) {
1168
1185
  try {
1169
1186
  adsManager.destroy();
1170
- } catch (e) {}
1187
+ } catch (unused) {}
1171
1188
  adsManager = void 0;
1172
1189
  }
1173
1190
  if (adVideoElement) {
@@ -1178,7 +1195,7 @@ function createImaController(video, options) {
1178
1195
  if (adsLoader) {
1179
1196
  try {
1180
1197
  adsLoader.destroy();
1181
- } catch (e) {}
1198
+ } catch (unused) {}
1182
1199
  adsLoader = void 0;
1183
1200
  }
1184
1201
  }
@@ -1196,7 +1213,7 @@ function createImaController(video, options) {
1196
1213
  try {
1197
1214
  var _adDisplayContainer_initialize;
1198
1215
  (_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
1199
- } catch (e) {}
1216
+ } catch (unused) {}
1200
1217
  }
1201
1218
  }).catch(function() {});
1202
1219
  },
@@ -1355,7 +1372,7 @@ function createImaController(video, options) {
1355
1372
  window.setTimeout(function() {
1356
1373
  try {
1357
1374
  makeAdsRequest(google, lastAdTagUrl);
1358
- } catch (e) {}
1375
+ } catch (unused) {}
1359
1376
  }, delay);
1360
1377
  } else {
1361
1378
  emit("ad_error", {
@@ -1387,7 +1404,7 @@ function createImaController(video, options) {
1387
1404
  if (adsManager) {
1388
1405
  try {
1389
1406
  adsManager.setVolume(adVolume);
1390
- } catch (e) {}
1407
+ } catch (unused) {}
1391
1408
  }
1392
1409
  emit("content_pause");
1393
1410
  });
@@ -1401,7 +1418,7 @@ function createImaController(video, options) {
1401
1418
  if (adsManager) {
1402
1419
  try {
1403
1420
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1404
- } catch (e) {}
1421
+ } catch (unused) {}
1405
1422
  }
1406
1423
  }
1407
1424
  if (adContainerEl) {
@@ -1562,7 +1579,7 @@ function createImaController(video, options) {
1562
1579
  }
1563
1580
  try {
1564
1581
  adsManager.setVolume(originalMutedState ? 0 : adVolume);
1565
- } catch (e) {}
1582
+ } catch (unused) {}
1566
1583
  adsManager.start();
1567
1584
  return [
1568
1585
  2,
@@ -1644,7 +1661,7 @@ function createImaController(video, options) {
1644
1661
  try {
1645
1662
  ;
1646
1663
  adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
1647
- } catch (e) {}
1664
+ } catch (unused) {}
1648
1665
  destroyAdsManager();
1649
1666
  return [
1650
1667
  2
@@ -1675,7 +1692,7 @@ function createImaController(video, options) {
1675
1692
  try {
1676
1693
  var _adsLoader_destroy;
1677
1694
  adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
1678
- } catch (e) {}
1695
+ } catch (unused) {}
1679
1696
  adDisplayContainer = void 0;
1680
1697
  adsLoader = void 0;
1681
1698
  contentVideoHidden = false;
@@ -1724,7 +1741,7 @@ function createImaController(video, options) {
1724
1741
  if (adsManager && adPlaying) {
1725
1742
  try {
1726
1743
  adsManager.setVolume(clampedVolume);
1727
- } catch (e) {}
1744
+ } catch (unused) {}
1728
1745
  }
1729
1746
  },
1730
1747
  getAdVolume: function getAdVolume() {
@@ -2212,10 +2229,10 @@ function createHlsAdPlayer(contentVideo, options) {
2212
2229
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
2213
2230
  if (contentVideo.paused) {
2214
2231
  console.log("[HlsAdPlayer] Content video paused in live mode, resuming playback");
2215
- contentVideo.play().catch(function() {});
2216
2232
  } else {
2217
2233
  console.log("[HlsAdPlayer] Content video already playing in live mode");
2218
2234
  }
2235
+ contentVideo.play().catch(function() {});
2219
2236
  }
2220
2237
  emit("content_resume");
2221
2238
  }
@@ -2488,8 +2505,8 @@ function createHlsAdPlayer(contentVideo, options) {
2488
2505
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
2489
2506
  if (contentVideo.paused) {
2490
2507
  console.log("[HlsAdPlayer] Content video paused in live mode, resuming playback on stop");
2491
- contentVideo.play().catch(function() {});
2492
2508
  }
2509
+ contentVideo.play().catch(function() {});
2493
2510
  }
2494
2511
  if (adHls) {
2495
2512
  adHls.destroy();
@@ -2498,6 +2515,8 @@ function createHlsAdPlayer(contentVideo, options) {
2498
2515
  if (adVideoElement) {
2499
2516
  adVideoElement.pause();
2500
2517
  adVideoElement.src = "";
2518
+ adVideoElement.remove();
2519
+ adVideoElement = void 0;
2501
2520
  }
2502
2521
  currentAd = void 0;
2503
2522
  return [
@@ -2640,8 +2659,8 @@ var DEFAULT_TIMEOUT_MS = 3e3;
2640
2659
  var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
2641
2660
  function createPrebidManager() {
2642
2661
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2643
- var initialized = false;
2644
2662
  var _options_debug;
2663
+ var initialized = false;
2645
2664
  var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
2646
2665
  function log() {
2647
2666
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
@@ -3143,13 +3162,15 @@ function createPrebidController(contentVideo, options) {
3143
3162
  adContainerEl.style.display = "none";
3144
3163
  adContainerEl.style.pointerEvents = "none";
3145
3164
  }
3165
+ contentVideo.style.visibility = "visible";
3166
+ contentVideo.style.opacity = "1";
3146
3167
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
3147
3168
  if (contentVideo.paused) {
3148
3169
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
3149
- contentVideo.play().catch(function() {});
3150
3170
  } else {
3151
3171
  console.log("".concat(LOG, " Content video already playing in live mode"));
3152
3172
  }
3173
+ contentVideo.play().catch(function() {});
3153
3174
  }
3154
3175
  emit("content_resume");
3155
3176
  }
@@ -3515,8 +3536,8 @@ function createPrebidController(contentVideo, options) {
3515
3536
  if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
3516
3537
  if (contentVideo.paused) {
3517
3538
  console.log("".concat(LOG, " Content video paused in live mode, resuming playback on stop"));
3518
- contentVideo.play().catch(function() {});
3519
3539
  }
3540
+ contentVideo.play().catch(function() {});
3520
3541
  }
3521
3542
  if (adHls) {
3522
3543
  adHls.destroy();
@@ -3525,6 +3546,8 @@ function createPrebidController(contentVideo, options) {
3525
3546
  if (adVideoElement) {
3526
3547
  adVideoElement.pause();
3527
3548
  adVideoElement.src = "";
3549
+ adVideoElement.remove();
3550
+ adVideoElement = void 0;
3528
3551
  }
3529
3552
  currentAd = void 0;
3530
3553
  return [
@@ -4293,6 +4316,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4293
4316
  this.minAdRequestIntervalMs = 2500;
4294
4317
  this.backoffBaseMs = 1e3;
4295
4318
  this.maxBackoffMs = 15e3;
4319
+ this.continuousFetchWallClockBufferMs = 3e4;
4320
+ this.continuousFetchMaxIterations = 500;
4321
+ this.continuousFetchQueueFullConsecutiveWaits = 0;
4296
4322
  this.preloadPool = [];
4297
4323
  this.maxPreloadPoolSize = 3;
4298
4324
  this.preloadPoolActive = false;
@@ -4352,6 +4378,15 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4352
4378
  }
4353
4379
  }
4354
4380
  },
4381
+ {
4382
+ key: "getAdPlayerTypeLabel",
4383
+ value: function getAdPlayerTypeLabel() {
4384
+ var t = this.config.adPlayerType;
4385
+ if (t === "prebid") return "Prebid";
4386
+ if (t === "hls") return "HLS";
4387
+ return "IMA";
4388
+ }
4389
+ },
4355
4390
  {
4356
4391
  key: "load",
4357
4392
  value: function load() {
@@ -4451,7 +4486,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4451
4486
  });
4452
4487
  this.hls.on(import_hls3.default.Events.MANIFEST_PARSED, function(_, data) {
4453
4488
  return _async_to_generator(function() {
4454
- var _this_hls_levels, _this_hls, _this_hls_levels_some, adBehavior, _this_config_minSegmentsBeforePlay, minSegments, _this_video_play;
4489
+ var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
4455
4490
  return _ts_generator(this, function(_state) {
4456
4491
  switch(_state.label){
4457
4492
  case 0:
@@ -4460,10 +4495,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4460
4495
  } else {
4461
4496
  ;
4462
4497
  ;
4463
- 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) {
4498
+ 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) {
4464
4499
  var _level_details, _level_details1;
4465
4500
  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";
4466
- })) !== null && _this_hls_levels_some !== void 0 ? _this_hls_levels_some : false;
4501
+ })) !== null && _ref !== void 0 ? _ref : false;
4467
4502
  }
4468
4503
  if (this.config.debugAdTiming) {
4469
4504
  adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
@@ -4527,9 +4562,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4527
4562
  var tag = "";
4528
4563
  var value = "";
4529
4564
  if (Array.isArray(entry)) {
4530
- var _entry_;
4565
+ var _entry_, _entry_1;
4531
4566
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4532
- var _entry_1;
4533
4567
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4534
4568
  } else if (typeof entry === "string") {
4535
4569
  var idx = entry.indexOf(":");
@@ -4652,9 +4686,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4652
4686
  var tag = "";
4653
4687
  var value = "";
4654
4688
  if (Array.isArray(entry)) {
4655
- var _entry_;
4689
+ var _entry_, _entry_1;
4656
4690
  tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
4657
- var _entry_1;
4658
4691
  value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
4659
4692
  } else if (typeof entry === "string") {
4660
4693
  var idx = entry.indexOf(":");
@@ -4704,10 +4737,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4704
4737
  }
4705
4738
  });
4706
4739
  } else if (tag.includes("EXT-X-DATERANGE")) {
4740
+ var _attrs_CLASS;
4707
4741
  var attrs = _this.parseAttributeList(value);
4708
4742
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
4709
4743
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
4710
- var _attrs_CLASS;
4711
4744
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
4712
4745
  var duration = _this.toNumber(attrs["DURATION"]);
4713
4746
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -4843,6 +4876,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4843
4876
  }
4844
4877
  });
4845
4878
  this.ima.on("content_resume", function() {
4879
+ console.log("[StormcloudVideoPlayer] content_resume received, inAdBreak=%s, remaining=%s", _this.inAdBreak, _this.getRemainingAdMs());
4846
4880
  if (!_this.video.muted) {
4847
4881
  _this.video.muted = true;
4848
4882
  _this.video.volume = 0;
@@ -4873,15 +4907,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4873
4907
  }
4874
4908
  },
4875
4909
  {
4876
- key: "recreateImaController",
4877
- value: function recreateImaController() {
4910
+ key: "recreateAdController",
4911
+ value: function recreateAdController() {
4912
+ var label = this.getAdPlayerTypeLabel();
4878
4913
  if (this.config.debugAdTiming) {
4879
- console.log("[StormcloudVideoPlayer] Recreating ImaController for new ad");
4914
+ console.log("[StormcloudVideoPlayer] Recreating ad controller (".concat(label, ") for new ad"));
4880
4915
  }
4881
4916
  var shouldShowPlaceholder = this.inAdBreak && this.showAds;
4882
4917
  if (shouldShowPlaceholder && this.ima) {
4883
4918
  if (this.config.debugAdTiming) {
4884
- console.log("[StormcloudVideoPlayer] Showing placeholder before destroying old ImaController");
4919
+ console.log("[StormcloudVideoPlayer] Showing placeholder before destroying old ".concat(label, " controller"));
4885
4920
  }
4886
4921
  this.showPlaceholderLayer();
4887
4922
  this.ima.showPlaceholder();
@@ -4894,7 +4929,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4894
4929
  this.video.volume = 0;
4895
4930
  } catch (error) {
4896
4931
  if (this.config.debugAdTiming) {
4897
- console.warn("[StormcloudVideoPlayer] Error destroying old ImaController:", error);
4932
+ console.warn("[StormcloudVideoPlayer] Error destroying old ".concat(label, " controller:"), error);
4898
4933
  }
4899
4934
  }
4900
4935
  }
@@ -4974,7 +5009,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4974
5009
  });
4975
5010
  }
4976
5011
  if (this.config.debugAdTiming) {
4977
- console.log("[StormcloudVideoPlayer] Showing placeholder layer (between content and IMA)");
5012
+ console.log("[StormcloudVideoPlayer] Showing placeholder layer (between content and ".concat(this.getAdPlayerTypeLabel(), ")"));
4978
5013
  }
4979
5014
  }
4980
5015
  },
@@ -5109,11 +5144,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5109
5144
  }
5110
5145
  var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
5111
5146
  if (daterangeMatch) {
5112
- var _daterangeMatch_;
5147
+ var _daterangeMatch_, _attrs_CLASS;
5113
5148
  var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
5114
5149
  var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
5115
5150
  var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
5116
- var _attrs_CLASS;
5117
5151
  var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
5118
5152
  var duration = this.toNumber(attrs["DURATION"]);
5119
5153
  if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
@@ -5189,7 +5223,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5189
5223
  var out = "";
5190
5224
  for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
5191
5225
  return out;
5192
- } catch (e) {
5226
+ } catch (unused) {
5193
5227
  return void 0;
5194
5228
  }
5195
5229
  }
@@ -5208,6 +5242,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5208
5242
  });
5209
5243
  }
5210
5244
  if (marker.type === "start") {
5245
+ var _this_config_immediateManifestAds;
5211
5246
  var _this_pendingAdBreak;
5212
5247
  if (!this.video.muted) {
5213
5248
  this.video.muted = true;
@@ -5232,7 +5267,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5232
5267
  this.expectedAdBreakDurationMs = durationMs;
5233
5268
  this.currentAdBreakStartWallClockMs = Date.now();
5234
5269
  var isManifestMarker = this.isManifestBasedMarker(marker);
5235
- var _this_config_immediateManifestAds;
5236
5270
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
5237
5271
  if (this.config.debugAdTiming) {
5238
5272
  console.log("[StormcloudVideoPlayer] Ad start decision:", {
@@ -5387,9 +5421,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5387
5421
  var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
5388
5422
  var match;
5389
5423
  while((match = regex.exec(value)) !== null){
5390
- var _match_;
5424
+ var _match_, _ref, _match_1;
5391
5425
  var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
5392
- var _match_1, _ref;
5393
5426
  var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
5394
5427
  if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
5395
5428
  rawVal = rawVal.slice(1, -1);
@@ -5688,6 +5721,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5688
5721
  return this.config.adPlayerType === "prebid";
5689
5722
  }
5690
5723
  },
5724
+ {
5725
+ key: "isLgStbDevice",
5726
+ value: function isLgStbDevice() {
5727
+ if (typeof navigator === "undefined" || !navigator.userAgent) return false;
5728
+ var ua = navigator.userAgent;
5729
+ return /Web0S|webOS|LG Browser|LGSTB/i.test(ua);
5730
+ }
5731
+ },
5691
5732
  {
5692
5733
  key: "getCurrentAdIndex",
5693
5734
  value: function getCurrentAdIndex() {
@@ -5748,13 +5789,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5748
5789
  {
5749
5790
  key: "shouldShowNativeControls",
5750
5791
  value: function shouldShowNativeControls() {
5792
+ var _this_config_showCustomControls;
5751
5793
  var streamType = this.getStreamType();
5752
5794
  if (streamType === "other") {
5753
- var _this_config_showCustomControls;
5754
- return !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false);
5795
+ var _this_config_showCustomControls1;
5796
+ return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
5755
5797
  }
5756
- var _this_config_showCustomControls1;
5757
- return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
5798
+ return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
5758
5799
  }
5759
5800
  },
5760
5801
  {
@@ -5913,12 +5954,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5913
5954
  continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
5914
5955
  preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
5915
5956
  preloadIma.initialize();
5916
- errorListener = function(payload) {
5957
+ errorListener = function errorListener(payload) {
5917
5958
  hasAdError = true;
5918
5959
  adErrorPayload = payload;
5919
5960
  };
5920
5961
  preloadIma.on("ad_error", errorListener);
5921
- errorListenerCleanup = function() {
5962
+ errorListenerCleanup = function errorListenerCleanup() {
5922
5963
  return preloadIma.off("ad_error", errorListener);
5923
5964
  };
5924
5965
  return [
@@ -5969,7 +6010,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5969
6010
  isReady: true,
5970
6011
  loadPromise: Promise.resolve()
5971
6012
  };
5972
- lateErrorListener = function(payload) {
6013
+ lateErrorListener = function lateErrorListener(payload) {
5973
6014
  var index = _this.preloadPool.findIndex(function(entry) {
5974
6015
  return entry.vastUrl === vastUrl;
5975
6016
  });
@@ -5980,7 +6021,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5980
6021
  }
5981
6022
  try {
5982
6023
  preloadIma.destroy();
5983
- } catch (e) {}
6024
+ } catch (unused) {}
5984
6025
  }
5985
6026
  };
5986
6027
  preloadIma.on("ad_error", lateErrorListener);
@@ -6502,15 +6543,34 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6502
6543
  key: "continuousFetchLoop",
6503
6544
  value: function continuousFetchLoop(baseVastUrl) {
6504
6545
  return _async_to_generator(function() {
6505
- var _this, _loop, _ret;
6546
+ var loopIterations, _this, _loop, _ret;
6506
6547
  return _ts_generator(this, function(_state) {
6507
6548
  switch(_state.label){
6508
6549
  case 0:
6550
+ loopIterations = 0;
6551
+ _state.label = 1;
6552
+ case 1:
6553
+ _state.trys.push([
6554
+ 1,
6555
+ ,
6556
+ 5,
6557
+ 6
6558
+ ]);
6509
6559
  _loop = function() {
6510
- var remaining, maxQueueSize, newAdUrl, queuedUrlsPreview, generationDelay;
6560
+ var remaining, elapsedMs, maxLoopMs, maxQueueSize, newAdUrl, queuedUrlsPreview, generationDelay;
6511
6561
  return _ts_generator(this, function(_state) {
6512
6562
  switch(_state.label){
6513
6563
  case 0:
6564
+ loopIterations++;
6565
+ if (loopIterations > _this.continuousFetchMaxIterations) {
6566
+ if (_this.config.debugAdTiming) {
6567
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Max iterations reached (".concat(_this.continuousFetchMaxIterations, "), stopping URL generation"));
6568
+ }
6569
+ return [
6570
+ 2,
6571
+ "break"
6572
+ ];
6573
+ }
6514
6574
  remaining = _this.getRemainingAdMs();
6515
6575
  if (remaining <= 0) {
6516
6576
  if (_this.config.debugAdTiming) {
@@ -6521,6 +6581,19 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6521
6581
  "break"
6522
6582
  ];
6523
6583
  }
6584
+ if (_this.currentAdBreakStartWallClockMs != null && _this.expectedAdBreakDurationMs != null) {
6585
+ elapsedMs = Date.now() - _this.currentAdBreakStartWallClockMs;
6586
+ maxLoopMs = _this.expectedAdBreakDurationMs + _this.continuousFetchWallClockBufferMs;
6587
+ if (elapsedMs >= maxLoopMs) {
6588
+ if (_this.config.debugAdTiming) {
6589
+ console.log("[CONTINUOUS-FETCH] ⏹️ Wall-clock limit reached (".concat(elapsedMs, "ms >= ").concat(maxLoopMs, "ms), stopping URL generation"));
6590
+ }
6591
+ return [
6592
+ 2,
6593
+ "break"
6594
+ ];
6595
+ }
6596
+ }
6524
6597
  if (_this.consecutiveFailures >= _this.maxConsecutiveFailures) {
6525
6598
  if (_this.config.debugAdTiming) {
6526
6599
  console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive failures (".concat(_this.consecutiveFailures, "), stopping URL generation"));
@@ -6542,46 +6615,63 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6542
6615
  maxQueueSize = 5;
6543
6616
  if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
6544
6617
  3,
6545
- 2
6618
+ 4
6546
6619
  ];
6620
+ if (!(_this.isPrebidMode() && _this.isLgStbDevice())) return [
6621
+ 3,
6622
+ 1
6623
+ ];
6624
+ _this.adRequestQueue.shift();
6625
+ _this.adRequestQueue.push("");
6626
+ _this.totalAdsInBreak++;
6627
+ _this.continuousFetchQueueFullConsecutiveWaits = 0;
6547
6628
  if (_this.config.debugAdTiming) {
6548
- console.log("[CONTINUOUS-FETCH] ⏸️ URL queue full (".concat(_this.adRequestQueue.length, "), waiting..."));
6629
+ console.log("[CONTINUOUS-FETCH] Prebid slot rotated (queue full, dropped oldest); queue: ".concat(_this.adRequestQueue.length));
6549
6630
  }
6550
6631
  return [
6551
- 4,
6552
- new Promise(function(resolve) {
6553
- return setTimeout(resolve, 1e3);
6554
- })
6632
+ 3,
6633
+ 3
6555
6634
  ];
6556
6635
  case 1:
6636
+ return [
6637
+ 4,
6638
+ _this.waitForQueueWithBackoff()
6639
+ ];
6640
+ case 2:
6557
6641
  _state.sent();
6558
6642
  return [
6559
6643
  2,
6560
6644
  "continue"
6561
6645
  ];
6562
- case 2:
6646
+ case 3:
6647
+ return [
6648
+ 3,
6649
+ 8
6650
+ ];
6651
+ case 4:
6563
6652
  if (!_this.isPrebidMode()) return [
6564
6653
  3,
6565
- 3
6654
+ 5
6566
6655
  ];
6567
6656
  _this.adRequestQueue.push("");
6568
6657
  _this.totalAdsInBreak++;
6658
+ _this.continuousFetchQueueFullConsecutiveWaits = 0;
6569
6659
  if (_this.config.debugAdTiming) {
6570
6660
  console.log("[CONTINUOUS-FETCH] Prebid auction slot queued (queue: ".concat(_this.adRequestQueue.length, ")"));
6571
6661
  }
6572
6662
  return [
6573
6663
  3,
6574
- 6
6664
+ 8
6575
6665
  ];
6576
- case 3:
6666
+ case 5:
6577
6667
  if (!baseVastUrl) return [
6578
6668
  3,
6579
- 6
6669
+ 8
6580
6670
  ];
6581
6671
  newAdUrl = _this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
6582
6672
  if (!(!newAdUrl || _this.failedVastUrls.has(newAdUrl) || _this.isUrlInCooldown(newAdUrl))) return [
6583
6673
  3,
6584
- 5
6674
+ 7
6585
6675
  ];
6586
6676
  return [
6587
6677
  4,
@@ -6589,13 +6679,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6589
6679
  return setTimeout(resolve, 500);
6590
6680
  })
6591
6681
  ];
6592
- case 4:
6682
+ case 6:
6593
6683
  _state.sent();
6594
6684
  return [
6595
6685
  2,
6596
6686
  "continue"
6597
6687
  ];
6598
- case 5:
6688
+ case 7:
6599
6689
  if (_this.config.debugAdTiming) {
6600
6690
  queuedUrlsPreview = _to_consumable_array(_this.adRequestQueue).concat([
6601
6691
  newAdUrl
@@ -6606,8 +6696,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6606
6696
  }
6607
6697
  _this.adRequestQueue.push(newAdUrl);
6608
6698
  _this.totalAdsInBreak++;
6609
- _state.label = 6;
6610
- case 6:
6699
+ _this.continuousFetchQueueFullConsecutiveWaits = 0;
6700
+ _state.label = 8;
6701
+ case 8:
6611
6702
  generationDelay = _this.consecutiveFailures > 0 ? Math.min(1e3 * Math.pow(2, _this.consecutiveFailures), 5e3) : 500;
6612
6703
  return [
6613
6704
  4,
@@ -6615,7 +6706,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6615
6706
  return setTimeout(resolve, generationDelay);
6616
6707
  })
6617
6708
  ];
6618
- case 7:
6709
+ case 9:
6619
6710
  _state.sent();
6620
6711
  return [
6621
6712
  2
@@ -6623,33 +6714,41 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6623
6714
  }
6624
6715
  });
6625
6716
  };
6626
- _state.label = 1;
6627
- case 1:
6717
+ _state.label = 2;
6718
+ case 2:
6628
6719
  if (!(this.continuousFetchingActive && this.inAdBreak)) return [
6629
6720
  3,
6630
- 3
6721
+ 4
6631
6722
  ];
6632
6723
  _this = this;
6633
6724
  return [
6634
6725
  5,
6635
6726
  _ts_values(_loop())
6636
6727
  ];
6637
- case 2:
6728
+ case 3:
6638
6729
  _ret = _state.sent();
6639
6730
  if (_ret === "break") return [
6640
6731
  3,
6641
- 3
6732
+ 4
6642
6733
  ];
6643
6734
  return [
6644
6735
  3,
6645
- 1
6736
+ 2
6646
6737
  ];
6647
- case 3:
6738
+ case 4:
6739
+ return [
6740
+ 3,
6741
+ 6
6742
+ ];
6743
+ case 5:
6648
6744
  this.continuousFetchLoopRunning = false;
6745
+ this.continuousFetchQueueFullConsecutiveWaits = 0;
6746
+ return [
6747
+ 7
6748
+ ];
6749
+ case 6:
6649
6750
  if (this.config.debugAdTiming) {
6650
- console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 URL generation loop ended (queued: ".concat(this.adRequestQueue.length, ")"), this.adRequestQueue.length > 0 ? {
6651
- queuedUrls: _to_consumable_array(this.adRequestQueue)
6652
- } : {});
6751
+ this.logQueueState("URL generation loop ended");
6653
6752
  }
6654
6753
  return [
6655
6754
  2
@@ -6659,6 +6758,51 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6659
6758
  }).call(this);
6660
6759
  }
6661
6760
  },
6761
+ {
6762
+ key: "waitForQueueWithBackoff",
6763
+ value: function waitForQueueWithBackoff() {
6764
+ return _async_to_generator(function() {
6765
+ var delayMs, shouldLog;
6766
+ return _ts_generator(this, function(_state) {
6767
+ switch(_state.label){
6768
+ case 0:
6769
+ this.continuousFetchQueueFullConsecutiveWaits++;
6770
+ delayMs = Math.min(1e3 * Math.pow(2, this.continuousFetchQueueFullConsecutiveWaits - 1), 5e3);
6771
+ shouldLog = this.config.debugAdTiming && (this.continuousFetchQueueFullConsecutiveWaits <= 2 || this.continuousFetchQueueFullConsecutiveWaits % 4 === 0);
6772
+ if (shouldLog) {
6773
+ console.log("[CONTINUOUS-FETCH] ⏸️ URL queue full (".concat(this.adRequestQueue.length, "), waiting ").concat(delayMs, "ms (wait #").concat(this.continuousFetchQueueFullConsecutiveWaits, ")"));
6774
+ }
6775
+ return [
6776
+ 4,
6777
+ new Promise(function(resolve) {
6778
+ return setTimeout(resolve, delayMs);
6779
+ })
6780
+ ];
6781
+ case 1:
6782
+ _state.sent();
6783
+ return [
6784
+ 2
6785
+ ];
6786
+ }
6787
+ });
6788
+ }).call(this);
6789
+ }
6790
+ },
6791
+ {
6792
+ key: "logQueueState",
6793
+ value: function logQueueState(reason) {
6794
+ if (!this.config.debugAdTiming) return;
6795
+ console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 ".concat(reason), {
6796
+ queueLength: this.adRequestQueue.length,
6797
+ totalAdsInBreak: this.totalAdsInBreak,
6798
+ totalAdRequestsInBreak: this.totalAdRequestsInBreak,
6799
+ consecutiveFailures: this.consecutiveFailures,
6800
+ continuousFetchingActive: this.continuousFetchingActive,
6801
+ continuousFetchLoopRunning: this.continuousFetchLoopRunning,
6802
+ inAdBreak: this.inAdBreak
6803
+ });
6804
+ }
6805
+ },
6662
6806
  {
6663
6807
  key: "stopContinuousFetching",
6664
6808
  value: function stopContinuousFetching() {
@@ -6805,7 +6949,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6805
6949
  10
6806
6950
  ];
6807
6951
  nextAdUrl = this.adRequestQueue.shift();
6808
- if (!nextAdUrl) {
6952
+ if (nextAdUrl == null) {
6809
6953
  return [
6810
6954
  3,
6811
6955
  4
@@ -6829,8 +6973,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6829
6973
  4
6830
6974
  ];
6831
6975
  }
6976
+ console.log("[StormcloudVideoPlayer] Requesting next ad (%s), queue remaining=%s", nextAdUrl === "" ? "Prebid" : "VAST", this.adRequestQueue.length);
6832
6977
  if (this.config.debugAdTiming) {
6833
- console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via IMA SDK (".concat(this.currentAdIndex + 1, "/").concat(this.totalAdsInBreak, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
6978
+ console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via ".concat(this.getAdPlayerTypeLabel(), " (").concat(this.currentAdIndex + 1, "/").concat(this.totalAdsInBreak, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
6834
6979
  }
6835
6980
  currentMuted1 = this.video.muted;
6836
6981
  currentVolume1 = this.video.volume;
@@ -6991,7 +7136,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6991
7136
  9
6992
7137
  ];
6993
7138
  nextAdUrl = this.adRequestQueue.shift();
6994
- if (!nextAdUrl) {
7139
+ if (nextAdUrl == null) {
6995
7140
  return [
6996
7141
  3,
6997
7142
  3
@@ -7010,7 +7155,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7010
7155
  ];
7011
7156
  }
7012
7157
  if (this.config.debugAdTiming) {
7013
- console.log("[CONTINUOUS-FETCH] \u2705 Ad URL available, requesting via IMA SDK");
7158
+ console.log("[CONTINUOUS-FETCH] Ad URL available, requesting via ".concat(this.getAdPlayerTypeLabel()));
7014
7159
  }
7015
7160
  this.isShowingPlaceholder = false;
7016
7161
  this.ima.hidePlaceholder();
@@ -7196,11 +7341,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7196
7341
  {
7197
7342
  key: "ensureAdStoppedByTimer",
7198
7343
  value: function ensureAdStoppedByTimer() {
7344
+ var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
7199
7345
  if (!this.inAdBreak) return;
7200
7346
  this.adStopTimerId = void 0;
7201
7347
  var adPlaying = this.ima.isAdPlaying();
7202
7348
  var pendingAds = this.adPodQueue.length > 0;
7203
- var _this_config_adBreakCheckIntervalMs;
7204
7349
  var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
7205
7350
  var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
7206
7351
  var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
@@ -7208,7 +7353,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7208
7353
  if (this.currentAdBreakStartWallClockMs != null) {
7209
7354
  elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
7210
7355
  }
7211
- var _this_expectedAdBreakDurationMs;
7212
7356
  var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
7213
7357
  var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
7214
7358
  var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
@@ -7353,7 +7497,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7353
7497
  }
7354
7498
  throw new Error("Too many consecutive failures");
7355
7499
  }
7356
- this.recreateImaController();
7500
+ this.recreateAdController();
7357
7501
  requestToken = ++this.adRequestTokenCounter;
7358
7502
  this.activeAdRequestToken = requestToken;
7359
7503
  this.startAdRequestWatchdog(requestToken);
@@ -7465,15 +7609,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7465
7609
  9
7466
7610
  ];
7467
7611
  case 9:
7468
- if (this.isTemporaryAdError(playError)) {
7469
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7470
- if (this.config.debugAdTiming) {
7471
- console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7472
- }
7473
- } else {
7474
- this.failedVastUrls.add(vastTagUrl);
7475
- if (this.config.debugAdTiming) {
7476
- console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7612
+ if (vastTagUrl) {
7613
+ if (this.isTemporaryAdError(playError)) {
7614
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7615
+ if (this.config.debugAdTiming) {
7616
+ console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
7617
+ }
7618
+ } else {
7619
+ this.failedVastUrls.add(vastTagUrl);
7620
+ if (this.config.debugAdTiming) {
7621
+ console.log("[AD-ERROR] Permanent play error - URL blacklisted");
7622
+ }
7477
7623
  }
7478
7624
  }
7479
7625
  this.clearAdFailsafeTimer();
@@ -7542,15 +7688,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7542
7688
  15
7543
7689
  ];
7544
7690
  case 15:
7545
- if (this.isTemporaryAdError(error)) {
7546
- this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7547
- if (this.config.debugAdTiming) {
7548
- console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7549
- }
7550
- } else {
7551
- this.failedVastUrls.add(vastTagUrl);
7552
- if (this.config.debugAdTiming) {
7553
- console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7691
+ if (vastTagUrl) {
7692
+ if (this.isTemporaryAdError(error)) {
7693
+ this.temporaryFailureUrls.set(vastTagUrl, Date.now());
7694
+ if (this.config.debugAdTiming) {
7695
+ console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
7696
+ }
7697
+ } else {
7698
+ this.failedVastUrls.add(vastTagUrl);
7699
+ if (this.config.debugAdTiming) {
7700
+ console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
7701
+ }
7554
7702
  }
7555
7703
  }
7556
7704
  this.clearAdRequestWatchdog();
@@ -7594,6 +7742,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7594
7742
  this.showAds = false;
7595
7743
  this.currentAdIndex = 0;
7596
7744
  this.totalAdsInBreak = 0;
7745
+ this.totalAdRequestsInBreak = 0;
7597
7746
  this.consecutiveFailures = 0;
7598
7747
  this.ima.stop().catch(function() {});
7599
7748
  var restoredMuted = this.ima.getOriginalMutedState();
@@ -7605,17 +7754,15 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7605
7754
  this.video.volume = restoredVolume;
7606
7755
  }
7607
7756
  if (this.shouldContinueLiveStreamDuringAds()) {
7608
- if (this.video.paused) {
7609
- var _this_video_play;
7610
- if (this.config.debugAdTiming) {
7757
+ var _this_video_play;
7758
+ if (this.config.debugAdTiming) {
7759
+ if (this.video.paused) {
7611
7760
  console.log("[StormcloudVideoPlayer] Content video paused in live mode after ads, resuming playback");
7612
- }
7613
- (_this_video_play = this.video.play()) === null || _this_video_play === void 0 ? void 0 : _this_video_play.catch(function() {});
7614
- } else {
7615
- if (this.config.debugAdTiming) {
7761
+ } else {
7616
7762
  console.log("[StormcloudVideoPlayer] Content video already playing in live mode after ads");
7617
7763
  }
7618
7764
  }
7765
+ (_this_video_play = this.video.play()) === null || _this_video_play === void 0 ? void 0 : _this_video_play.catch(function() {});
7619
7766
  } else if (this.video.paused) {
7620
7767
  var _this_video_play1;
7621
7768
  (_this_video_play1 = this.video.play()) === null || _this_video_play1 === void 0 ? void 0 : _this_video_play1.catch(function() {});
@@ -7653,8 +7800,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7653
7800
  key: "startAdRequestWatchdog",
7654
7801
  value: function startAdRequestWatchdog(token) {
7655
7802
  var _this = this;
7656
- this.clearAdRequestWatchdog();
7657
7803
  var _this_config_adFailsafeTimeoutMs;
7804
+ this.clearAdRequestWatchdog();
7658
7805
  var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7659
7806
  this.adRequestWatchdogToken = token;
7660
7807
  this.adRequestWatchdogId = window.setTimeout(function() {
@@ -7697,8 +7844,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7697
7844
  key: "startAdFailsafeTimer",
7698
7845
  value: function startAdFailsafeTimer(token) {
7699
7846
  var _this = this;
7700
- this.clearAdFailsafeTimer();
7701
7847
  var _this_config_adFailsafeTimeoutMs;
7848
+ this.clearAdFailsafeTimer();
7702
7849
  var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
7703
7850
  this.adFailsafeToken = token;
7704
7851
  this.adFailsafeTimerId = window.setTimeout(function() {
@@ -8079,21 +8226,21 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8079
8226
  var _import_react_default_useState14 = _sliced_to_array(import_react.default.useState(false), 2), showLicenseWarning = _import_react_default_useState14[0], setShowLicenseWarning = _import_react_default_useState14[1];
8080
8227
  var _import_react_default_useState15 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react_default_useState15[0], setViewportWidth = _import_react_default_useState15[1];
8081
8228
  var _import_react_default_useState16 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react_default_useState16[0], setIsPortrait = _import_react_default_useState16[1];
8082
- var getResponsiveScale = function() {
8229
+ var getResponsiveScale = function getResponsiveScale() {
8083
8230
  if (viewportWidth < 480) return 0.7;
8084
8231
  if (viewportWidth < 768) return 0.8;
8085
8232
  if (viewportWidth < 1024) return 0.9;
8086
8233
  return 1;
8087
8234
  };
8088
8235
  var responsiveScale = getResponsiveScale();
8089
- var formatTime = function(seconds) {
8236
+ var formatTime = function formatTime(seconds) {
8090
8237
  if (!isFinite(seconds)) return "0:00:00";
8091
8238
  var hours = Math.floor(seconds / 3600);
8092
8239
  var minutes = Math.floor(seconds % 3600 / 60);
8093
8240
  var remainingSeconds = Math.floor(seconds % 60);
8094
8241
  return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
8095
8242
  };
8096
- var handlePlayPause = function() {
8243
+ var handlePlayPause = function handlePlayPause() {
8097
8244
  if (videoRef.current) {
8098
8245
  if (videoRef.current.paused) {
8099
8246
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
@@ -8112,7 +8259,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8112
8259
  }
8113
8260
  }
8114
8261
  };
8115
- var handleCenterPlayClick = function() {
8262
+ var handleCenterPlayClick = function handleCenterPlayClick() {
8116
8263
  if (videoRef.current && videoRef.current.paused) {
8117
8264
  var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
8118
8265
  if (hasValidSource) {
@@ -8126,7 +8273,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8126
8273
  }
8127
8274
  }
8128
8275
  };
8129
- var handleTimelineSeek = function(e) {
8276
+ var handleTimelineSeek = function handleTimelineSeek(e) {
8130
8277
  if (videoRef.current && duration > 0 && isFinite(duration)) {
8131
8278
  var rect = e.currentTarget.getBoundingClientRect();
8132
8279
  var clickX = e.clientX - rect.left;
@@ -8137,13 +8284,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8137
8284
  }
8138
8285
  }
8139
8286
  };
8140
- var handleVolumeChange = function(newVolume) {
8287
+ var handleVolumeChange = function handleVolumeChange(newVolume) {
8141
8288
  if (playerRef.current && isFinite(newVolume)) {
8142
8289
  var clampedVolume = Math.max(0, Math.min(1, newVolume));
8143
8290
  playerRef.current.setVolume(clampedVolume);
8144
8291
  }
8145
8292
  };
8146
- var handlePlaybackRateChange = function(rate) {
8293
+ var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
8147
8294
  if (videoRef.current && isFinite(rate) && rate > 0) {
8148
8295
  videoRef.current.playbackRate = rate;
8149
8296
  }
@@ -8181,7 +8328,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8181
8328
  if (playerRef.current) {
8182
8329
  try {
8183
8330
  playerRef.current.destroy();
8184
- } catch (e) {}
8331
+ } catch (unused) {}
8185
8332
  playerRef.current = null;
8186
8333
  }
8187
8334
  var cfg = {
@@ -8221,7 +8368,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8221
8368
  return function() {
8222
8369
  try {
8223
8370
  player.destroy();
8224
- } catch (e) {}
8371
+ } catch (unused) {}
8225
8372
  playerRef.current = null;
8226
8373
  };
8227
8374
  }, [
@@ -8245,7 +8392,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8245
8392
  ]);
8246
8393
  (0, import_react.useEffect)(function() {
8247
8394
  if (!playerRef.current) return;
8248
- var checkAdStatus = function() {
8395
+ var checkAdStatus = function checkAdStatus() {
8249
8396
  if (playerRef.current) {
8250
8397
  var _videoRef_current_dataset, _videoRef_current;
8251
8398
  var showAdsFromMethod = playerRef.current.isShowingAds();
@@ -8275,7 +8422,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8275
8422
  }, []);
8276
8423
  (0, import_react.useEffect)(function() {
8277
8424
  if (typeof window === "undefined" || !playerRef.current) return;
8278
- var handleResize = function() {
8425
+ var handleResize = function handleResize() {
8279
8426
  if (playerRef.current && videoRef.current) {
8280
8427
  if (typeof playerRef.current.resize === "function") {
8281
8428
  playerRef.current.resize();
@@ -8291,7 +8438,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8291
8438
  }, []);
8292
8439
  (0, import_react.useEffect)(function() {
8293
8440
  if (!playerRef.current || !videoRef.current) return;
8294
- var updateStates = function() {
8441
+ var updateStates = function updateStates() {
8295
8442
  var _videoRef_current;
8296
8443
  if (playerRef.current && videoRef.current) {
8297
8444
  setIsMuted(playerRef.current.isMuted());
@@ -8308,7 +8455,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8308
8455
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8309
8456
  };
8310
8457
  var interval = setInterval(updateStates, 200);
8311
- var handleFullscreenChange = function() {
8458
+ var handleFullscreenChange = function handleFullscreenChange() {
8312
8459
  var _videoRef_current;
8313
8460
  setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
8314
8461
  };
@@ -8320,7 +8467,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8320
8467
  }, []);
8321
8468
  (0, import_react.useEffect)(function() {
8322
8469
  if (!videoRef.current) return;
8323
- var handleLoadedMetadata = function() {
8470
+ var handleLoadedMetadata = function handleLoadedMetadata() {
8324
8471
  if (videoRef.current) {
8325
8472
  var video2 = videoRef.current;
8326
8473
  void video2.offsetHeight;
@@ -8330,19 +8477,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8330
8477
  console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8331
8478
  }
8332
8479
  };
8333
- var handleLoadedData = function() {
8480
+ var handleLoadedData = function handleLoadedData() {
8334
8481
  if (debugAdTiming) {
8335
8482
  var _videoRef_current;
8336
8483
  console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8337
8484
  }
8338
8485
  };
8339
- var handleLoadStart = function() {
8486
+ var handleLoadStart = function handleLoadStart() {
8340
8487
  if (debugAdTiming) {
8341
8488
  var _videoRef_current;
8342
8489
  console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
8343
8490
  }
8344
8491
  };
8345
- var handleCanPlay = function() {
8492
+ var handleCanPlay = function handleCanPlay() {
8346
8493
  setIsLoading(false);
8347
8494
  if (bufferingTimeoutRef.current) {
8348
8495
  clearTimeout(bufferingTimeoutRef.current);
@@ -8354,7 +8501,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8354
8501
  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");
8355
8502
  }
8356
8503
  };
8357
- var handleCanPlayThrough = function() {
8504
+ var handleCanPlayThrough = function handleCanPlayThrough() {
8358
8505
  setIsLoading(false);
8359
8506
  if (bufferingTimeoutRef.current) {
8360
8507
  clearTimeout(bufferingTimeoutRef.current);
@@ -8366,7 +8513,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8366
8513
  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");
8367
8514
  }
8368
8515
  };
8369
- var handleWaiting = function() {
8516
+ var handleWaiting = function handleWaiting() {
8370
8517
  if (bufferingTimeoutRef.current) {
8371
8518
  clearTimeout(bufferingTimeoutRef.current);
8372
8519
  }
@@ -8382,7 +8529,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8382
8529
  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)");
8383
8530
  }
8384
8531
  };
8385
- var handlePlaying = function() {
8532
+ var handlePlaying = function handlePlaying() {
8386
8533
  setIsLoading(false);
8387
8534
  if (bufferingTimeoutRef.current) {
8388
8535
  clearTimeout(bufferingTimeoutRef.current);
@@ -8395,7 +8542,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8395
8542
  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");
8396
8543
  }
8397
8544
  };
8398
- var handlePause = function() {
8545
+ var handlePause = function handlePause() {
8399
8546
  var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
8400
8547
  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";
8401
8548
  if (playerRef.current && !isAdActive) {
@@ -8404,7 +8551,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8404
8551
  setShowCenterPlay(false);
8405
8552
  }
8406
8553
  };
8407
- var handleEnded = function() {
8554
+ var handleEnded = function handleEnded() {
8408
8555
  setShowCenterPlay(true);
8409
8556
  };
8410
8557
  var video = videoRef.current;
@@ -8562,14 +8709,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8562
8709
  boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
8563
8710
  transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
8564
8711
  },
8565
- onMouseEnter: function(e) {
8712
+ onMouseEnter: function onMouseEnter(e) {
8566
8713
  var target = e.currentTarget;
8567
8714
  target.style.transform = "translate(-50%, -50%)";
8568
8715
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
8569
8716
  target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
8570
8717
  target.style.borderColor = "rgba(255, 255, 255, 0.9)";
8571
8718
  },
8572
- onMouseLeave: function(e) {
8719
+ onMouseLeave: function onMouseLeave(e) {
8573
8720
  var target = e.currentTarget;
8574
8721
  target.style.transform = "translate(-50%, -50%)";
8575
8722
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
@@ -8676,12 +8823,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8676
8823
  minWidth: "".concat(48 * responsiveScale, "px"),
8677
8824
  minHeight: "".concat(48 * responsiveScale, "px")
8678
8825
  },
8679
- onMouseEnter: function(e) {
8826
+ onMouseEnter: function onMouseEnter(e) {
8680
8827
  var target = e.target;
8681
8828
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8682
8829
  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)";
8683
8830
  },
8684
- onMouseLeave: function(e) {
8831
+ onMouseLeave: function onMouseLeave(e) {
8685
8832
  var target = e.target;
8686
8833
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8687
8834
  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)";
@@ -8707,15 +8854,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8707
8854
  padding: "8px",
8708
8855
  margin: "-8px"
8709
8856
  },
8710
- onMouseEnter: function() {
8857
+ onMouseEnter: function onMouseEnter() {
8711
8858
  return setShowVolumeSlider(true);
8712
8859
  },
8713
- onMouseLeave: function() {
8860
+ onMouseLeave: function onMouseLeave() {
8714
8861
  return setShowVolumeSlider(false);
8715
8862
  },
8716
8863
  children: [
8717
8864
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8718
- onClick: function() {
8865
+ onClick: function onClick() {
8719
8866
  if (playerRef.current) {
8720
8867
  playerRef.current.toggleMute();
8721
8868
  }
@@ -8739,12 +8886,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8739
8886
  minWidth: "".concat(44 * responsiveScale, "px"),
8740
8887
  minHeight: "".concat(44 * responsiveScale, "px")
8741
8888
  },
8742
- onMouseEnter: function(e) {
8889
+ onMouseEnter: function onMouseEnter(e) {
8743
8890
  var target = e.target;
8744
8891
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8745
8892
  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)";
8746
8893
  },
8747
- onMouseLeave: function(e) {
8894
+ onMouseLeave: function onMouseLeave(e) {
8748
8895
  var target = e.target;
8749
8896
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8750
8897
  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)";
@@ -8780,10 +8927,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8780
8927
  marginBottom: "-16px",
8781
8928
  zIndex: 9
8782
8929
  },
8783
- onMouseEnter: function() {
8930
+ onMouseEnter: function onMouseEnter() {
8784
8931
  return setShowVolumeSlider(true);
8785
8932
  },
8786
- onMouseLeave: function() {
8933
+ onMouseLeave: function onMouseLeave() {
8787
8934
  return setShowVolumeSlider(false);
8788
8935
  }
8789
8936
  }),
@@ -8808,12 +8955,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8808
8955
  zIndex: 10,
8809
8956
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8810
8957
  },
8811
- onMouseEnter: function(e) {
8958
+ onMouseEnter: function onMouseEnter(e) {
8812
8959
  setShowVolumeSlider(true);
8813
8960
  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)";
8814
8961
  e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
8815
8962
  },
8816
- onMouseLeave: function(e) {
8963
+ onMouseLeave: function onMouseLeave(e) {
8817
8964
  setShowVolumeSlider(false);
8818
8965
  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)";
8819
8966
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
@@ -8826,19 +8973,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8826
8973
  cursor: "pointer",
8827
8974
  transition: "transform 0.2s ease-in-out"
8828
8975
  },
8829
- onMouseEnter: function(e) {},
8830
- onMouseLeave: function(e) {},
8831
- onMouseDown: function(e) {
8976
+ onMouseEnter: function onMouseEnter(e) {},
8977
+ onMouseLeave: function onMouseLeave(e) {},
8978
+ onMouseDown: function onMouseDown(e) {
8832
8979
  e.preventDefault();
8833
8980
  var sliderElement = e.currentTarget;
8834
- var handleMouseMove = function(moveEvent) {
8981
+ var handleMouseMove = function handleMouseMove(moveEvent) {
8835
8982
  if (!sliderElement) return;
8836
8983
  var rect2 = sliderElement.getBoundingClientRect();
8837
8984
  var y2 = moveEvent.clientY - rect2.top;
8838
8985
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8839
8986
  handleVolumeChange(percentage2);
8840
8987
  };
8841
- var handleMouseUp = function() {
8988
+ var handleMouseUp = function handleMouseUp1() {
8842
8989
  document.removeEventListener("mousemove", handleMouseMove);
8843
8990
  document.removeEventListener("mouseup", handleMouseUp);
8844
8991
  };
@@ -8849,7 +8996,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8849
8996
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8850
8997
  handleVolumeChange(percentage);
8851
8998
  },
8852
- onClick: function(e) {
8999
+ onClick: function onClick(e) {
8853
9000
  e.stopPropagation();
8854
9001
  var rect = e.currentTarget.getBoundingClientRect();
8855
9002
  var y = e.clientY - rect.top;
@@ -8896,17 +9043,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8896
9043
  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",
8897
9044
  cursor: "grab"
8898
9045
  },
8899
- onMouseEnter: function(e) {
9046
+ onMouseEnter: function onMouseEnter(e) {
8900
9047
  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)";
8901
9048
  e.currentTarget.style.cursor = "grab";
8902
9049
  },
8903
- onMouseLeave: function(e) {
9050
+ onMouseLeave: function onMouseLeave(e) {
8904
9051
  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)";
8905
9052
  },
8906
- onMouseDown: function(e) {
9053
+ onMouseDown: function onMouseDown(e) {
8907
9054
  e.currentTarget.style.cursor = "grabbing";
8908
9055
  },
8909
- onMouseUp: function(e) {
9056
+ onMouseUp: function onMouseUp(e) {
8910
9057
  e.currentTarget.style.cursor = "grab";
8911
9058
  }
8912
9059
  })
@@ -8946,7 +9093,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8946
9093
  },
8947
9094
  children: [
8948
9095
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8949
- onClick: function() {
9096
+ onClick: function onClick() {
8950
9097
  return setShowSpeedMenu(!showSpeedMenu);
8951
9098
  },
8952
9099
  style: {
@@ -8965,12 +9112,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8965
9112
  minWidth: "".concat(56 * responsiveScale, "px"),
8966
9113
  minHeight: "".concat(40 * responsiveScale, "px")
8967
9114
  },
8968
- onMouseEnter: function(e) {
9115
+ onMouseEnter: function onMouseEnter(e) {
8969
9116
  var target = e.target;
8970
9117
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8971
9118
  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)";
8972
9119
  },
8973
- onMouseLeave: function(e) {
9120
+ onMouseLeave: function onMouseLeave(e) {
8974
9121
  var target = e.target;
8975
9122
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8976
9123
  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)";
@@ -9006,7 +9153,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9006
9153
  2
9007
9154
  ].map(function(speed) {
9008
9155
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
9009
- onClick: function() {
9156
+ onClick: function onClick() {
9010
9157
  return handlePlaybackRateChange(speed);
9011
9158
  },
9012
9159
  style: {
@@ -9024,12 +9171,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9024
9171
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
9025
9172
  borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
9026
9173
  },
9027
- onMouseEnter: function(e) {
9174
+ onMouseEnter: function onMouseEnter(e) {
9028
9175
  if (playbackRate !== speed) {
9029
9176
  e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
9030
9177
  }
9031
9178
  },
9032
- onMouseLeave: function(e) {
9179
+ onMouseLeave: function onMouseLeave(e) {
9033
9180
  if (playbackRate !== speed) {
9034
9181
  e.target.style.background = "transparent";
9035
9182
  }
@@ -9044,7 +9191,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9044
9191
  ]
9045
9192
  }),
9046
9193
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9047
- onClick: function() {
9194
+ onClick: function onClick() {
9048
9195
  if (onFullscreenToggle) {
9049
9196
  onFullscreenToggle();
9050
9197
  } else if (playerRef.current) {
@@ -9069,12 +9216,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9069
9216
  minWidth: "".concat(44 * responsiveScale, "px"),
9070
9217
  minHeight: "".concat(44 * responsiveScale, "px")
9071
9218
  },
9072
- onMouseEnter: function(e) {
9219
+ onMouseEnter: function onMouseEnter(e) {
9073
9220
  var target = e.target;
9074
9221
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
9075
9222
  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)";
9076
9223
  },
9077
- onMouseLeave: function(e) {
9224
+ onMouseLeave: function onMouseLeave(e) {
9078
9225
  var target = e.target;
9079
9226
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
9080
9227
  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)";
@@ -9118,15 +9265,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9118
9265
  padding: "8px",
9119
9266
  margin: "-8px"
9120
9267
  },
9121
- onMouseEnter: function() {
9268
+ onMouseEnter: function onMouseEnter() {
9122
9269
  return setShowVolumeSlider(true);
9123
9270
  },
9124
- onMouseLeave: function() {
9271
+ onMouseLeave: function onMouseLeave() {
9125
9272
  return setShowVolumeSlider(false);
9126
9273
  },
9127
9274
  children: [
9128
9275
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9129
- onClick: function() {
9276
+ onClick: function onClick() {
9130
9277
  if (playerRef.current) {
9131
9278
  playerRef.current.toggleMute();
9132
9279
  }
@@ -9134,12 +9281,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9134
9281
  onVolumeToggle();
9135
9282
  }
9136
9283
  },
9137
- onMouseEnter: function(e) {
9284
+ onMouseEnter: function onMouseEnter(e) {
9138
9285
  var target = e.currentTarget;
9139
9286
  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)";
9140
9287
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9141
9288
  },
9142
- onMouseLeave: function(e) {
9289
+ onMouseLeave: function onMouseLeave(e) {
9143
9290
  var target = e.currentTarget;
9144
9291
  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)";
9145
9292
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9194,10 +9341,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9194
9341
  marginBottom: "-16px",
9195
9342
  zIndex: 9
9196
9343
  },
9197
- onMouseEnter: function() {
9344
+ onMouseEnter: function onMouseEnter() {
9198
9345
  return setShowVolumeSlider(true);
9199
9346
  },
9200
- onMouseLeave: function() {
9347
+ onMouseLeave: function onMouseLeave() {
9201
9348
  return setShowVolumeSlider(false);
9202
9349
  }
9203
9350
  }),
@@ -9222,12 +9369,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9222
9369
  zIndex: 10,
9223
9370
  transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
9224
9371
  },
9225
- onMouseEnter: function(e) {
9372
+ onMouseEnter: function onMouseEnter(e) {
9226
9373
  setShowVolumeSlider(true);
9227
9374
  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)";
9228
9375
  e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
9229
9376
  },
9230
- onMouseLeave: function(e) {
9377
+ onMouseLeave: function onMouseLeave(e) {
9231
9378
  setShowVolumeSlider(false);
9232
9379
  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)";
9233
9380
  e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
@@ -9240,17 +9387,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9240
9387
  cursor: "pointer",
9241
9388
  transition: "transform 0.2s ease-in-out"
9242
9389
  },
9243
- onMouseDown: function(e) {
9390
+ onMouseDown: function onMouseDown(e) {
9244
9391
  e.preventDefault();
9245
9392
  var sliderElement = e.currentTarget;
9246
- var handleMouseMove = function(moveEvent) {
9393
+ var handleMouseMove = function handleMouseMove(moveEvent) {
9247
9394
  if (!sliderElement) return;
9248
9395
  var rect2 = sliderElement.getBoundingClientRect();
9249
9396
  var y2 = moveEvent.clientY - rect2.top;
9250
9397
  var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
9251
9398
  handleVolumeChange(percentage2);
9252
9399
  };
9253
- var handleMouseUp = function() {
9400
+ var handleMouseUp = function handleMouseUp1() {
9254
9401
  document.removeEventListener("mousemove", handleMouseMove);
9255
9402
  document.removeEventListener("mouseup", handleMouseUp);
9256
9403
  };
@@ -9261,7 +9408,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9261
9408
  var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
9262
9409
  handleVolumeChange(percentage);
9263
9410
  },
9264
- onClick: function(e) {
9411
+ onClick: function onClick(e) {
9265
9412
  e.stopPropagation();
9266
9413
  var rect = e.currentTarget.getBoundingClientRect();
9267
9414
  var y = e.clientY - rect.top;
@@ -9310,17 +9457,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9310
9457
  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",
9311
9458
  cursor: "grab"
9312
9459
  },
9313
- onMouseEnter: function(e) {
9460
+ onMouseEnter: function onMouseEnter(e) {
9314
9461
  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)";
9315
9462
  e.currentTarget.style.cursor = "grab";
9316
9463
  },
9317
- onMouseLeave: function(e) {
9464
+ onMouseLeave: function onMouseLeave(e) {
9318
9465
  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)";
9319
9466
  },
9320
- onMouseDown: function(e) {
9467
+ onMouseDown: function onMouseDown(e) {
9321
9468
  e.currentTarget.style.cursor = "grabbing";
9322
9469
  },
9323
- onMouseUp: function(e) {
9470
+ onMouseUp: function onMouseUp(e) {
9324
9471
  e.currentTarget.style.cursor = "grab";
9325
9472
  }
9326
9473
  })
@@ -9332,7 +9479,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9332
9479
  ]
9333
9480
  }),
9334
9481
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
9335
- onClick: function() {
9482
+ onClick: function onClick() {
9336
9483
  if (onFullscreenToggle) {
9337
9484
  onFullscreenToggle();
9338
9485
  } else if (playerRef.current) {
@@ -9341,12 +9488,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9341
9488
  });
9342
9489
  }
9343
9490
  },
9344
- onMouseEnter: function(e) {
9491
+ onMouseEnter: function onMouseEnter(e) {
9345
9492
  var target = e.currentTarget;
9346
9493
  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)";
9347
9494
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
9348
9495
  },
9349
- onMouseLeave: function(e) {
9496
+ onMouseLeave: function onMouseLeave(e) {
9350
9497
  var target = e.currentTarget;
9351
9498
  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)";
9352
9499
  target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
@@ -9492,7 +9639,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
9492
9639
  // src/StormcloudPlayer.tsx
9493
9640
  var import_react6 = __toESM(require("react"), 1);
9494
9641
  // src/props.ts
9495
- var noop = function() {};
9642
+ var noop = function noop() {};
9496
9643
  var defaultProps = {
9497
9644
  playing: false,
9498
9645
  loop: false,
@@ -9538,29 +9685,29 @@ var defaultProps = {
9538
9685
  // src/utils.ts
9539
9686
  var import_react2 = require("react");
9540
9687
  var lazy = import_react2.lazy;
9541
- var omit = function(object, keys) {
9688
+ var omit = function omit(object, keys) {
9542
9689
  var result = _object_spread({}, object);
9543
9690
  keys.forEach(function(key) {
9544
9691
  delete result[key];
9545
9692
  });
9546
9693
  return result;
9547
9694
  };
9548
- var isMediaStream = function(url) {
9695
+ var isMediaStream = function isMediaStream(url) {
9549
9696
  return typeof window !== "undefined" && window.MediaStream && _instanceof(url, window.MediaStream);
9550
9697
  };
9551
- var supportsWebKitPresentationMode = function() {
9698
+ var supportsWebKitPresentationMode = function supportsWebKitPresentationMode() {
9552
9699
  if (typeof window === "undefined") return false;
9553
9700
  var video = document.createElement("video");
9554
9701
  return "webkitSupportsPresentationMode" in video;
9555
9702
  };
9556
- var randomString = function() {
9703
+ var randomString = function randomString() {
9557
9704
  return Math.random().toString(36).substr(2, 9);
9558
9705
  };
9559
- var parseQuery = function(url) {
9706
+ var parseQuery = function parseQuery(url) {
9560
9707
  var query = {};
9561
9708
  var queryString = url.split("?")[1] || "";
9562
9709
  if (!queryString) return query;
9563
- var manualParse = function(qs) {
9710
+ var manualParse = function manualParse(qs) {
9564
9711
  qs.split("&").forEach(function(param) {
9565
9712
  var _param_split = _sliced_to_array(param.split("="), 2), key = _param_split[0], value = _param_split[1];
9566
9713
  if (key) {
@@ -9587,7 +9734,7 @@ var parseQuery = function(url) {
9587
9734
  }
9588
9735
  return query;
9589
9736
  };
9590
- var merge = function(target) {
9737
+ var merge = function merge1(target) {
9591
9738
  for(var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
9592
9739
  sources[_key - 1] = arguments[_key];
9593
9740
  }
@@ -9607,19 +9754,19 @@ var merge = function(target) {
9607
9754
  target
9608
9755
  ].concat(_to_consumable_array(sources)));
9609
9756
  };
9610
- var isObject = function(item) {
9757
+ var isObject = function isObject(item) {
9611
9758
  return item && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
9612
9759
  };
9613
9760
  var IS_BROWSER = typeof window !== "undefined" && window.document;
9614
9761
  var IS_GLOBAL = typeof globalThis !== "undefined" && globalThis.window && globalThis.window.document;
9615
9762
  var IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);
9616
9763
  var IS_SAFARI = IS_BROWSER && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
9617
- var SUPPORTS_HLS = function() {
9764
+ var SUPPORTS_HLS = function SUPPORTS_HLS() {
9618
9765
  if (!IS_BROWSER) return false;
9619
9766
  var video = document.createElement("video");
9620
9767
  return Boolean(video.canPlayType("application/vnd.apple.mpegurl"));
9621
9768
  };
9622
- var SUPPORTS_DASH = function() {
9769
+ var SUPPORTS_DASH = function SUPPORTS_DASH() {
9623
9770
  if (!IS_BROWSER) return false;
9624
9771
  var video = document.createElement("video");
9625
9772
  return Boolean(video.canPlayType("application/dash+xml"));
@@ -9631,23 +9778,23 @@ var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
9631
9778
  var VIDEO_EXTENSIONS = /\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)($|\?)/i;
9632
9779
  var AUDIO_EXTENSIONS = /\.(mp3|wav|ogg|aac|wma|flac|m4a)($|\?)/i;
9633
9780
  var canPlay = {
9634
- hls: function(url) {
9781
+ hls: function hls(url) {
9635
9782
  if (!url || typeof url !== "string") return false;
9636
9783
  return HLS_EXTENSIONS.test(url) || HLS_PATHS.test(url);
9637
9784
  },
9638
- dash: function(url) {
9785
+ dash: function dash(url) {
9639
9786
  if (!url || typeof url !== "string") return false;
9640
9787
  return DASH_EXTENSIONS.test(url);
9641
9788
  },
9642
- video: function(url) {
9789
+ video: function video(url) {
9643
9790
  if (!url || typeof url !== "string") return false;
9644
9791
  return VIDEO_EXTENSIONS.test(url);
9645
9792
  },
9646
- audio: function(url) {
9793
+ audio: function audio(url) {
9647
9794
  if (!url || typeof url !== "string") return false;
9648
9795
  return AUDIO_EXTENSIONS.test(url);
9649
9796
  },
9650
- file: function(url) {
9797
+ file: function file(url) {
9651
9798
  if (!url || typeof url !== "string") return false;
9652
9799
  return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url);
9653
9800
  }
@@ -9659,11 +9806,11 @@ var HlsPlayer = /*#__PURE__*/ function(_import_react3_Component) {
9659
9806
  function HlsPlayer() {
9660
9807
  _class_call_check(this, HlsPlayer);
9661
9808
  var _this;
9662
- var _this1, _arguments = arguments;
9663
- _this = _call_super(this, HlsPlayer, _to_consumable_array(_arguments)), _this1 = _this;
9664
- _this1.player = null;
9665
- _this1.mounted = false;
9666
- _this1.load = function() {
9809
+ var _this1;
9810
+ _this = _call_super(this, HlsPlayer, arguments), _this1 = _this;
9811
+ _this.player = null;
9812
+ _this.mounted = false;
9813
+ _this.load = function() {
9667
9814
  return _async_to_generator(function() {
9668
9815
  var _this_props_onMount, _this_props, config, _this_props_onReady, _this_props1, error, _this_props_onError, _this_props2;
9669
9816
  return _ts_generator(this, function(_state) {
@@ -9736,87 +9883,87 @@ var HlsPlayer = /*#__PURE__*/ function(_import_react3_Component) {
9736
9883
  });
9737
9884
  })();
9738
9885
  };
9739
- _this1.play = function() {
9740
- if (_this1.props.videoElement) {
9741
- var video = _this1.props.videoElement;
9886
+ _this.play = function() {
9887
+ if (_this.props.videoElement) {
9888
+ var video = _this.props.videoElement;
9742
9889
  var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
9743
9890
  if (hasValidSource) {
9744
9891
  var _video_play, _this_props_onPlay, _this_props;
9745
9892
  (_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
9746
9893
  var _this_props_onError, _this_props;
9747
9894
  console.error("[HlsPlayer] Failed to play:", error);
9748
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9895
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9749
9896
  });
9750
- (_this_props_onPlay = (_this_props = _this1.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9897
+ (_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9751
9898
  } else {
9752
9899
  console.warn("[HlsPlayer] Cannot play: video has no valid source");
9753
9900
  }
9754
9901
  }
9755
9902
  };
9756
- _this1.pause = function() {
9757
- if (_this1.props.videoElement) {
9903
+ _this.pause = function() {
9904
+ if (_this.props.videoElement) {
9758
9905
  var _this_props_onPause, _this_props;
9759
- _this1.props.videoElement.pause();
9760
- (_this_props_onPause = (_this_props = _this1.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9906
+ _this.props.videoElement.pause();
9907
+ (_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9761
9908
  }
9762
9909
  };
9763
- _this1.stop = function() {
9764
- _this1.pause();
9765
- if (_this1.props.videoElement) {
9766
- _this1.props.videoElement.currentTime = 0;
9910
+ _this.stop = function() {
9911
+ _this.pause();
9912
+ if (_this.props.videoElement) {
9913
+ _this.props.videoElement.currentTime = 0;
9767
9914
  }
9768
9915
  };
9769
- _this1.seekTo = function(seconds, keepPlaying) {
9770
- if (_this1.props.videoElement) {
9771
- _this1.props.videoElement.currentTime = seconds;
9916
+ _this.seekTo = function(seconds, keepPlaying) {
9917
+ if (_this.props.videoElement) {
9918
+ _this.props.videoElement.currentTime = seconds;
9772
9919
  if (!keepPlaying) {
9773
- _this1.pause();
9920
+ _this.pause();
9774
9921
  }
9775
9922
  }
9776
9923
  };
9777
- _this1.setVolume = function(volume) {
9778
- if (_this1.props.videoElement) {
9779
- _this1.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9924
+ _this.setVolume = function(volume) {
9925
+ if (_this.props.videoElement) {
9926
+ _this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9780
9927
  }
9781
9928
  };
9782
- _this1.mute = function() {
9783
- if (_this1.props.videoElement) {
9784
- _this1.props.videoElement.muted = true;
9929
+ _this.mute = function() {
9930
+ if (_this.props.videoElement) {
9931
+ _this.props.videoElement.muted = true;
9785
9932
  }
9786
9933
  };
9787
- _this1.unmute = function() {
9788
- if (_this1.props.videoElement) {
9789
- _this1.props.videoElement.muted = false;
9934
+ _this.unmute = function() {
9935
+ if (_this.props.videoElement) {
9936
+ _this.props.videoElement.muted = false;
9790
9937
  }
9791
9938
  };
9792
- _this1.setPlaybackRate = function(rate) {
9793
- if (_this1.props.videoElement && rate > 0) {
9794
- _this1.props.videoElement.playbackRate = rate;
9939
+ _this.setPlaybackRate = function(rate) {
9940
+ if (_this.props.videoElement && rate > 0) {
9941
+ _this.props.videoElement.playbackRate = rate;
9795
9942
  }
9796
9943
  };
9797
- _this1.getDuration = function() {
9798
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.duration)) {
9799
- return _this1.props.videoElement.duration;
9944
+ _this.getDuration = function() {
9945
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
9946
+ return _this.props.videoElement.duration;
9800
9947
  }
9801
9948
  return null;
9802
9949
  };
9803
- _this1.getCurrentTime = function() {
9804
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.currentTime)) {
9805
- return _this1.props.videoElement.currentTime;
9950
+ _this.getCurrentTime = function() {
9951
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
9952
+ return _this.props.videoElement.currentTime;
9806
9953
  }
9807
9954
  return null;
9808
9955
  };
9809
- _this1.getSecondsLoaded = function() {
9810
- if (_this1.props.videoElement && _this1.props.videoElement.buffered.length > 0) {
9811
- return _this1.props.videoElement.buffered.end(_this1.props.videoElement.buffered.length - 1);
9956
+ _this.getSecondsLoaded = function() {
9957
+ if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
9958
+ return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
9812
9959
  }
9813
9960
  return null;
9814
9961
  };
9815
- _this1.getInternalPlayer = function() {
9962
+ _this.getInternalPlayer = function() {
9816
9963
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
9817
- if (key === "player") return _this1.player;
9818
- if (key === "video") return _this1.props.videoElement;
9819
- if (key === "hls" && _this1.player) return _this1.player.hls;
9964
+ if (key === "player") return _this.player;
9965
+ if (key === "video") return _this.props.videoElement;
9966
+ if (key === "hls" && _this.player) return _this.player.hls;
9820
9967
  return null;
9821
9968
  };
9822
9969
  return _this;
@@ -9865,49 +10012,49 @@ var FilePlayer = /*#__PURE__*/ function(_import_react4_Component) {
9865
10012
  function FilePlayer() {
9866
10013
  _class_call_check(this, FilePlayer);
9867
10014
  var _this;
9868
- var _this1, _arguments = arguments;
9869
- _this = _call_super(this, FilePlayer, _to_consumable_array(_arguments)), _this1 = _this;
9870
- _this1.mounted = false;
9871
- _this1.ready = false;
9872
- _this1.load = function() {
10015
+ var _this1;
10016
+ _this = _call_super(this, FilePlayer, arguments), _this1 = _this;
10017
+ _this.mounted = false;
10018
+ _this.ready = false;
10019
+ _this.load = function() {
9873
10020
  var _this_props_onMount, _this_props;
9874
- if (!_this1.props.videoElement || !_this1.props.src) return;
9875
- var video = _this1.props.videoElement;
9876
- var handleLoadedMetadata = function() {
9877
- if (_this1.mounted && !_this1.ready) {
10021
+ if (!_this.props.videoElement || !_this.props.src) return;
10022
+ var video = _this.props.videoElement;
10023
+ var handleLoadedMetadata = function handleLoadedMetadata() {
10024
+ if (_this.mounted && !_this.ready) {
9878
10025
  var _this_props_onReady, _this_props;
9879
- _this1.ready = true;
9880
- (_this_props_onReady = (_this_props = _this1.props).onReady) === null || _this_props_onReady === void 0 ? void 0 : _this_props_onReady.call(_this_props);
10026
+ _this.ready = true;
10027
+ (_this_props_onReady = (_this_props = _this.props).onReady) === null || _this_props_onReady === void 0 ? void 0 : _this_props_onReady.call(_this_props);
9881
10028
  }
9882
10029
  };
9883
- var handlePlay = function() {
9884
- if (_this1.mounted) {
10030
+ var handlePlay = function handlePlay() {
10031
+ if (_this.mounted) {
9885
10032
  var _this_props_onPlay, _this_props;
9886
- (_this_props_onPlay = (_this_props = _this1.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
10033
+ (_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
9887
10034
  }
9888
10035
  };
9889
- var handlePause = function() {
9890
- if (_this1.mounted) {
10036
+ var handlePause = function handlePause() {
10037
+ if (_this.mounted) {
9891
10038
  var _this_props_onPause, _this_props;
9892
- (_this_props_onPause = (_this_props = _this1.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
10039
+ (_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
9893
10040
  }
9894
10041
  };
9895
- var handleEnded = function() {
9896
- if (_this1.mounted) {
10042
+ var handleEnded = function handleEnded() {
10043
+ if (_this.mounted) {
9897
10044
  var _this_props_onEnded, _this_props;
9898
- (_this_props_onEnded = (_this_props = _this1.props).onEnded) === null || _this_props_onEnded === void 0 ? void 0 : _this_props_onEnded.call(_this_props);
10045
+ (_this_props_onEnded = (_this_props = _this.props).onEnded) === null || _this_props_onEnded === void 0 ? void 0 : _this_props_onEnded.call(_this_props);
9899
10046
  }
9900
10047
  };
9901
- var handleError = function(error) {
9902
- if (_this1.mounted) {
10048
+ var handleError = function handleError(error) {
10049
+ if (_this.mounted) {
9903
10050
  var _this_props_onError, _this_props;
9904
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
10051
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9905
10052
  }
9906
10053
  };
9907
- var handleLoadedData = function() {
9908
- if (_this1.mounted) {
10054
+ var handleLoadedData = function handleLoadedData() {
10055
+ if (_this.mounted) {
9909
10056
  var _this_props_onLoaded, _this_props;
9910
- (_this_props_onLoaded = (_this_props = _this1.props).onLoaded) === null || _this_props_onLoaded === void 0 ? void 0 : _this_props_onLoaded.call(_this_props);
10057
+ (_this_props_onLoaded = (_this_props = _this.props).onLoaded) === null || _this_props_onLoaded === void 0 ? void 0 : _this_props_onLoaded.call(_this_props);
9911
10058
  }
9912
10059
  };
9913
10060
  video.addEventListener("loadedmetadata", handleLoadedMetadata);
@@ -9916,15 +10063,15 @@ var FilePlayer = /*#__PURE__*/ function(_import_react4_Component) {
9916
10063
  video.addEventListener("ended", handleEnded);
9917
10064
  video.addEventListener("error", handleError);
9918
10065
  video.addEventListener("loadeddata", handleLoadedData);
9919
- video.src = _this1.props.src;
9920
- if (_this1.props.autoplay !== void 0) video.autoplay = _this1.props.autoplay;
9921
- if (_this1.props.muted !== void 0) video.muted = _this1.props.muted;
9922
- if (_this1.props.loop !== void 0) video.loop = _this1.props.loop;
9923
- if (_this1.props.controls !== void 0) video.controls = _this1.props.controls;
9924
- if (_this1.props.playsInline !== void 0) video.playsInline = _this1.props.playsInline;
9925
- if (_this1.props.preload !== void 0) video.preload = _this1.props.preload;
9926
- if (_this1.props.poster !== void 0) video.poster = _this1.props.poster;
9927
- (_this_props_onMount = (_this_props = _this1.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this1);
10066
+ video.src = _this.props.src;
10067
+ if (_this.props.autoplay !== void 0) video.autoplay = _this.props.autoplay;
10068
+ if (_this.props.muted !== void 0) video.muted = _this.props.muted;
10069
+ if (_this.props.loop !== void 0) video.loop = _this.props.loop;
10070
+ if (_this.props.controls !== void 0) video.controls = _this.props.controls;
10071
+ if (_this.props.playsInline !== void 0) video.playsInline = _this.props.playsInline;
10072
+ if (_this.props.preload !== void 0) video.preload = _this.props.preload;
10073
+ if (_this.props.poster !== void 0) video.poster = _this.props.poster;
10074
+ (_this_props_onMount = (_this_props = _this.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this);
9928
10075
  return function() {
9929
10076
  video.removeEventListener("loadedmetadata", handleLoadedMetadata);
9930
10077
  video.removeEventListener("play", handlePlay);
@@ -9934,90 +10081,90 @@ var FilePlayer = /*#__PURE__*/ function(_import_react4_Component) {
9934
10081
  video.removeEventListener("loadeddata", handleLoadedData);
9935
10082
  };
9936
10083
  };
9937
- _this1.play = function() {
9938
- if (_this1.props.videoElement) {
9939
- var video = _this1.props.videoElement;
10084
+ _this.play = function() {
10085
+ if (_this.props.videoElement) {
10086
+ var video = _this.props.videoElement;
9940
10087
  var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
9941
10088
  if (hasValidSource) {
9942
10089
  var _video_play;
9943
10090
  (_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
9944
10091
  var _this_props_onError, _this_props;
9945
10092
  console.error("[FilePlayer] Failed to play:", error);
9946
- (_this_props_onError = (_this_props = _this1.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
10093
+ (_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
9947
10094
  });
9948
10095
  } else {
9949
10096
  console.warn("[FilePlayer] Cannot play: video has no valid source");
9950
10097
  }
9951
10098
  }
9952
10099
  };
9953
- _this1.pause = function() {
9954
- if (_this1.props.videoElement) {
9955
- _this1.props.videoElement.pause();
10100
+ _this.pause = function() {
10101
+ if (_this.props.videoElement) {
10102
+ _this.props.videoElement.pause();
9956
10103
  }
9957
10104
  };
9958
- _this1.stop = function() {
9959
- _this1.pause();
9960
- if (_this1.props.videoElement) {
9961
- _this1.props.videoElement.currentTime = 0;
10105
+ _this.stop = function() {
10106
+ _this.pause();
10107
+ if (_this.props.videoElement) {
10108
+ _this.props.videoElement.currentTime = 0;
9962
10109
  }
9963
10110
  };
9964
- _this1.seekTo = function(seconds, keepPlaying) {
9965
- if (_this1.props.videoElement) {
9966
- _this1.props.videoElement.currentTime = seconds;
10111
+ _this.seekTo = function(seconds, keepPlaying) {
10112
+ if (_this.props.videoElement) {
10113
+ _this.props.videoElement.currentTime = seconds;
9967
10114
  if (!keepPlaying) {
9968
- _this1.pause();
10115
+ _this.pause();
9969
10116
  }
9970
10117
  }
9971
10118
  };
9972
- _this1.setVolume = function(volume) {
9973
- if (_this1.props.videoElement) {
9974
- _this1.props.videoElement.volume = Math.max(0, Math.min(1, volume));
10119
+ _this.setVolume = function(volume) {
10120
+ if (_this.props.videoElement) {
10121
+ _this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
9975
10122
  }
9976
10123
  };
9977
- _this1.mute = function() {
9978
- if (_this1.props.videoElement) {
9979
- _this1.props.videoElement.muted = true;
10124
+ _this.mute = function() {
10125
+ if (_this.props.videoElement) {
10126
+ _this.props.videoElement.muted = true;
9980
10127
  }
9981
10128
  };
9982
- _this1.unmute = function() {
9983
- if (_this1.props.videoElement) {
9984
- _this1.props.videoElement.muted = false;
10129
+ _this.unmute = function() {
10130
+ if (_this.props.videoElement) {
10131
+ _this.props.videoElement.muted = false;
9985
10132
  }
9986
10133
  };
9987
- _this1.setPlaybackRate = function(rate) {
9988
- if (_this1.props.videoElement && rate > 0) {
9989
- _this1.props.videoElement.playbackRate = rate;
10134
+ _this.setPlaybackRate = function(rate) {
10135
+ if (_this.props.videoElement && rate > 0) {
10136
+ _this.props.videoElement.playbackRate = rate;
9990
10137
  }
9991
10138
  };
9992
- _this1.setLoop = function(loop) {
9993
- if (_this1.props.videoElement) {
9994
- _this1.props.videoElement.loop = loop;
10139
+ _this.setLoop = function(loop) {
10140
+ if (_this.props.videoElement) {
10141
+ _this.props.videoElement.loop = loop;
9995
10142
  }
9996
10143
  };
9997
- _this1.getDuration = function() {
9998
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.duration)) {
9999
- return _this1.props.videoElement.duration;
10144
+ _this.getDuration = function() {
10145
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
10146
+ return _this.props.videoElement.duration;
10000
10147
  }
10001
10148
  return null;
10002
10149
  };
10003
- _this1.getCurrentTime = function() {
10004
- if (_this1.props.videoElement && isFinite(_this1.props.videoElement.currentTime)) {
10005
- return _this1.props.videoElement.currentTime;
10150
+ _this.getCurrentTime = function() {
10151
+ if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
10152
+ return _this.props.videoElement.currentTime;
10006
10153
  }
10007
10154
  return null;
10008
10155
  };
10009
- _this1.getSecondsLoaded = function() {
10010
- if (_this1.props.videoElement && _this1.props.videoElement.buffered.length > 0) {
10011
- return _this1.props.videoElement.buffered.end(_this1.props.videoElement.buffered.length - 1);
10156
+ _this.getSecondsLoaded = function() {
10157
+ if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
10158
+ return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
10012
10159
  }
10013
10160
  return null;
10014
10161
  };
10015
- _this1.getInternalPlayer = function() {
10162
+ _this.getInternalPlayer = function() {
10016
10163
  var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
10017
- if (key === "video") return _this1.props.videoElement;
10164
+ if (key === "video") return _this.props.videoElement;
10018
10165
  return null;
10019
10166
  };
10020
- _this1.enablePIP = function() {
10167
+ _this.enablePIP = function() {
10021
10168
  return _async_to_generator(function() {
10022
10169
  var error;
10023
10170
  return _ts_generator(this, function(_state) {
@@ -10060,7 +10207,7 @@ var FilePlayer = /*#__PURE__*/ function(_import_react4_Component) {
10060
10207
  });
10061
10208
  })();
10062
10209
  };
10063
- _this1.disablePIP = function() {
10210
+ _this.disablePIP = function() {
10064
10211
  return _async_to_generator(function() {
10065
10212
  var error;
10066
10213
  return _ts_generator(this, function(_state) {
@@ -10154,7 +10301,7 @@ var players = [
10154
10301
  key: "file",
10155
10302
  name: "File Player",
10156
10303
  canPlay: canPlay.file,
10157
- canEnablePIP: function(url) {
10304
+ canEnablePIP: function canEnablePIP(url) {
10158
10305
  return canPlay.file(url) && (document.pictureInPictureEnabled || typeof document.webkitSupportsPresentationMode === "function");
10159
10306
  },
10160
10307
  lazyPlayer: lazy(function() {
@@ -10480,7 +10627,7 @@ var SUPPORTED_PROPS = [
10480
10627
  "onControlClick"
10481
10628
  ];
10482
10629
  var customPlayers = [];
10483
- var createStormcloudPlayer = function(playerList, fallback) {
10630
+ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallback) {
10484
10631
  var _a;
10485
10632
  return _a = /*#__PURE__*/ function(_import_react6_Component) {
10486
10633
  _inherits(_a, _import_react6_Component);
@@ -10492,10 +10639,10 @@ var createStormcloudPlayer = function(playerList, fallback) {
10492
10639
  showPreview: false
10493
10640
  };
10494
10641
  _this.references = {
10495
- wrapper: function(wrapper) {
10642
+ wrapper: function wrapper(wrapper) {
10496
10643
  _this.wrapper = wrapper;
10497
10644
  },
10498
- player: function(player) {
10645
+ player: function player(player) {
10499
10646
  _this.player = player;
10500
10647
  }
10501
10648
  };