stormcloud-video-player 0.3.56 → 0.3.57

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.
@@ -692,7 +692,7 @@ function createImaController(video, options) {
692
692
  adVideo.style.height = "100%";
693
693
  adVideo.style.objectFit = "contain";
694
694
  adVideo.style.backgroundColor = "transparent";
695
- adVideo.style.zIndex = "15";
695
+ adVideo.style.zIndex = "2";
696
696
  adVideo.playsInline = true;
697
697
  adVideo.volume = originalVolume;
698
698
  adVideo.muted = originalMutedState;
@@ -985,7 +985,7 @@ function createImaController(video, options) {
985
985
  container.style.alignItems = "center";
986
986
  container.style.justifyContent = "center";
987
987
  container.style.pointerEvents = "none";
988
- container.style.zIndex = "10";
988
+ container.style.zIndex = "30";
989
989
  container.style.backgroundColor = "#000";
990
990
  container.style.transition = "opacity 0.3s ease-in-out";
991
991
  container.style.opacity = "0";
@@ -1100,7 +1100,7 @@ function createImaController(video, options) {
1100
1100
  container.style.alignItems = "center";
1101
1101
  container.style.justifyContent = "center";
1102
1102
  container.style.pointerEvents = "none";
1103
- container.style.zIndex = "10";
1103
+ container.style.zIndex = "30";
1104
1104
  container.style.backgroundColor = "transparent";
1105
1105
  container.style.transition = "opacity 0.3s ease-in-out, background-color 0.3s ease-in-out";
1106
1106
  container.style.opacity = "0";
@@ -2015,7 +2015,7 @@ function createHlsAdPlayer(contentVideo, options) {
2015
2015
  container.style.alignItems = "center";
2016
2016
  container.style.justifyContent = "center";
2017
2017
  container.style.pointerEvents = "none";
2018
- container.style.zIndex = "10";
2018
+ container.style.zIndex = "30";
2019
2019
  container.style.backgroundColor = "#000";
2020
2020
  (_contentVideo_parentElement = contentVideo.parentElement) === null || _contentVideo_parentElement === void 0 ? void 0 : _contentVideo_parentElement.appendChild(container);
2021
2021
  adContainerEl = container;
@@ -3795,13 +3795,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3795
3795
  _this.activeAdRequestToken = null;
3796
3796
  _this.showAds = true;
3797
3797
  _this.resetGamNoFillCounter();
3798
- if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null) {
3799
- if (_this.adStopTimerId == null) {
3800
- _this.currentAdBreakStartWallClockMs = Date.now();
3801
- _this.scheduleAdStopCountdown(_this.expectedAdBreakDurationMs);
3802
- if (_this.config.debugAdTiming) {
3803
- console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
3804
- }
3798
+ if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null && _this.adStopTimerId == null) {
3799
+ _this.scheduleAdStopCountdown(_this.getRemainingAdMs());
3800
+ if (_this.config.debugAdTiming) {
3801
+ console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
3805
3802
  }
3806
3803
  }
3807
3804
  var currentMuted = _this.video.muted;
@@ -3864,6 +3861,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3864
3861
  this.ima.showPlaceholder();
3865
3862
  this.isShowingPlaceholder = true;
3866
3863
  }
3864
+ var preservedMutedState = this.ima.getOriginalMutedState();
3865
+ var preservedVolumeState = this.ima.getOriginalVolume();
3867
3866
  if (this.ima) {
3868
3867
  try {
3869
3868
  this.ima.destroy();
@@ -3878,7 +3877,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3878
3877
  var continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
3879
3878
  this.ima = this.createAdPlayer(continueLiveStreamDuringAds);
3880
3879
  this.ima.initialize();
3881
- this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
3880
+ this.ima.updateOriginalMutedState(preservedMutedState, preservedVolumeState);
3882
3881
  this.attachImaEventListeners();
3883
3882
  if (shouldShowPlaceholder) {
3884
3883
  this.showPlaceholderLayer();
@@ -4194,12 +4193,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4194
4193
  }
4195
4194
  }
4196
4195
  if (this.inAdBreak) {
4197
- if (this.expectedAdBreakDurationMs == null && marker.durationSeconds != null) {
4198
- this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
4199
- if (this.config.debugAdTiming) {
4200
- console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(this.expectedAdBreakDurationMs, "ms"));
4196
+ if (marker.durationSeconds != null) {
4197
+ var newDurationMs = marker.durationSeconds * 1e3;
4198
+ if (this.expectedAdBreakDurationMs == null || newDurationMs > this.expectedAdBreakDurationMs) {
4199
+ this.expectedAdBreakDurationMs = newDurationMs;
4200
+ var elapsedMs = this.currentAdBreakStartWallClockMs != null ? Date.now() - this.currentAdBreakStartWallClockMs : 0;
4201
+ var remainingMs = Math.max(0, newDurationMs - elapsedMs);
4202
+ this.scheduleAdStopCountdown(remainingMs);
4203
+ if (this.config.debugAdTiming) {
4204
+ console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(newDurationMs, "ms, remaining: ").concat(remainingMs, "ms"));
4205
+ }
4201
4206
  }
4202
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
4203
4207
  }
4204
4208
  return;
4205
4209
  }
@@ -4275,9 +4279,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4275
4279
  this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
4276
4280
  }
4277
4281
  if (this.expectedAdBreakDurationMs != null && this.currentAdBreakStartWallClockMs != null) {
4278
- var elapsedMs = Date.now() - this.currentAdBreakStartWallClockMs;
4279
- var remainingMs = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs);
4280
- this.scheduleAdStopCountdown(remainingMs);
4282
+ var elapsedMs1 = Date.now() - this.currentAdBreakStartWallClockMs;
4283
+ var remainingMs1 = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs1);
4284
+ this.scheduleAdStopCountdown(remainingMs1);
4281
4285
  }
4282
4286
  if (!this.ima.isAdPlaying() && this.activeAdRequestToken === null && this.adRequestQueue.length > 0) {
4283
4287
  this.tryNextAvailableAdWithRateLimit();
@@ -4845,6 +4849,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4845
4849
  return this.totalAdsInBreak;
4846
4850
  }
4847
4851
  },
