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.
package/lib/index.d.cts CHANGED
@@ -219,6 +219,7 @@ declare class StormcloudVideoPlayer {
219
219
  private resolveBreakStartMs;
220
220
  getCurrentAdIndex(): number;
221
221
  getTotalAdsInBreak(): number;
222
+ getAdRemainingMs(): number;
222
223
  private generateVastUrlsWithCorrelators;
223
224
  isAdPlaying(): boolean;
224
225
  isShowingAds(): boolean;
package/lib/index.d.ts CHANGED
@@ -219,6 +219,7 @@ declare class StormcloudVideoPlayer {
219
219
  private resolveBreakStartMs;
220
220
  getCurrentAdIndex(): number;
221
221
  getTotalAdsInBreak(): number;
222
+ getAdRemainingMs(): number;
222
223
  private generateVastUrlsWithCorrelators;
223
224
  isAdPlaying(): boolean;
224
225
  isShowingAds(): boolean;
package/lib/index.js CHANGED
@@ -705,7 +705,7 @@ function createImaController(video, options) {
705
705
  adVideo.style.height = "100%";
706
706
  adVideo.style.objectFit = "contain";
707
707
  adVideo.style.backgroundColor = "transparent";
708
- adVideo.style.zIndex = "15";
708
+ adVideo.style.zIndex = "2";
709
709
  adVideo.playsInline = true;
710
710
  adVideo.volume = originalVolume;
711
711
  adVideo.muted = originalMutedState;
@@ -998,7 +998,7 @@ function createImaController(video, options) {
998
998
  container.style.alignItems = "center";
999
999
  container.style.justifyContent = "center";
1000
1000
  container.style.pointerEvents = "none";
1001
- container.style.zIndex = "10";
1001
+ container.style.zIndex = "30";
1002
1002
  container.style.backgroundColor = "#000";
1003
1003
  container.style.transition = "opacity 0.3s ease-in-out";
1004
1004
  container.style.opacity = "0";
@@ -1113,7 +1113,7 @@ function createImaController(video, options) {
1113
1113
  container.style.alignItems = "center";
1114
1114
  container.style.justifyContent = "center";
1115
1115
  container.style.pointerEvents = "none";
1116
- container.style.zIndex = "10";
1116
+ container.style.zIndex = "30";
1117
1117
  container.style.backgroundColor = "transparent";
1118
1118
  container.style.transition = "opacity 0.3s ease-in-out, background-color 0.3s ease-in-out";
1119
1119
  container.style.opacity = "0";
@@ -2028,7 +2028,7 @@ function createHlsAdPlayer(contentVideo, options) {
2028
2028
  container.style.alignItems = "center";
2029
2029
  container.style.justifyContent = "center";
2030
2030
  container.style.pointerEvents = "none";
2031
- container.style.zIndex = "10";
2031
+ container.style.zIndex = "30";
2032
2032
  container.style.backgroundColor = "#000";
2033
2033
  (_contentVideo_parentElement = contentVideo.parentElement) === null || _contentVideo_parentElement === void 0 ? void 0 : _contentVideo_parentElement.appendChild(container);
2034
2034
  adContainerEl = container;
@@ -3811,13 +3811,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3811
3811
  _this.activeAdRequestToken = null;
3812
3812
  _this.showAds = true;
3813
3813
  _this.resetGamNoFillCounter();
3814
- if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null) {
3815
- if (_this.adStopTimerId == null) {
3816
- _this.currentAdBreakStartWallClockMs = Date.now();
3817
- _this.scheduleAdStopCountdown(_this.expectedAdBreakDurationMs);
3818
- if (_this.config.debugAdTiming) {
3819
- console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
3820
- }
3814
+ if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null && _this.adStopTimerId == null) {
3815
+ _this.scheduleAdStopCountdown(_this.getRemainingAdMs());
3816
+ if (_this.config.debugAdTiming) {
3817
+ console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
3821
3818
  }
3822
3819
  }
3823
3820
  var currentMuted = _this.video.muted;
@@ -3880,6 +3877,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3880
3877
  this.ima.showPlaceholder();
3881
3878
  this.isShowingPlaceholder = true;
3882
3879
  }
3880
+ var preservedMutedState = this.ima.getOriginalMutedState();
3881
+ var preservedVolumeState = this.ima.getOriginalVolume();
3883
3882
  if (this.ima) {
3884
3883
  try {
3885
3884
  this.ima.destroy();
@@ -3894,7 +3893,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3894
3893
  var continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
3895
3894
  this.ima = this.createAdPlayer(continueLiveStreamDuringAds);
3896
3895
  this.ima.initialize();
3897
- this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
3896
+ this.ima.updateOriginalMutedState(preservedMutedState, preservedVolumeState);
3898
3897
  this.attachImaEventListeners();
3899
3898
  if (shouldShowPlaceholder) {
3900
3899
  this.showPlaceholderLayer();
@@ -4210,12 +4209,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4210
4209
  }
4211
4210
  }
4212
4211
  if (this.inAdBreak) {
4213
- if (this.expectedAdBreakDurationMs == null && marker.durationSeconds != null) {
4214
- this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
4215
- if (this.config.debugAdTiming) {
4216
- console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(this.expectedAdBreakDurationMs, "ms"));
4212
+ if (marker.durationSeconds != null) {
4213
+ var newDurationMs = marker.durationSeconds * 1e3;
4214
+ if (this.expectedAdBreakDurationMs == null || newDurationMs > this.expectedAdBreakDurationMs) {
4215
+ this.expectedAdBreakDurationMs = newDurationMs;
4216
+ var elapsedMs = this.currentAdBreakStartWallClockMs != null ? Date.now() - this.currentAdBreakStartWallClockMs : 0;
4217
+ var remainingMs = Math.max(0, newDurationMs - elapsedMs);
4218
+ this.scheduleAdStopCountdown(remainingMs);
4219
+ if (this.config.debugAdTiming) {
4220
+ console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(newDurationMs, "ms, remaining: ").concat(remainingMs, "ms"));
4221
+ }
4217
4222
  }
4218
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
4219
4223
  }
4220
4224
  return;
4221
4225
  }
@@ -4291,9 +4295,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4291
4295
  this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
4292
4296
  }
4293
4297
  if (this.expectedAdBreakDurationMs != null && this.currentAdBreakStartWallClockMs != null) {
4294
- var elapsedMs = Date.now() - this.currentAdBreakStartWallClockMs;
4295
- var remainingMs = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs);
4296
- this.scheduleAdStopCountdown(remainingMs);
4298
+ var elapsedMs1 = Date.now() - this.currentAdBreakStartWallClockMs;
4299
+ var remainingMs1 = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs1);
4300
+ this.scheduleAdStopCountdown(remainingMs1);
4297
4301
  }
4298
4302
  if (!this.ima.isAdPlaying() && this.activeAdRequestToken === null && this.adRequestQueue.length > 0) {
4299
4303
  this.tryNextAvailableAdWithRateLimit();
@@ -4861,6 +4865,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4861
4865
  return this.totalAdsInBreak;
4862
4866
  }
4863
4867
  },
4868
+ {
4869
+ key: "getAdRemainingMs",
4870
+ value: function getAdRemainingMs() {
4871
+ return this.getRemainingAdMs();
4872
+ }
4873
+ },
4864
4874
  {
4865
4875
  key: "generateVastUrlsWithCorrelators",
4866
4876
  value: function generateVastUrlsWithCorrelators(baseUrl, count) {
@@ -5513,9 +5523,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5513
5523
  ];
5514
5524
  case 2:
5515
5525
  _state.sent();
5516
- if (this.expectedAdBreakDurationMs != null) {
5517
- this.currentAdBreakStartWallClockMs = Date.now();
5518
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5526
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5527
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5519
5528
  }
5520
5529
  adVolume = currentMuted ? 0 : currentVolume;
5521
5530
  this.ima.setAdVolume(adVolume);
@@ -5556,9 +5565,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5556
5565
  ];
5557
5566
  case 6:
5558
5567
  _state.sent();
5559
- if (this.expectedAdBreakDurationMs != null) {
5560
- this.currentAdBreakStartWallClockMs = Date.now();
5561
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5568
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5569
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5562
5570
  }
5563
5571
  adVolume1 = currentMuted ? 0 : currentVolume;
5564
5572
  this.ima.setAdVolume(adVolume1);
@@ -5612,9 +5620,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5612
5620
  ];
5613
5621
  case 10:
5614
5622
  _state.sent();
5615
- if (this.expectedAdBreakDurationMs != null) {
5616
- this.currentAdBreakStartWallClockMs = Date.now();
5617
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5623
+ if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5624
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5618
5625
  }
5619
5626
  adVolume2 = currentMuted ? 0 : currentVolume;
5620
5627
  this.ima.setAdVolume(adVolume2);
@@ -5965,8 +5972,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5965
5972
  case 2:
5966
5973
  _state.sent();
5967
5974
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
5968
- this.currentAdBreakStartWallClockMs = Date.now();
5969
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
5975
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
5970
5976
  }
5971
5977
  currentMuted = this.video.muted;
5972
5978
  currentVolume = this.video.volume;
@@ -6719,8 +6725,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6719
6725
  case 5:
6720
6726
  _state.sent();
6721
6727
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
6722
- this.currentAdBreakStartWallClockMs = Date.now();
6723
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
6728
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
6724
6729
  }
6725
6730
  currentMuted = this.video.muted;
6726
6731
  currentVolume = this.video.volume;
@@ -6770,8 +6775,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6770
6775
  case 8:
6771
6776
  _state.sent();
6772
6777
  if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
6773
- this.currentAdBreakStartWallClockMs = Date.now();
6774
- this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
6778
+ this.scheduleAdStopCountdown(this.getRemainingAdMs());
6775
6779
  }
6776
6780
  currentMuted1 = this.video.muted;
6777
6781
  currentVolume1 = this.video.volume;
@@ -7350,7 +7354,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7350
7354
  return StormcloudVideoPlayer;
7351
7355
  }();
7352
7356
  // src/ui/StormcloudVideoPlayer.tsx
7353
- import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress, FaSpinner } from "react-icons/fa";
7357
+ import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress } from "react-icons/fa";
7354
7358
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7355
7359
  var CRITICAL_PROPS = [
7356
7360
  "src",
@@ -7362,6 +7366,7 @@ var CRITICAL_PROPS = [
7362
7366
  "vastMode"
7363
7367
  ];
7364
7368
  var CONTROLS_HIDE_DELAY = 3e3;
7369
+ var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
7365
7370
  var StormcloudVideoPlayerComponent = React.memo(function(props) {
7366
7371
  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, [
7367
7372
  "src",
@@ -7402,7 +7407,8 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7402
7407
  var _React_useState = _sliced_to_array(React.useState({
7403
7408
  showAds: false,
7404
7409
  currentIndex: 0,
7405
- totalAds: 0
7410
+ totalAds: 0,
7411
+ remainingSeconds: 0
7406
7412
  }), 2), adStatus = _React_useState[0], setAdStatus = _React_useState[1];
7407
7413
  var _React_useState1 = _sliced_to_array(React.useState(true), 2), shouldShowNativeControls = _React_useState1[0], setShouldShowNativeControls = _React_useState1[1];
7408
7414
  var _React_useState2 = _sliced_to_array(React.useState(false), 2), isMuted = _React_useState2[0], setIsMuted = _React_useState2[1];
@@ -7421,6 +7427,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7421
7427
  var _React_useState15 = _sliced_to_array(React.useState(true), 2), controlsVisible = _React_useState15[0], setControlsVisible = _React_useState15[1];
7422
7428
  var _React_useState16 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React_useState16[0], setViewportWidth = _React_useState16[1];
7423
7429
  var _React_useState17 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React_useState17[0], setIsPortrait = _React_useState17[1];
7430
+ var _React_useState18 = _sliced_to_array(React.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _React_useState18[0], setPlayerAspectRatio = _React_useState18[1];
7424
7431
  var getResponsiveScale = function getResponsiveScale() {
7425
7432
  if (viewportWidth < 480) return 0.7;
7426
7433
  if (viewportWidth < 768) return 0.8;
@@ -7625,15 +7632,18 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7625
7632
  var showAds = showAdsFromMethod || showAdsFromAttribute;
7626
7633
  var currentIndex = playerRef.current.getCurrentAdIndex();
7627
7634
  var totalAds = playerRef.current.getTotalAdsInBreak();
7635
+ var remainingMs = playerRef.current.getAdRemainingMs();
7636
+ var remainingSeconds = showAds ? Math.max(0, Math.ceil(remainingMs / 1e3)) : 0;
7628
7637
  setAdStatus(function(prev) {
7629
- if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds) {
7638
+ if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds || prev.remainingSeconds !== remainingSeconds) {
7630
7639
  if (showAds && !prev.showAds) {
7631
7640
  setShowCenterPlay(false);
7632
7641
  }
7633
7642
  return {
7634
7643
  showAds: showAds,
7635
7644
  currentIndex: currentIndex,
7636
- totalAds: totalAds
7645
+ totalAds: totalAds,
7646
+ remainingSeconds: remainingSeconds
7637
7647
  };
7638
7648
  }
7639
7649
  return prev;
@@ -7691,8 +7701,11 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7691
7701
  useEffect(function() {
7692
7702
  if (!videoRef.current) return;
7693
7703
  var handleLoadedMetadata = function handleLoadedMetadata() {
7694
- if (videoRef.current) {
7695
- var video2 = videoRef.current;
7704
+ var video2 = videoRef.current;
7705
+ if (video2) {
7706
+ if (video2.videoWidth > 0 && video2.videoHeight > 0) {
7707
+ setPlayerAspectRatio(video2.videoWidth / video2.videoHeight);
7708
+ }
7696
7709
  void video2.offsetHeight;
7697
7710
  }
7698
7711
  if (debugAdTiming) {
@@ -7808,6 +7821,11 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7808
7821
  }, [
7809
7822
  debugAdTiming
7810
7823
  ]);
7824
+ useEffect(function() {
7825
+ setPlayerAspectRatio(DEFAULT_PLAYER_ASPECT_RATIO);
7826
+ }, [
7827
+ src
7828
+ ]);
7811
7829
  useEffect(function() {
7812
7830
  return function() {
7813
7831
  if (controlsTimerRef.current) {
@@ -7820,7 +7838,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7820
7838
  return /* @__PURE__ */ jsxs(Fragment, {
7821
7839
  children: [
7822
7840
  /* @__PURE__ */ jsx("style", {
7823
- 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 "
7841
+ 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 "
7824
7842
  }),
7825
7843
  /* @__PURE__ */ jsxs("div", {
7826
7844
  ref: wrapperRef,
@@ -7838,6 +7856,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7838
7856
  width: isFullscreen ? "100vw" : "100%",
7839
7857
  height: isFullscreen ? "100vh" : "auto",
7840
7858
  minHeight: isFullscreen ? "100vh" : "auto",
7859
+ aspectRatio: isFullscreen ? void 0 : playerAspectRatio,
7841
7860
  maxWidth: isFullscreen ? "100vw" : "100%",
7842
7861
  maxHeight: isFullscreen ? "100vh" : "none",
7843
7862
  zIndex: isFullscreen ? 999999 : void 0,
@@ -7852,7 +7871,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7852
7871
  style: _object_spread({
7853
7872
  display: "block",
7854
7873
  width: "100%",
7855
- height: isFullscreen ? "100%" : "auto",
7874
+ height: "100%",
7856
7875
  maxWidth: "100%",
7857
7876
  maxHeight: isFullscreen ? "100%" : "none",
7858
7877
  objectFit: isFullscreen ? "cover" : "contain",
@@ -7866,18 +7885,44 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7866
7885
  }, restVideoAttrs), {
7867
7886
  children: children
7868
7887
  })),
7869
- (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ jsx(FaSpinner, {
7888
+ (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ jsxs("div", {
7870
7889
  className: "sc-loading-indicator",
7871
- size: 40,
7872
- color: "rgba(255, 255, 255, 0.85)",
7873
7890
  style: {
7874
7891
  position: "absolute",
7875
- top: "calc(50% - 20px)",
7876
- left: "calc(50% - 20px)",
7892
+ top: "50%",
7893
+ left: "50%",
7894
+ transform: "translate(-50%, -50%)",
7877
7895
  zIndex: 20,
7878
- animation: "sc-spin 0.9s linear infinite",
7879
- filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
7880
- }
7896
+ width: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7897
+ height: "".concat(Math.max(34, 38 * responsiveScale), "px"),
7898
+ display: "flex",
7899
+ alignItems: "center",
7900
+ justifyContent: "center",
7901
+ animation: "sc-loading-glow 1.4s ease-in-out infinite",
7902
+ filter: "drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55))"
7903
+ },
7904
+ children: [
7905
+ /* @__PURE__ */ jsx("div", {
7906
+ style: {
7907
+ position: "absolute",
7908
+ inset: 0,
7909
+ borderRadius: "50%",
7910
+ border: "3px solid rgba(255, 255, 255, 0.25)",
7911
+ borderTopColor: "#ff0000",
7912
+ borderRightColor: "rgba(255, 255, 255, 0.85)",
7913
+ animation: "sc-spin 0.8s linear infinite"
7914
+ }
7915
+ }),
7916
+ /* @__PURE__ */ jsx("div", {
7917
+ style: {
7918
+ width: "7px",
7919
+ height: "7px",
7920
+ borderRadius: "50%",
7921
+ background: "#ff0000",
7922
+ boxShadow: "0 0 10px rgba(255, 0, 0, 0.65)"
7923
+ }
7924
+ })
7925
+ ]
7881
7926
  }),
7882
7927
  showLicenseWarning && /* @__PURE__ */ jsxs("div", {
7883
7928
  style: {
@@ -7921,6 +7966,48 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7921
7966
  })
7922
7967
  ]
7923
7968
  }),
7969
+ adStatus.showAds && /* @__PURE__ */ jsxs("div", {
7970
+ style: {
7971
+ position: "absolute",
7972
+ top: "".concat(12 * responsiveScale, "px"),
7973
+ left: "".concat(12 * responsiveScale, "px"),
7974
+ zIndex: 50,
7975
+ display: "flex",
7976
+ alignItems: "center",
7977
+ gap: "8px",
7978
+ pointerEvents: "none",
7979
+ animation: "sc-fade-in 0.3s ease"
7980
+ },
7981
+ children: [
7982
+ /* @__PURE__ */ jsx("div", {
7983
+ style: {
7984
+ background: "rgba(234, 179, 8, 0.95)",
7985
+ color: "#111",
7986
+ padding: "".concat(4 * responsiveScale, "px ").concat(12 * responsiveScale, "px"),
7987
+ borderRadius: "6px",
7988
+ fontSize: "".concat(11 * responsiveScale, "px"),
7989
+ fontWeight: 700,
7990
+ letterSpacing: "0.08em",
7991
+ textTransform: "uppercase",
7992
+ boxShadow: "0 2px 12px rgba(234, 179, 8, 0.35)"
7993
+ },
7994
+ children: "Ad"
7995
+ }),
7996
+ /* @__PURE__ */ jsx("div", {
7997
+ style: {
7998
+ background: "rgba(0, 0, 0, 0.58)",
7999
+ color: "rgba(255, 255, 255, 0.92)",
8000
+ padding: "".concat(4 * responsiveScale, "px ").concat(10 * responsiveScale, "px"),
8001
+ borderRadius: "6px",
8002
+ fontSize: "".concat(11 * responsiveScale, "px"),
8003
+ fontWeight: 600,
8004
+ border: "1px solid rgba(255, 255, 255, 0.1)",
8005
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.25)"
8006
+ },
8007
+ children: "".concat(Math.max(1, adStatus.currentIndex), " of ").concat(Math.max(Math.max(1, adStatus.currentIndex), adStatus.totalAds))
8008
+ })
8009
+ ]
8010
+ }),
7924
8011
  showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ jsx("div", {
7925
8012
  onClick: handleCenterPlayClick,
7926
8013
  style: {
@@ -8060,7 +8147,8 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8060
8147
  /* @__PURE__ */ jsxs("div", {
8061
8148
  style: {
8062
8149
  display: "flex",
8063
- alignItems: "center"
8150
+ alignItems: "center",
8151
+ paddingRight: "".concat(6 * responsiveScale, "px")
8064
8152
  },
8065
8153
  onMouseEnter: function onMouseEnter() {
8066
8154
  return setShowVolumeSlider(true);
@@ -8089,13 +8177,13 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8089
8177
  }),
8090
8178
  /* @__PURE__ */ jsx("div", {
8091
8179
  style: {
8092
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8180
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
8093
8181
  overflow: "hidden",
8094
8182
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8095
8183
  display: "flex",
8096
8184
  alignItems: "center",
8097
- paddingLeft: showVolumeSlider ? "2px" : "0",
8098
- paddingRight: showVolumeSlider ? "4px" : "0"
8185
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8186
+ paddingRight: showVolumeSlider ? "".concat(8 * responsiveScale, "px") : "0"
8099
8187
  },
8100
8188
  children: /* @__PURE__ */ jsxs("div", {
8101
8189
  style: {
@@ -8342,7 +8430,8 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8342
8430
  alignItems: "center",
8343
8431
  background: "rgba(0, 0, 0, 0.6)",
8344
8432
  borderRadius: "".concat(18 * responsiveScale, "px"),
8345
- padding: "2px"
8433
+ padding: "2px",
8434
+ paddingRight: "".concat(8 * responsiveScale, "px")
8346
8435
  },
8347
8436
  onMouseEnter: function onMouseEnter() {
8348
8437
  return setShowVolumeSlider(true);
@@ -8371,13 +8460,13 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
8371
8460
  }),
8372
8461
  /* @__PURE__ */ jsx("div", {
8373
8462
  style: {
8374
- width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8463
+ width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
8375
8464
  overflow: "hidden",
8376
8465
  transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8377
8466
  display: "flex",
8378
8467
  alignItems: "center",
8379
- paddingLeft: showVolumeSlider ? "2px" : "0",
8380
- paddingRight: showVolumeSlider ? "6px" : "0"
8468
+ paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
8469
+ paddingRight: showVolumeSlider ? "".concat(10 * responsiveScale, "px") : "0"
8381
8470
  },
8382
8471
  children: /* @__PURE__ */ jsxs("div", {
8383
8472
  style: {