4852
+ {
4853
+ key: "getAdRemainingMs",
4854
+ value: function getAdRemainingMs() {
4855
+ return this.getRemainingAdMs();
4856
+ }
4857
+ },
4848
4858
  {
4849
4859
  key: "generateVastUrlsWithCorrelators",
4850
4860
  value: function generateVastUrlsWithCorrelators(baseUrl, count) {
@@ -5497,9 +5507,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5497
5507
  ];
5498
5508
  case 2:
5499
5509
  _state.sent();
5500
- if (this.expectedAdBreakDurationMs != null) {
5501
- this.currentAdBreakStartWallClockMs = Date.now();
5502
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5510
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5511
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5503
5512
  }
5504
5513
  adVolume = currentMuted ? 0 : currentVolume;
5505
5514
  this.ima.setAdVolume(adVolume);
@@ -5540,9 +5549,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5540
5549
  ];
5541
5550
  case 6:
5542
5551
  _state.sent();
5543
- if (this.expectedAdBreakDurationMs != null) {
5544
- this.currentAdBreakStartWallClockMs = Date.now();
5545
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5552
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5553
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5546
5554
  }
5547
5555
  adVolume1 = currentMuted ? 0 : currentVolume;
5548
5556
  this.ima.setAdVolume(adVolume1);
@@ -5596,9 +5604,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5596
5604
  ];
5597
5605
  case 10:
5598
5606
  _state.sent();
5599
- if (this.expectedAdBreakDurationMs != null) {
5600
- this.currentAdBreakStartWallClockMs = Date.now();
5601
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5607
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5608
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5602
5609
  }
5603
5610
  adVolume2 = currentMuted ? 0 : currentVolume;
5604
5611
  this.ima.setAdVolume(adVolume2);
@@ -5949,8 +5956,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5949
5956
  case 2:
5950
5957
  _state.sent();
5951
5958
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5952
- this.currentAdBreakStartWallClockMs = Date.now();
5953
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5959
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5954
5960
  }
5955
5961
  currentMuted = this.video.muted;
5956
5962
  currentVolume = this.video.volume;
@@ -6703,8 +6709,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6703
6709
  case 5:
6704
6710
  _state.sent();
6705
6711
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
6706
- this.currentAdBreakStartWallClockMs = Date.now();
6707
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
6712
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
6708
6713
  }
6709
6714
  currentMuted = this.video.muted;
6710
6715
  currentVolume = this.video.volume;
@@ -6754,8 +6759,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6754
6759
  case 8:
6755
6760
  _state.sent();
6756
6761
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
6757
- this.currentAdBreakStartWallClockMs = Date.now();
6758
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
6762
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
6759
6763
  }
6760
6764
  currentMuted1 = this.video.muted;
6761
6765
  currentVolume1 = this.video.volume;
@@ -7346,6 +7350,7 @@ var CRITICAL_PROPS = [
7346
7350
  "vastMode"
7347
7351
  ];
7348
7352
  var CONTROLS_HIDE_DELAY = 3e3;
7353
+ var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
7349
7354
  var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7350
7355
  var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, vmapUrl = props.vmapUrl, adPlayerType = props.adPlayerType, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7351
7356
  "src",
@@ -7386,7 +7391,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7386
7391
  var _import_react_default_useState = _sliced_to_array(import_react.default.useState({
7387
7392
  showAds: false,
7388
7393
  currentIndex: 0,
7389
- totalAds: 0
7394
+ totalAds: 0,
7395
+ remainingSeconds: 0
7390
7396
  }), 2), adStatus = _import_react_default_useState[0], setAdStatus = _import_react_default_useState[1];
7391
7397
  var _import_react_default_useState1 = _sliced_to_array(import_react.default.useState(true), 2), shouldShowNativeControls = _import_react_default_useState1[0], setShouldShowNativeControls = _import_react_default_useState1[1];
7392
7398
  var _import_react_default_useState2 = _sliced_to_array(import_react.default.useState(false), 2), isMuted = _import_react_default_useState2[0], setIsMuted = _import_react_default_useState2[1];
@@ -7405,6 +7411,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7405
7411
  var _import_react_default_useState15 = _sliced_to_array(import_react.default.useState(true), 2), controlsVisible = _import_react_default_useState15[0], setControlsVisible = _import_react_default_useState15[1];
7406
7412
  var _import_react_default_useState16 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react_default_useState16[0], setViewportWidth = _import_react_default_useState16[1];
7407
7413
  var _import_react_default_useState17 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react_default_useState17[0], setIsPortrait = _import_react_default_useState17[1];
7414
+ var _import_react_default_useState18 = _sliced_to_array(import_react.default.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _import_react_default_useState18[0], setPlayerAspectRatio = _import_react_default_useState18[1];
7408
7415
  var getResponsiveScale = function getResponsiveScale() {
7409
7416
  if (viewportWidth < 480) return 0.7;
7410
7417
  if (viewportWidth < 768) return 0.8;
@@ -7609,15 +7616,18 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7609
7616
  var showAds = showAdsFromMethod || showAdsFromAttribute;
7610
7617
  var currentIndex = playerRef.current.getCurrentAdIndex();
7611
7618
  var totalAds = playerRef.current.getTotalAdsInBreak();
7619
+ var remainingMs = playerRef.current.getAdRemainingMs();
7620
+ var remainingSeconds = showAds ? Math.max(0, Math.ceil(remainingMs / 1e3)) : 0;
7612
7621
  setAdStatus(function(prev) {
7613
- if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds) {
7622
+ if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds || prev.remainingSeconds !== remainingSeconds) {
7614
7623
  if (showAds && !prev.showAds) {
7615
7624
  setShowCenterPlay(false);
7616
7625
  }
7617
7626
  return {
7618
7627
  showAds: showAds,
7619
7628
  currentIndex: currentIndex,
7620
- totalAds: totalAds
7629
+ totalAds: totalAds,
7630
+ remainingSeconds: remainingSeconds
7621
7631
  };
7622
7632
  }
7623
7633
  return prev;
@@ -7675,8 +7685,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7675
7685
  (0, import_react.useEffect)(function() {
7676
7686
  if (!videoRef.current) return;
7677
7687
  var handleLoadedMetadata = function handleLoadedMetadata() {
7678
- if (videoRef.current) {
7679
- var video2 = videoRef.current;
7688
+ var video2 = videoRef.current;
7689
+ if (video2) {
7690
+ if (video2.videoWidth > 0 && video2.videoHeight > 0) {
7691
+ setPlayerAspectRatio(video2.videoWidth / video2.videoHeight);
7692
+ }
7680
7693
  void video2.offsetHeight;
7681
7694
  }
7682
7695
  if (debugAdTiming) {
@@ -7792,6 +7805,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7792
7805
  }, [
7793
7806
  debugAdTiming
7794
7807
  ]);
7808
+ (0, import_react.useEffect)(function() {
7809
+ setPlayerAspectRatio(DEFAULT_PLAYER_ASPECT_RATIO);
7810
+ }, [
7811
+ src
7812
+ ]);
7795
7813
  (0, import_react.useEffect)(function() {
7796
7814
  return function() {
7797
7815
  if (controlsTimerRef.current) {
@@ -7804,7 +7822,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7804
7822
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
7805
7823
  children: [
7806
7824
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
7807
- children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
7825
+ children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-loading-glow {\n 0%, 100% { opacity: 0.85; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
7808
7826
  }),
7809
7827
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7810
7828
  ref: wrapperRef,
@@ -7822,6 +7840,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7822
7840
  width: isFullscreen ? "100vw" : "100%",
7823
7841
  height: isFullscreen ? "100vh" : "auto",
7824
7842
  minHeight: isFullscreen ? "100vh" : "auto",
7843
+ aspectRatio: isFullscreen ? void 0 : playerAspectRatio,
7825
7844
  maxWidth: isFullscreen ? "100vw" : "100%",
7826
7845
  maxHeight: isFullscreen ? "100vh" : "none",
7827
7846
  zIndex: isFullscreen ? 999999 : void 0,
@@ -7836,7 +7855,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7836
7855
  style: _object_spread({
7837
7856
  display: "block",
7838
7857
  width: "100%",
7839
- height: isFullscreen ? "100%" : "auto",
7858
+ height: "100%",
7840
7859
  maxWidth: "100%",
7841
7860
  maxHeight: isFullscreen ? "100%" : "none",
7842
7861
  objectFit: isFullscreen ? "cover" : "contain",
@@ -7850,18 +7869,44 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7850
7869
  }, restVideoAttrs), {
7851
7870
  children: children
7852
7871
  })),
7853
- (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaSpinner, {
7872
+ (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7854
7873
  className: "sc-loading-indicator",
7855
- size: 40,
7856
- color: "rgba(255, 255, 255, 0.85)",
7857
7874
  style: {
7858
7875
  position: "absolute",
7859
- top: "calc(50% - 20px)",
7860
- left: "calc(50% - 20px)",
7876
+ top: "50%",
7877
+ left: "50%",
7878
+ transform: "translate(-50%, -50%)",
7861
7879
  zIndex: 20,
7862
- animation: "sc-spin 0.9s linear infinite",
7863
- filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
7864
- }
7880
+ width: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7881
+ height: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7882
+ display: "flex",
7883
+ alignItems: "center",
7884
+ justifyContent: "center",
7885
+ animation: "sc-loading-glow 1.4s ease-in-out infinite",
7886
+ filter: "drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55))"
7887
+ },
7888
+ children: [
7889
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7890
+ style: {
7891
+ position: "absolute",
7892
+ inset: 0,
7893
+ borderRadius: "50%",
7894
+ border: "3px solid rgba(255, 255, 255, 0.25)",
7895
+ borderTopColor: "#ff0000",
7896
+ borderRightColor: "rgba(255, 255, 255, 0.85)",
7897
+ animation: "sc-spin 0.8s linear infinite"
7898
+ }
7899
+ }),
7900
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7901
+ style: {
7902
+ width: "7px",
7903
+ height: "7px",
7904
+ borderRadius: "50%",
7905
+ background: "#ff0000",
7906
+ boxShadow: "0 0 10px rgba(255, 0, 0, 0.65)"
7907
+ }
7908
+ })
7909
+ ]
7865
7910
  }),
7866
7911
  showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7867
7912
  style: {
@@ -7905,6 +7950,48 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7905
7950
  })
7906
7951
  ]
7907
7952
  }),
7953
+ adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7954
+ style: {
7955
+ position: "absolute",
7956
+ top: "".concat(12 * responsiveScale, "px"),
7957
+ left: "".concat(12 * responsiveScale, "px"),
7958
+ zIndex: 50,
7959
+ display: "flex",
7960
+ alignItems: "center",
7961
+ gap: "8px",
7962
+ pointerEvents: "none",
7963
+ animation: "sc-fade-in 0.3s ease"
7964
+ },
7965
+ children: [
7966
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7967
+ style: {
7968
+ background: "rgba(234, 179, 8, 0.95)",
7969
+ color: "#111",
7970
+ padding: "".concat(4 * responsiveScale, "px ").concat(12 * responsiveScale, "px"),
7971
+ borderRadius: "6px",
7972
+ fontSize: "".concat(11 * responsiveScale, "px"),
7973
+ fontWeight: 700,
7974
+ letterSpacing: "0.08em",
7975
+ textTransform: "uppercase",
7976
+ boxShadow: "0 2px 12px rgba(234, 179, 8, 0.35)"
7977
+ },
7978
+ children: "Ad"
7979
+ }),
7980
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7981
+ style: {
7982
+ background: "rgba(0, 0, 0, 0.58)",
7983
+ color: "rgba(255, 255, 255, 0.92)",
7984
+ padding: "".concat(4 * responsiveScale, "px ").concat(10 * responsiveScale, "px"),
7985
+ borderRadius: "6px",
7986
+ fontSize: "".concat(11 * responsiveScale, "px"),
7987
+ fontWeight: 600,
7988
+ border: "1px solid rgba(255, 255, 255, 0.1)",
7989
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.25)"
7990
+ },
7991
+ children: "".concat(Math.max(1, adStatus.currentIndex), " of ").concat(Math.max(Math.max(1, adStatus.currentIndex), adStatus.totalAds))
7992
+ })
7993
+ ]
7994
+ }),
7908
7995
  showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7909
7996
  onClick: handleCenterPlayClick,
7910
7997
  style: {
@@ -8044,7 +8131,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8044
8131
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8045
8132
  style: {
8046
8133
  display: "flex",
8047
- alignItems: "center"
8134
+ alignItems: "center",
8135
+ paddingRight: "".concat(6 * responsiveScale, "px")
8048
8136
  },
8049
8137
  onMouseEnter: function onMouseEnter() {
8050
8138
  return setShowVolumeSlider(true);
@@ -8073,13 +8161,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8073
8161
  }),
8074
8162
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8075
8163
  style: {
8076
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8164
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
8077
8165
  overflow: "hidden",
8078
8166
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8079
8167
  display: "flex",
8080
8168
  alignItems: "center",
8081
- paddingLeft: showVolumeSlider ? "2px" : "0",
8082
- paddingRight: showVolumeSlider ? "4px" : "0"
8169
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8170
+ paddingRight: showVolumeSlider ? "".concat(8 * responsiveScale, "px") : "0"
8083
8171
  },
8084
8172
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8085
8173
  style: {
@@ -8326,7 +8414,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8326
8414
  alignItems: "center",
8327
8415
  background: "rgba(0, 0, 0, 0.6)",
8328
8416
  borderRadius: "".concat(18 * responsiveScale, "px"),
8329
- padding: "2px"
8417
+ padding: "2px",
8418
+ paddingRight: "".concat(8 * responsiveScale, "px")
8330
8419
  },
8331
8420
  onMouseEnter: function onMouseEnter() {
8332
8421
  return setShowVolumeSlider(true);
@@ -8355,13 +8444,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8355
8444
  }),
8356
8445
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8357
8446
  style: {
8358
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8447
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
8359
8448
  overflow: "hidden",
8360
8449
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8361
8450
  display: "flex",
8362
8451
  alignItems: "center",
8363
- paddingLeft: showVolumeSlider ? "2px" : "0",
8364
- paddingRight: showVolumeSlider ? "6px" : "0"
8452
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8453
+ paddingRight: showVolumeSlider ? "".concat(10 * responsiveScale, "px") : "0"
8365
8454
  },
8366
8455
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8367
8456
  style: {