stormcloud-video-player 0.3.54 → 0.3.55

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
@@ -512,6 +512,15 @@ __export(index_exports, {
512
512
  randomString: function randomString1() {
513
513
  return randomString;
514
514
  },
515
+ sendAdDetectTracking: function sendAdDetectTracking1() {
516
+ return sendAdDetectTracking;
517
+ },
518
+ sendAdImpressionTracking: function sendAdImpressionTracking1() {
519
+ return sendAdImpressionTracking;
520
+ },
521
+ sendAdLoadedTracking: function sendAdLoadedTracking1() {
522
+ return sendAdLoadedTracking;
523
+ },
515
524
  sendHeartbeat: function sendHeartbeat1() {
516
525
  return sendHeartbeat;
517
526
  },
@@ -2826,9 +2835,6 @@ function sendInitialTracking(licenseKey) {
2826
2835
  headers = {
2827
2836
  "Content-Type": "application/json"
2828
2837
  };
2829
- if (licenseKey) {
2830
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2831
- }
2832
2838
  return [
2833
2839
  4,
2834
2840
  fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track", {
@@ -2934,6 +2940,234 @@ function sendHeartbeat(licenseKey) {
2934
2940
  });
2935
2941
  })();
2936
2942
  }
2943
+ var TRACK_API_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2944
+ function mapToAdTrackingSource(source, adPlayerType) {
2945
+ if (source === "prebid" || source === "ima" || source === "hls") {
2946
+ return source;
2947
+ }
2948
+ if (source === "preload" || source === "ssp") {
2949
+ return source === "ssp" ? "prebid" : "ima";
2950
+ }
2951
+ return adPlayerType === "hls" ? "hls" : "ima";
2952
+ }
2953
+ function postAdTracking(licenseKey, body) {
2954
+ return _async_to_generator(function() {
2955
+ var headers, response;
2956
+ return _ts_generator(this, function(_state) {
2957
+ switch(_state.label){
2958
+ case 0:
2959
+ headers = {
2960
+ "Content-Type": "application/json"
2961
+ };
2962
+ if (licenseKey) {
2963
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2964
+ }
2965
+ return [
2966
+ 4,
2967
+ fetch(TRACK_API_URL, {
2968
+ method: "POST",
2969
+ headers: headers,
2970
+ body: JSON.stringify(body)
2971
+ })
2972
+ ];
2973
+ case 1:
2974
+ response = _state.sent();
2975
+ if (!response.ok) {
2976
+ throw new Error("HTTP error! status: ".concat(response.status));
2977
+ }
2978
+ return [
2979
+ 4,
2980
+ response.json()
2981
+ ];
2982
+ case 2:
2983
+ _state.sent();
2984
+ return [
2985
+ 2
2986
+ ];
2987
+ }
2988
+ });
2989
+ })();
2990
+ }
2991
+ function sendAdDetectTracking(licenseKey, payload) {
2992
+ return _async_to_generator(function() {
2993
+ var _payload_source, _payload_timestamp, clientInfo, browserId, adDetectInfo, body, error;
2994
+ return _ts_generator(this, function(_state) {
2995
+ switch(_state.label){
2996
+ case 0:
2997
+ _state.trys.push([
2998
+ 0,
2999
+ 3,
3000
+ ,
3001
+ 4
3002
+ ]);
3003
+ clientInfo = getClientInfo();
3004
+ return [
3005
+ 4,
3006
+ getBrowserID(clientInfo)
3007
+ ];
3008
+ case 1:
3009
+ browserId = _state.sent();
3010
+ adDetectInfo = _object_spread({
3011
+ source: (_payload_source = payload.source) !== null && _payload_source !== void 0 ? _payload_source : "scte35",
3012
+ timestamp: (_payload_timestamp = payload.timestamp) !== null && _payload_timestamp !== void 0 ? _payload_timestamp : /* @__PURE__ */ new Date().toISOString()
3013
+ }, payload.durationSeconds != null && {
3014
+ durationSeconds: payload.durationSeconds
3015
+ }, payload.ptsSeconds != null && {
3016
+ ptsSeconds: payload.ptsSeconds
3017
+ }, payload.detectedAtFragmentSn != null && {
3018
+ detectedAtFragmentSn: payload.detectedAtFragmentSn
3019
+ });
3020
+ body = _object_spread_props(_object_spread({
3021
+ browserId: browserId
3022
+ }, clientInfo, licenseKey && {
3023
+ licenseKey: licenseKey
3024
+ }), {
3025
+ adDetectInfo: adDetectInfo
3026
+ });
3027
+ return [
3028
+ 4,
3029
+ postAdTracking(licenseKey, body)
3030
+ ];
3031
+ case 2:
3032
+ _state.sent();
3033
+ return [
3034
+ 3,
3035
+ 4
3036
+ ];
3037
+ case 3:
3038
+ error = _state.sent();
3039
+ console.error("[StormcloudVideoPlayer] Error sending ad-detect tracking:", error);
3040
+ return [
3041
+ 3,
3042
+ 4
3043
+ ];
3044
+ case 4:
3045
+ return [
3046
+ 2
3047
+ ];
3048
+ }
3049
+ });
3050
+ })();
3051
+ }
3052
+ function sendAdLoadedTracking(licenseKey, payload, adPlayerType) {
3053
+ return _async_to_generator(function() {
3054
+ var clientInfo, browserId, source, adLoadedInfo, body, error;
3055
+ return _ts_generator(this, function(_state) {
3056
+ switch(_state.label){
3057
+ case 0:
3058
+ _state.trys.push([
3059
+ 0,
3060
+ 3,
3061
+ ,
3062
+ 4
3063
+ ]);
3064
+ clientInfo = getClientInfo();
3065
+ return [
3066
+ 4,
3067
+ getBrowserID(clientInfo)
3068
+ ];
3069
+ case 1:
3070
+ browserId = _state.sent();
3071
+ source = mapToAdTrackingSource(payload.source, adPlayerType);
3072
+ adLoadedInfo = _object_spread({
3073
+ source: source,
3074
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3075
+ }, payload.vastUrl != null && {
3076
+ vastUrl: payload.vastUrl
3077
+ }, payload.durationSeconds != null && {
3078
+ durationSeconds: payload.durationSeconds
3079
+ });
3080
+ body = _object_spread_props(_object_spread({
3081
+ browserId: browserId
3082
+ }, clientInfo, licenseKey && {
3083
+ licenseKey: licenseKey
3084
+ }), {
3085
+ adLoadedInfo: adLoadedInfo
3086
+ });
3087
+ return [
3088
+ 4,
3089
+ postAdTracking(licenseKey, body)
3090
+ ];
3091
+ case 2:
3092
+ _state.sent();
3093
+ return [
3094
+ 3,
3095
+ 4
3096
+ ];
3097
+ case 3:
3098
+ error = _state.sent();
3099
+ console.error("[StormcloudVideoPlayer] Error sending ad-loaded tracking:", error);
3100
+ return [
3101
+ 3,
3102
+ 4
3103
+ ];
3104
+ case 4:
3105
+ return [
3106
+ 2
3107
+ ];
3108
+ }
3109
+ });
3110
+ })();
3111
+ }
3112
+ function sendAdImpressionTracking(licenseKey, payload, adPlayerType) {
3113
+ return _async_to_generator(function() {
3114
+ var clientInfo, browserId, source, adImpressionInfo, body, error;
3115
+ return _ts_generator(this, function(_state) {
3116
+ switch(_state.label){
3117
+ case 0:
3118
+ _state.trys.push([
3119
+ 0,
3120
+ 3,
3121
+ ,
3122
+ 4
3123
+ ]);
3124
+ clientInfo = getClientInfo();
3125
+ return [
3126
+ 4,
3127
+ getBrowserID(clientInfo)
3128
+ ];
3129
+ case 1:
3130
+ browserId = _state.sent();
3131
+ source = mapToAdTrackingSource(payload.source, adPlayerType);
3132
+ adImpressionInfo = _object_spread({
3133
+ source: source,
3134
+ adIndex: payload.adIndex,
3135
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3136
+ }, payload.durationSeconds != null && {
3137
+ durationSeconds: payload.durationSeconds
3138
+ });
3139
+ body = _object_spread_props(_object_spread({
3140
+ browserId: browserId
3141
+ }, clientInfo, licenseKey && {
3142
+ licenseKey: licenseKey
3143
+ }), {
3144
+ adImpressionInfo: adImpressionInfo
3145
+ });
3146
+ return [
3147
+ 4,
3148
+ postAdTracking(licenseKey, body)
3149
+ ];
3150
+ case 2:
3151
+ _state.sent();
3152
+ return [
3153
+ 3,
3154
+ 4
3155
+ ];
3156
+ case 3:
3157
+ error = _state.sent();
3158
+ console.error("[StormcloudVideoPlayer] Error sending ad-impression tracking:", error);
3159
+ return [
3160
+ 3,
3161
+ 4
3162
+ ];
3163
+ case 4:
3164
+ return [
3165
+ 2
3166
+ ];
3167
+ }
3168
+ });
3169
+ })();
3170
+ }
2937
3171
  // src/utils/polyfills.ts
2938
3172
  function polyfillURLSearchParams() {
2939
3173
  if (typeof URLSearchParams !== "undefined") {
@@ -3234,6 +3468,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3234
3468
  this.maxPreloadPoolSize = 2;
3235
3469
  this.preloadPoolActive = false;
3236
3470
  this.preloadPoolLoopRunning = false;
3471
+ this.adDetectSentForCurrentBreak = false;
3237
3472
  this.continuousFetchLoopRunning = false;
3238
3473
  initializePolyfills();
3239
3474
  var browserOverrides = getBrowserConfigOverrides();
@@ -3703,6 +3938,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3703
3938
  value: function attachImaEventListeners() {
3704
3939
  var _this = this;
3705
3940
  this.ima.on("all_ads_completed", function() {
3941
+ sendAdImpressionTracking(_this.config.licenseKey, {
3942
+ adIndex: _this.currentAdIndex
3943
+ }, _this.config.adPlayerType).catch(function() {});
3706
3944
  var remaining = _this.getRemainingAdMs();
3707
3945
  _this.consecutiveFailures = 0;
3708
3946
  if (_this.config.debugAdTiming) {
@@ -3765,6 +4003,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3765
4003
  }
3766
4004
  });
3767
4005
  this.ima.on("content_resume", function() {
4006
+ sendAdImpressionTracking(_this.config.licenseKey, {
4007
+ adIndex: _this.currentAdIndex
4008
+ }, _this.config.adPlayerType).catch(function() {});
3768
4009
  if (!_this.video.muted) {
3769
4010
  _this.video.muted = true;
3770
4011
  _this.video.volume = 0;
@@ -4148,6 +4389,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4148
4389
  }
4149
4390
  return;
4150
4391
  }
4392
+ if (!this.adDetectSentForCurrentBreak) {
4393
+ this.adDetectSentForCurrentBreak = true;
4394
+ var detectPayload = {};
4395
+ if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4396
+ if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4397
+ sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4398
+ }
4151
4399
  var hasPrefetchedAds = this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0;
4152
4400
  this.inAdBreak = true;
4153
4401
  var durationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : ((_this_pendingAdBreak = this.pendingAdBreak) === null || _this_pendingAdBreak === void 0 ? void 0 : _this_pendingAdBreak.marker.durationSeconds) != null ? this.pendingAdBreak.marker.durationSeconds * 1e3 : void 0;
@@ -4705,6 +4953,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4705
4953
  isFetching: false,
4706
4954
  fetchStartTime: Date.now()
4707
4955
  });
4956
+ this.adDetectSentForCurrentBreak = true;
4957
+ var detectPayload = {};
4958
+ if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4959
+ if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4960
+ if (fragmentSn !== void 0) detectPayload.detectedAtFragmentSn = fragmentSn;
4961
+ sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4708
4962
  if (this.config.debugAdTiming) {
4709
4963
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
4710
4964
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
@@ -5180,6 +5434,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5180
5434
  firstAdUrl = preloaded.vastUrl;
5181
5435
  preloadedController = preloaded.imaController;
5182
5436
  usePreloadedAd = true;
5437
+ sendAdLoadedTracking(this.config.licenseKey, {
5438
+ source: "preload",
5439
+ vastUrl: firstAdUrl
5440
+ }, this.config.adPlayerType).catch(function() {});
5183
5441
  if (this.config.debugAdTiming) {
5184
5442
  console.log("[CONTINUOUS-FETCH] \uD83D\uDE80 Using preloaded ad from pool (preloaded in advance, ready immediately!)");
5185
5443
  console.log("[CONTINUOUS-FETCH] Pool still has ".concat(this.preloadPool.length, " preloaded ads ready"));
@@ -5269,6 +5527,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5269
5527
  ];
5270
5528
  case 5:
5271
5529
  _state.sent();
5530
+ sendAdLoadedTracking(this.config.licenseKey, {
5531
+ source: "ssp",
5532
+ vastUrl: firstAdUrl
5533
+ }, this.config.adPlayerType).catch(function() {});
5272
5534
  if (this.config.debugAdTiming) {
5273
5535
  console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
5274
5536
  }
@@ -5665,6 +5927,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5665
5927
  if (this.config.debugAdTiming) {
5666
5928
  console.log("[CONTINUOUS-FETCH] \uD83C\uDFAF Using preloaded ad from pool (".concat(this.preloadPool.length, " remaining in pool)"));
5667
5929
  }
5930
+ sendAdLoadedTracking(this.config.licenseKey, {
5931
+ source: "preload",
5932
+ vastUrl: preloaded.vastUrl
5933
+ }, this.config.adPlayerType).catch(function() {});
5668
5934
  _state.label = 1;
5669
5935
  case 1:
5670
5936
  _state.trys.push([
@@ -6369,6 +6635,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6369
6635
  ];
6370
6636
  case 3:
6371
6637
  _state.sent();
6638
+ sendAdLoadedTracking(this.config.licenseKey, {
6639
+ source: "ssp",
6640
+ vastUrl: vastTagUrl
6641
+ }, this.config.adPlayerType).catch(function() {});
6372
6642
  this.clearAdRequestWatchdog();
6373
6643
  if (this.activeAdRequestToken !== requestToken) {
6374
6644
  return [
@@ -6583,6 +6853,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6583
6853
  }
6584
6854
  this.adRequestQueue = [];
6585
6855
  this.inAdBreak = false;
6856
+ this.adDetectSentForCurrentBreak = false;
6586
6857
  this.expectedAdBreakDurationMs = void 0;
6587
6858
  this.currentAdBreakStartWallClockMs = void 0;
6588
6859
  this.clearAdStartTimer();
@@ -7022,6 +7293,7 @@ var CRITICAL_PROPS = [
7022
7293
  "driftToleranceMs",
7023
7294
  "vastMode"
7024
7295
  ];
7296
+ var CONTROLS_HIDE_DELAY = 3e3;
7025
7297
  var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7026
7298
  var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, adPlayerType = props.adPlayerType, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7027
7299
  "src",
@@ -7056,6 +7328,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7056
7328
  var videoRef = (0, import_react.useRef)(null);
7057
7329
  var playerRef = (0, import_react.useRef)(null);
7058
7330
  var bufferingTimeoutRef = (0, import_react.useRef)(null);
7331
+ var controlsTimerRef = (0, import_react.useRef)(null);
7332
+ var wrapperRef = (0, import_react.useRef)(null);
7059
7333
  var _import_react_default_useState = _sliced_to_array(import_react.default.useState({
7060
7334
  showAds: false,
7061
7335
  currentIndex: 0,
@@ -7075,8 +7349,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7075
7349
  var _import_react_default_useState12 = _sliced_to_array(import_react.default.useState(false), 2), isBuffering = _import_react_default_useState12[0], setIsBuffering = _import_react_default_useState12[1];
7076
7350
  var _import_react_default_useState13 = _sliced_to_array(import_react.default.useState(false), 2), showCenterPlay = _import_react_default_useState13[0], setShowCenterPlay = _import_react_default_useState13[1];
7077
7351
  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];
7078
- 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];
7079
- 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];
7352
+ 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];
7353
+ 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];
7354
+ 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];
7080
7355
  var getResponsiveScale = function getResponsiveScale() {
7081
7356
  if (viewportWidth < 480) return 0.7;
7082
7357
  if (viewportWidth < 768) return 0.8;
@@ -7084,6 +7359,33 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7084
7359
  return 1;
7085
7360
  };
7086
7361
  var responsiveScale = getResponsiveScale();
7362
+ var resetControlsTimer = (0, import_react.useCallback)(function() {
7363
+ if (controlsTimerRef.current) {
7364
+ clearTimeout(controlsTimerRef.current);
7365
+ }
7366
+ setControlsVisible(true);
7367
+ controlsTimerRef.current = window.setTimeout(function() {
7368
+ if (!showVolumeSlider && !showSpeedMenu) {
7369
+ setControlsVisible(false);
7370
+ }
7371
+ }, CONTROLS_HIDE_DELAY);
7372
+ }, [
7373
+ showVolumeSlider,
7374
+ showSpeedMenu
7375
+ ]);
7376
+ var handleWrapperMouseMove = (0, import_react.useCallback)(function() {
7377
+ resetControlsTimer();
7378
+ }, [
7379
+ resetControlsTimer
7380
+ ]);
7381
+ var handleWrapperMouseLeave = (0, import_react.useCallback)(function() {
7382
+ if (!showVolumeSlider && !showSpeedMenu) {
7383
+ setControlsVisible(false);
7384
+ }
7385
+ }, [
7386
+ showVolumeSlider,
7387
+ showSpeedMenu
7388
+ ]);
7087
7389
  var formatTime = function formatTime(seconds) {
7088
7390
  if (!isFinite(seconds)) return "0:00:00";
7089
7391
  var hours = Math.floor(seconds / 3600);
@@ -7109,6 +7411,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7109
7411
  setShowCenterPlay(true);
7110
7412
  }
7111
7413
  }
7414
+ resetControlsTimer();
7112
7415
  };
7113
7416
  var handleCenterPlayClick = function handleCenterPlayClick() {
7114
7417
  if (videoRef.current && videoRef.current.paused) {
@@ -7134,6 +7437,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7134
7437
  videoRef.current.currentTime = newTime;
7135
7438
  }
7136
7439
  }
7440
+ resetControlsTimer();
7137
7441
  };
7138
7442
  var handleVolumeChange = function handleVolumeChange(newVolume) {
7139
7443
  if (playerRef.current && isFinite(newVolume)) {
@@ -7289,7 +7593,6 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7289
7593
  (0, import_react.useEffect)(function() {
7290
7594
  if (!playerRef.current || !videoRef.current) return;
7291
7595
  var updateStates = function updateStates() {
7292
- var _videoRef_current;
7293
7596
  if (playerRef.current && videoRef.current) {
7294
7597
  setIsMuted(playerRef.current.isMuted());
7295
7598
  setIsPlaying(!videoRef.current.paused);
@@ -7302,12 +7605,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7302
7605
  var rateValue = videoRef.current.playbackRate;
7303
7606
  setPlaybackRate(isFinite(rateValue) && rateValue > 0 ? rateValue : 1);
7304
7607
  }
7305
- setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
7608
+ setIsFullscreen(document.fullscreenElement === wrapperRef.current);
7306
7609
  };
7307
7610
  var interval = setInterval(updateStates, 200);
7308
7611
  var handleFullscreenChange = function handleFullscreenChange() {
7309
- var _videoRef_current;
7310
- setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
7612
+ setIsFullscreen(document.fullscreenElement === wrapperRef.current);
7311
7613
  };
7312
7614
  document.addEventListener("fullscreenchange", handleFullscreenChange);
7313
7615
  return function() {
@@ -7435,13 +7737,25 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7435
7737
  }, [
7436
7738
  debugAdTiming
7437
7739
  ]);
7740
+ (0, import_react.useEffect)(function() {
7741
+ return function() {
7742
+ if (controlsTimerRef.current) {
7743
+ clearTimeout(controlsTimerRef.current);
7744
+ }
7745
+ };
7746
+ }, []);
7747
+ var progressPercent = duration > 0 ? currentTime / duration * 100 : 0;
7748
+ var VolumeIcon = isMuted || volume === 0 ? import_fa.FaVolumeMute : volume < 0.5 ? import_fa.FaVolumeDown : import_fa.FaVolumeUp;
7438
7749
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
7439
7750
  children: [
7440
7751
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
7441
- children: "\n @keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n \n .stormcloud-loading-hidden .stormcloud-loading-indicator {\n display: none !important;\n }\n \n .stormcloud-video-wrapper: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 \n .stormcloud-video-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 \n *:fullscreen {\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 }\n "
7752
+ 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 "
7442
7753
  }),
7443
7754
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7444
- className: "stormcloud-video-wrapper ".concat(wrapperClassName || ""),
7755
+ ref: wrapperRef,
7756
+ className: "sc-wrapper ".concat(wrapperClassName || ""),
7757
+ onMouseMove: handleWrapperMouseMove,
7758
+ onMouseLeave: handleWrapperMouseLeave,
7445
7759
  style: _object_spread({
7446
7760
  display: "flex",
7447
7761
  alignItems: "center",
@@ -7456,7 +7770,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7456
7770
  maxWidth: isFullscreen ? "100vw" : "100%",
7457
7771
  maxHeight: isFullscreen ? "100vh" : "none",
7458
7772
  zIndex: isFullscreen ? 999999 : void 0,
7459
- backgroundColor: isFullscreen ? "#000" : void 0,
7773
+ backgroundColor: "#000",
7460
7774
  borderRadius: isFullscreen ? 0 : void 0,
7461
7775
  boxShadow: isFullscreen ? "none" : void 0
7462
7776
  }, wrapperStyle),
@@ -7482,16 +7796,16 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7482
7796
  children: children
7483
7797
  })),
7484
7798
  (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaSpinner, {
7485
- className: "stormcloud-loading-indicator",
7486
- size: 42,
7487
- color: "white",
7799
+ className: "sc-loading-indicator",
7800
+ size: 40,
7801
+ color: "rgba(255, 255, 255, 0.85)",
7488
7802
  style: {
7489
7803
  position: "absolute",
7490
- top: "calc(50% - 21px)",
7491
- left: "calc(50% - 21px)",
7804
+ top: "calc(50% - 20px)",
7805
+ left: "calc(50% - 20px)",
7492
7806
  zIndex: 20,
7493
- animation: "spin 1s linear infinite",
7494
- filter: "drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8))"
7807
+ animation: "sc-spin 0.9s linear infinite",
7808
+ filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
7495
7809
  }
7496
7810
  }),
7497
7811
  showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -7501,13 +7815,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7501
7815
  left: "50%",
7502
7816
  transform: "translate(-50%, -50%)",
7503
7817
  zIndex: 25,
7504
- background: "linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%)",
7818
+ background: "rgba(220, 38, 38, 0.92)",
7819
+ backdropFilter: "blur(24px)",
7505
7820
  color: "white",
7506
- padding: "24px 32px",
7507
- borderRadius: "16px",
7508
- backdropFilter: "blur(20px)",
7509
- border: "2px solid rgba(255, 255, 255, 0.2)",
7510
- boxShadow: "0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.2)",
7821
+ padding: "28px 36px",
7822
+ borderRadius: "14px",
7823
+ border: "1px solid rgba(255, 255, 255, 0.15)",
7824
+ boxShadow: "0 24px 64px rgba(0, 0, 0, 0.5)",
7511
7825
  textAlign: "center",
7512
7826
  maxWidth: "400px",
7513
7827
  margin: "0 16px"
@@ -7515,20 +7829,18 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7515
7829
  children: [
7516
7830
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7517
7831
  style: {
7518
- fontSize: "20px",
7519
- fontWeight: "bold",
7520
- marginBottom: "12px",
7521
- color: "#ffffff",
7522
- textShadow: "0 2px 4px rgba(0, 0, 0, 0.5)"
7832
+ fontSize: "18px",
7833
+ fontWeight: "700",
7834
+ marginBottom: "10px",
7835
+ letterSpacing: "-0.02em"
7523
7836
  },
7524
7837
  children: "License Key Required"
7525
7838
  }),
7526
7839
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7527
7840
  style: {
7528
- fontSize: "14px",
7529
- lineHeight: "1.5",
7530
- color: "rgba(255, 255, 255, 0.9)",
7531
- textShadow: "0 1px 2px rgba(0, 0, 0, 0.3)"
7841
+ fontSize: "13px",
7842
+ lineHeight: "1.6",
7843
+ color: "rgba(255, 255, 255, 0.85)"
7532
7844
  },
7533
7845
  children: [
7534
7846
  "Please provide a valid license key to use the Stormcloud Video Player.",
@@ -7547,573 +7859,419 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7547
7859
  transform: "translate(-50%, -50%)",
7548
7860
  zIndex: 15,
7549
7861
  cursor: "pointer",
7550
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)",
7862
+ background: "rgba(0, 0, 0, 0.55)",
7863
+ backdropFilter: "blur(8px)",
7551
7864
  borderRadius: "50%",
7552
- width: "100px",
7553
- height: "100px",
7865
+ width: "".concat(92 * responsiveScale, "px"),
7866
+ height: "".concat(92 * responsiveScale, "px"),
7554
7867
  display: "flex",
7555
7868
  alignItems: "center",
7556
7869
  justifyContent: "center",
7557
- backdropFilter: "blur(20px)",
7558
- border: "3px solid rgba(255, 255, 255, 0.8)",
7559
- boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
7560
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
7870
+ transition: "background 0.2s ease, transform 0.2s ease",
7871
+ animation: "sc-fade-in 0.2s ease"
7561
7872
  },
7562
7873
  onMouseEnter: function onMouseEnter(e) {
7563
- var target = e.currentTarget;
7564
- target.style.transform = "translate(-50%, -50%)";
7565
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
7566
- target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
7567
- target.style.borderColor = "rgba(255, 255, 255, 0.9)";
7874
+ e.currentTarget.style.background = "rgba(0, 0, 0, 0.72)";
7875
+ e.currentTarget.style.transform = "translate(-50%, -50%) scale(1.06)";
7568
7876
  },
7569
7877
  onMouseLeave: function onMouseLeave(e) {
7570
- var target = e.currentTarget;
7571
- target.style.transform = "translate(-50%, -50%)";
7572
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
7573
- target.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)";
7574
- target.style.borderColor = "rgba(255, 255, 255, 0.8)";
7878
+ e.currentTarget.style.background = "rgba(0, 0, 0, 0.55)";
7879
+ e.currentTarget.style.transform = "translate(-50%, -50%) scale(1)";
7575
7880
  },
7576
7881
  title: "Play",
7577
7882
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaPlay, {
7578
- size: 36,
7883
+ size: Math.max(24, 32 * responsiveScale),
7579
7884
  color: "white",
7580
7885
  style: {
7581
- marginLeft: "6px",
7582
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))"
7886
+ marginLeft: "4px"
7583
7887
  }
7584
7888
  })
7585
7889
  }),
7586
- shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
7587
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7588
- style: {
7589
- position: "absolute",
7590
- bottom: 0,
7591
- left: 0,
7592
- right: 0,
7593
- background: "linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%)",
7594
- padding: "20px 16px 16px",
7595
- zIndex: 10
7596
- },
7597
- children: [
7598
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7599
- style: {
7600
- width: "100%",
7601
- height: "8px",
7602
- background: "linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%)",
7603
- borderRadius: "8px",
7604
- marginBottom: "16px",
7605
- cursor: "pointer",
7606
- position: "relative",
7607
- backdropFilter: "blur(5px)",
7608
- border: "1px solid rgba(255, 255, 255, 0.1)",
7609
- boxShadow: "inset 0 2px 4px rgba(0, 0, 0, 0.2)"
7610
- },
7611
- onClick: handleTimelineSeek,
7612
- children: [
7613
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7614
- style: {
7615
- height: "100%",
7616
- background: "linear-gradient(90deg, rgba(139, 92, 246, 0.9) 0%, rgba(59, 130, 246, 0.8) 50%, rgba(34, 197, 94, 0.9) 100%)",
7617
- borderRadius: "8px",
7618
- width: "".concat(duration > 0 ? currentTime / duration * 100 : 0, "%"),
7619
- transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7620
- boxShadow: "0 2px 8px rgba(139, 92, 246, 0.4)"
7621
- }
7622
- }),
7623
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7624
- style: {
7625
- position: "absolute",
7626
- top: "-6px",
7627
- right: "".concat(duration > 0 ? 100 - currentTime / duration * 100 : 100, "%"),
7628
- width: "20px",
7629
- height: "20px",
7630
- background: "linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.9) 100%)",
7631
- borderRadius: "50%",
7632
- border: "3px solid rgba(139, 92, 246, 0.8)",
7633
- boxShadow: "0 4px 16px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8)",
7634
- transform: "translateX(50%)",
7635
- transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
7636
- }
7637
- })
7638
- ]
7639
- }),
7640
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7641
- style: {
7642
- display: "flex",
7643
- alignItems: "center",
7644
- justifyContent: "space-between",
7645
- color: "white",
7646
- flexWrap: viewportWidth < 768 ? "wrap" : "nowrap",
7647
- gap: "".concat(8 * responsiveScale, "px")
7648
- },
7649
- children: [
7650
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7651
- style: {
7652
- display: "flex",
7653
- alignItems: "center",
7654
- gap: "".concat(12 * responsiveScale, "px"),
7655
- flexWrap: viewportWidth < 480 ? "wrap" : "nowrap"
7656
- },
7657
- children: [
7658
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
7659
- onClick: handlePlayPause,
7890
+ shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7891
+ className: "sc-controls-bar",
7892
+ style: {
7893
+ position: "absolute",
7894
+ bottom: 0,
7895
+ left: 0,
7896
+ right: 0,
7897
+ background: "linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%)",
7898
+ padding: "".concat(20 * responsiveScale, "px ").concat(12 * responsiveScale, "px ").concat(8 * responsiveScale, "px"),
7899
+ zIndex: 10,
7900
+ opacity: controlsVisible || adStatus.showAds ? 1 : 0,
7901
+ transform: controlsVisible || adStatus.showAds ? "translateY(0)" : "translateY(6px)",
7902
+ pointerEvents: controlsVisible || adStatus.showAds ? "auto" : "none"
7903
+ },
7904
+ children: [
7905
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7906
+ className: "sc-progress-track",
7907
+ style: {
7908
+ width: "100%",
7909
+ height: "3px",
7910
+ background: "rgba(255, 255, 255, 0.2)",
7911
+ borderRadius: "1.5px",
7912
+ marginBottom: "".concat(8 * responsiveScale, "px"),
7913
+ cursor: "pointer",
7914
+ position: "relative",
7915
+ transition: "height 0.1s ease"
7916
+ },
7917
+ onClick: handleTimelineSeek,
7918
+ onMouseEnter: function onMouseEnter(e) {
7919
+ e.currentTarget.style.height = "5px";
7920
+ },
7921
+ onMouseLeave: function onMouseLeave(e) {
7922
+ e.currentTarget.style.height = "3px";
7923
+ },
7924
+ children: [
7925
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7926
+ style: {
7927
+ position: "absolute",
7928
+ top: 0,
7929
+ left: 0,
7930
+ bottom: 0,
7931
+ background: adStatus.showAds ? "#f5c518" : "#ff0000",
7932
+ borderRadius: "1.5px",
7933
+ width: "".concat(progressPercent, "%"),
7934
+ transition: "width 0.15s linear"
7935
+ }
7936
+ }),
7937
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7938
+ className: "sc-progress-thumb",
7939
+ style: {
7940
+ position: "absolute",
7941
+ top: "50%",
7942
+ left: "".concat(progressPercent, "%"),
7943
+ transform: "translate(-50%, -50%) scale(0)",
7944
+ width: "13px",
7945
+ height: "13px",
7946
+ background: adStatus.showAds ? "#f5c518" : "#ff0000",
7947
+ borderRadius: "50%",
7948
+ boxShadow: "0 0 4px rgba(0, 0, 0, 0.3)",
7949
+ transition: "transform 0.1s ease, left 0.15s linear"
7950
+ }
7951
+ })
7952
+ ]
7953
+ }),
7954
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7955
+ style: {
7956
+ display: "flex",
7957
+ alignItems: "center",
7958
+ justifyContent: "space-between",
7959
+ color: "white",
7960
+ gap: "".concat(8 * responsiveScale, "px")
7961
+ },
7962
+ children: [
7963
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7964
+ style: {
7965
+ display: "flex",
7966
+ alignItems: "center",
7967
+ gap: "".concat(8 * responsiveScale, "px")
7968
+ },
7969
+ children: [
7970
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
7971
+ className: "sc-ctrl-btn",
7972
+ onClick: handlePlayPause,
7973
+ style: {
7974
+ padding: "".concat(8 * responsiveScale, "px"),
7975
+ borderRadius: "50%",
7976
+ minWidth: "".concat(36 * responsiveScale, "px"),
7977
+ minHeight: "".concat(36 * responsiveScale, "px")
7978
+ },
7979
+ title: isPlaying ? "Pause" : "Play",
7980
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaPause, {
7981
+ size: Math.max(14, 18 * responsiveScale)
7982
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaPlay, {
7983
+ size: Math.max(14, 18 * responsiveScale),
7660
7984
  style: {
7661
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
7662
- backdropFilter: "blur(12px)",
7663
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7664
- color: "#ffffff",
7665
- cursor: "pointer",
7666
- padding: "".concat(10 * responsiveScale, "px"),
7667
- borderRadius: "".concat(16 * responsiveScale, "px"),
7668
- display: "flex",
7669
- alignItems: "center",
7670
- justifyContent: "center",
7671
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7672
- 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)",
7673
- minWidth: "".concat(48 * responsiveScale, "px"),
7674
- minHeight: "".concat(48 * responsiveScale, "px")
7675
- },
7676
- onMouseEnter: function onMouseEnter(e) {
7677
- var target = e.target;
7678
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
7679
- 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)";
7680
- },
7681
- onMouseLeave: function onMouseLeave(e) {
7682
- var target = e.target;
7683
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
7684
- 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)";
7685
- },
7686
- title: isPlaying ? "Pause" : "Play",
7687
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaPause, {
7688
- size: Math.max(16, 20 * responsiveScale),
7985
+ marginLeft: "2px"
7986
+ }
7987
+ })
7988
+ }),
7989
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7990
+ style: {
7991
+ display: "flex",
7992
+ alignItems: "center"
7993
+ },
7994
+ onMouseEnter: function onMouseEnter() {
7995
+ return setShowVolumeSlider(true);
7996
+ },
7997
+ onMouseLeave: function onMouseLeave() {
7998
+ return setShowVolumeSlider(false);
7999
+ },
8000
+ children: [
8001
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8002
+ className: "sc-ctrl-btn",
8003
+ onClick: function onClick() {
8004
+ if (playerRef.current) playerRef.current.toggleMute();
8005
+ onVolumeToggle === null || onVolumeToggle === void 0 ? void 0 : onVolumeToggle();
8006
+ resetControlsTimer();
8007
+ },
7689
8008
  style: {
7690
- filter: "drop-shadow(0 0 0 transparent)"
7691
- }
7692
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaPlay, {
7693
- size: Math.max(16, 20 * responsiveScale),
8009
+ padding: "".concat(8 * responsiveScale, "px"),
8010
+ borderRadius: "50%",
8011
+ minWidth: "".concat(36 * responsiveScale, "px"),
8012
+ minHeight: "".concat(36 * responsiveScale, "px")
8013
+ },
8014
+ title: isMuted ? "Unmute" : "Mute",
8015
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VolumeIcon, {
8016
+ size: Math.max(14, 18 * responsiveScale)
8017
+ })
8018
+ }),
8019
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7694
8020
  style: {
7695
- filter: "drop-shadow(0 0 0 transparent)"
7696
- }
7697
- })
7698
- }),
7699
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7700
- style: {
7701
- position: "relative",
7702
- display: "flex",
7703
- alignItems: "center",
7704
- padding: "8px",
7705
- margin: "-8px"
7706
- },
7707
- onMouseEnter: function onMouseEnter() {
7708
- return setShowVolumeSlider(true);
7709
- },
7710
- onMouseLeave: function onMouseLeave() {
7711
- return setShowVolumeSlider(false);
7712
- },
7713
- children: [
7714
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
7715
- onClick: function onClick() {
7716
- if (playerRef.current) {
7717
- playerRef.current.toggleMute();
7718
- }
7719
- if (onVolumeToggle) {
7720
- onVolumeToggle();
7721
- }
7722
- },
8021
+ width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8022
+ overflow: "hidden",
8023
+ transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8024
+ display: "flex",
8025
+ alignItems: "center",
8026
+ paddingLeft: showVolumeSlider ? "2px" : "0",
8027
+ paddingRight: showVolumeSlider ? "4px" : "0"
8028
+ },
8029
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7723
8030
  style: {
7724
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
7725
- backdropFilter: "blur(10px)",
7726
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7727
- color: "#ffffff",
8031
+ position: "relative",
8032
+ width: "".concat(56 * responsiveScale, "px"),
8033
+ height: "3px",
7728
8034
  cursor: "pointer",
7729
- padding: "".concat(8 * responsiveScale, "px"),
7730
- borderRadius: "".concat(16 * responsiveScale, "px"),
7731
- display: "flex",
7732
- alignItems: "center",
7733
- justifyContent: "center",
7734
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7735
- 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)",
7736
- minWidth: "".concat(44 * responsiveScale, "px"),
7737
- minHeight: "".concat(44 * responsiveScale, "px")
8035
+ borderRadius: "1.5px"
7738
8036
  },
7739
- onMouseEnter: function onMouseEnter(e) {
7740
- var target = e.target;
7741
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
7742
- 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)";
8037
+ onMouseDown: function onMouseDown(e) {
8038
+ e.preventDefault();
8039
+ var el = e.currentTarget;
8040
+ var move = function move(ev) {
8041
+ var r2 = el.getBoundingClientRect();
8042
+ handleVolumeChange(Math.max(0, Math.min(1, (ev.clientX - r2.left) / r2.width)));
8043
+ };
8044
+ var up = function up1() {
8045
+ document.removeEventListener("mousemove", move);
8046
+ document.removeEventListener("mouseup", up);
8047
+ };
8048
+ document.addEventListener("mousemove", move);
8049
+ document.addEventListener("mouseup", up);
8050
+ var r = el.getBoundingClientRect();
8051
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
7743
8052
  },
7744
- onMouseLeave: function onMouseLeave(e) {
7745
- var target = e.target;
7746
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
7747
- 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)";
8053
+ onClick: function onClick(e) {
8054
+ e.stopPropagation();
8055
+ var r = e.currentTarget.getBoundingClientRect();
8056
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
7748
8057
  },
7749
- title: isMuted ? "Unmute" : "Mute",
7750
- children: isMuted || volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeMute, {
7751
- size: Math.max(14, 16 * responsiveScale),
7752
- style: {
7753
- filter: "drop-shadow(0 0 0 transparent)"
7754
- }
7755
- }) : volume < 0.5 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeDown, {
7756
- size: Math.max(14, 16 * responsiveScale),
7757
- style: {
7758
- filter: "drop-shadow(0 0 0 transparent)"
7759
- }
7760
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeUp, {
7761
- size: Math.max(14, 16 * responsiveScale),
7762
- style: {
7763
- filter: "drop-shadow(0 0 0 transparent)"
7764
- }
7765
- })
7766
- }),
7767
- showVolumeSlider && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
7768
8058
  children: [
7769
8059
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7770
8060
  style: {
7771
8061
  position: "absolute",
7772
- bottom: "100%",
7773
- left: "50%",
7774
- transform: "translateX(-50%)",
7775
- width: "60px",
7776
- height: "20px",
7777
- marginBottom: "-16px",
7778
- zIndex: 9
7779
- },
7780
- onMouseEnter: function onMouseEnter() {
7781
- return setShowVolumeSlider(true);
7782
- },
7783
- onMouseLeave: function onMouseLeave() {
7784
- return setShowVolumeSlider(false);
8062
+ inset: 0,
8063
+ background: "rgba(255, 255, 255, 0.2)",
8064
+ borderRadius: "1.5px"
7785
8065
  }
7786
8066
  }),
7787
8067
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7788
8068
  style: {
7789
8069
  position: "absolute",
7790
- bottom: "100%",
7791
- left: "50%",
7792
- transform: "translateX(-50%)",
7793
- marginBottom: "4px",
7794
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.88) 0%, rgba(20, 20, 20, 0.92) 100%)",
7795
- backdropFilter: "blur(15px)",
7796
- padding: "10px 14px",
7797
- borderRadius: "14px",
7798
- border: "1px solid rgba(255, 255, 255, 0.15)",
7799
- display: "flex",
7800
- flexDirection: "column",
7801
- alignItems: "center",
7802
- justifyContent: "center",
7803
- height: "128px",
7804
- 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)",
7805
- zIndex: 10,
7806
- transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
7807
- },
7808
- onMouseEnter: function onMouseEnter(e) {
7809
- setShowVolumeSlider(true);
7810
- 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)";
7811
- e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
7812
- },
7813
- onMouseLeave: function onMouseLeave(e) {
7814
- setShowVolumeSlider(false);
7815
- 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)";
7816
- e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
7817
- },
7818
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7819
- style: {
7820
- position: "relative",
7821
- width: "8px",
7822
- height: "104px",
7823
- cursor: "pointer",
7824
- transition: "transform 0.2s ease-in-out"
7825
- },
7826
- onMouseEnter: function onMouseEnter(e) {},
7827
- onMouseLeave: function onMouseLeave(e) {},
7828
- onMouseDown: function onMouseDown(e) {
7829
- e.preventDefault();
7830
- var sliderElement = e.currentTarget;
7831
- var handleMouseMove = function handleMouseMove(moveEvent) {
7832
- if (!sliderElement) return;
7833
- var rect2 = sliderElement.getBoundingClientRect();
7834
- var y2 = moveEvent.clientY - rect2.top;
7835
- var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
7836
- handleVolumeChange(percentage2);
7837
- };
7838
- var handleMouseUp = function handleMouseUp1() {
7839
- document.removeEventListener("mousemove", handleMouseMove);
7840
- document.removeEventListener("mouseup", handleMouseUp);
7841
- };
7842
- document.addEventListener("mousemove", handleMouseMove);
7843
- document.addEventListener("mouseup", handleMouseUp);
7844
- var rect = sliderElement.getBoundingClientRect();
7845
- var y = e.clientY - rect.top;
7846
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
7847
- handleVolumeChange(percentage);
7848
- },
7849
- onClick: function onClick(e) {
7850
- e.stopPropagation();
7851
- var rect = e.currentTarget.getBoundingClientRect();
7852
- var y = e.clientY - rect.top;
7853
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
7854
- handleVolumeChange(percentage);
7855
- },
7856
- children: [
7857
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7858
- style: {
7859
- position: "absolute",
7860
- bottom: "0",
7861
- left: "0",
7862
- width: "100%",
7863
- height: "100%",
7864
- background: "linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%)",
7865
- borderRadius: "4px",
7866
- boxShadow: "inset 0 1px 3px rgba(0, 0, 0, 0.2)"
7867
- }
7868
- }),
7869
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7870
- style: {
7871
- position: "absolute",
7872
- bottom: "0",
7873
- left: "0",
7874
- width: "100%",
7875
- height: "".concat((isMuted ? 0 : volume) * 100, "%"),
7876
- background: "linear-gradient(180deg, rgba(96, 165, 250, 1) 0%, rgba(59, 130, 246, 0.95) 50%, rgba(37, 99, 235, 0.9) 100%)",
7877
- borderRadius: "4px",
7878
- transition: "height 0.15s ease-out, box-shadow 0.2s ease-in-out",
7879
- boxShadow: "0 0 8px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3)"
7880
- }
7881
- }),
7882
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7883
- style: {
7884
- position: "absolute",
7885
- bottom: "calc(".concat((isMuted ? 0 : volume) * 100, "% - 7px)"),
7886
- left: "50%",
7887
- transform: "translateX(-50%)",
7888
- width: "14px",
7889
- height: "14px",
7890
- background: "linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%)",
7891
- borderRadius: "50%",
7892
- 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)",
7893
- 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",
7894
- cursor: "grab"
7895
- },
7896
- onMouseEnter: function onMouseEnter(e) {
7897
- 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)";
7898
- e.currentTarget.style.cursor = "grab";
7899
- },
7900
- onMouseLeave: function onMouseLeave(e) {
7901
- 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)";
7902
- },
7903
- onMouseDown: function onMouseDown(e) {
7904
- e.currentTarget.style.cursor = "grabbing";
7905
- },
7906
- onMouseUp: function onMouseUp(e) {
7907
- e.currentTarget.style.cursor = "grab";
7908
- }
7909
- })
7910
- ]
7911
- })
8070
+ top: 0,
8071
+ left: 0,
8072
+ bottom: 0,
8073
+ width: "".concat((isMuted ? 0 : volume) * 100, "%"),
8074
+ background: "#fff",
8075
+ borderRadius: "1.5px",
8076
+ transition: "width 0.1s ease-out"
8077
+ }
8078
+ }),
8079
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8080
+ style: {
8081
+ position: "absolute",
8082
+ top: "50%",
8083
+ left: "".concat((isMuted ? 0 : volume) * 100, "%"),
8084
+ transform: "translate(-50%, -50%)",
8085
+ width: "12px",
8086
+ height: "12px",
8087
+ background: "#fff",
8088
+ borderRadius: "50%",
8089
+ boxShadow: "0 0 3px rgba(0, 0, 0, 0.3)",
8090
+ transition: "left 0.1s ease-out"
8091
+ }
7912
8092
  })
7913
8093
  ]
7914
8094
  })
7915
- ]
7916
- }),
7917
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7918
- style: {
7919
- fontSize: "".concat(14 * responsiveScale, "px"),
7920
- fontFamily: "monospace",
7921
- color: "rgba(255, 255, 255, 0.9)",
7922
- display: viewportWidth < 480 ? "none" : "block"
7923
- },
7924
- children: [
7925
- formatTime(currentTime),
7926
- " / ",
7927
- formatTime(duration)
7928
- ]
7929
- })
7930
- ]
7931
- }),
7932
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7933
- style: {
7934
- display: "flex",
7935
- alignItems: "center",
7936
- gap: "".concat(12 * responsiveScale, "px")
7937
- },
7938
- children: [
7939
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
7940
- style: {
7941
- position: "relative",
7942
- display: viewportWidth < 600 ? "none" : "block"
7943
- },
7944
- children: [
7945
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
7946
- onClick: function onClick() {
7947
- return setShowSpeedMenu(!showSpeedMenu);
7948
- },
7949
- style: {
7950
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
7951
- backdropFilter: "blur(10px)",
7952
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7953
- color: "#ffffff",
7954
- cursor: "pointer",
7955
- padding: "".concat(8 * responsiveScale, "px ").concat(14 * responsiveScale, "px"),
7956
- borderRadius: "".concat(14 * responsiveScale, "px"),
7957
- fontSize: "".concat(14 * responsiveScale, "px"),
7958
- fontFamily: "monospace",
7959
- fontWeight: "700",
7960
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7961
- 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)",
7962
- minWidth: "".concat(56 * responsiveScale, "px"),
7963
- minHeight: "".concat(40 * responsiveScale, "px")
7964
- },
7965
- onMouseEnter: function onMouseEnter(e) {
7966
- var target = e.target;
7967
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
7968
- 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)";
7969
- },
7970
- onMouseLeave: function onMouseLeave(e) {
7971
- var target = e.target;
7972
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
7973
- 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)";
7974
- },
7975
- title: "Playback Speed",
7976
- children: [
7977
- playbackRate,
7978
- "x"
7979
- ]
7980
- }),
7981
- showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
7982
- style: {
7983
- position: "absolute",
7984
- bottom: "100%",
7985
- right: 0,
7986
- marginBottom: "12px",
7987
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%)",
7988
- backdropFilter: "blur(20px)",
7989
- borderRadius: "12px",
7990
- border: "1px solid rgba(255, 255, 255, 0.1)",
7991
- overflow: "hidden",
7992
- minWidth: "90px",
7993
- boxShadow: "0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1)"
7994
- },
7995
- children: [
7996
- 0.25,
7997
- 0.5,
7998
- 0.75,
7999
- 1,
8000
- 1.25,
8001
- 1.5,
8002
- 1.75,
8003
- 2
8004
- ].map(function(speed) {
8005
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8006
- onClick: function onClick() {
8007
- return handlePlaybackRateChange(speed);
8008
- },
8009
- style: {
8010
- display: "block",
8011
- width: "100%",
8012
- padding: "10px 16px",
8013
- background: playbackRate === speed ? "linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(139, 92, 246, 0.6) 100%)" : "transparent",
8014
- border: "none",
8015
- color: "white",
8016
- cursor: "pointer",
8017
- fontSize: "13px",
8018
- fontFamily: "monospace",
8019
- fontWeight: "600",
8020
- textAlign: "center",
8021
- transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8022
- borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
8023
- },
8024
- onMouseEnter: function onMouseEnter(e) {
8025
- if (playbackRate !== speed) {
8026
- e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
8027
- }
8028
- },
8029
- onMouseLeave: function onMouseLeave(e) {
8030
- if (playbackRate !== speed) {
8031
- e.target.style.background = "transparent";
8032
- }
8033
- },
8034
- children: [
8035
- speed,
8036
- "x"
8037
- ]
8038
- }, speed);
8039
- })
8040
- })
8041
- ]
8042
- }),
8043
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8044
- onClick: function onClick() {
8045
- if (onFullscreenToggle) {
8046
- onFullscreenToggle();
8047
- } else if (playerRef.current) {
8048
- playerRef.current.toggleFullscreen().catch(function(err) {
8049
- console.error("Fullscreen error:", err);
8050
- });
8051
- }
8052
- },
8053
- style: {
8054
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
8055
- backdropFilter: "blur(10px)",
8056
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
8057
- color: "#ffffff",
8058
- cursor: "pointer",
8059
- padding: "".concat(8 * responsiveScale, "px"),
8060
- borderRadius: "".concat(16 * responsiveScale, "px"),
8061
- display: "flex",
8062
- alignItems: "center",
8063
- justifyContent: "center",
8064
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
8065
- 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)",
8066
- minWidth: "".concat(44 * responsiveScale, "px"),
8067
- minHeight: "".concat(44 * responsiveScale, "px")
8068
- },
8069
- onMouseEnter: function onMouseEnter(e) {
8070
- var target = e.target;
8071
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
8072
- 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)";
8073
- },
8074
- onMouseLeave: function onMouseLeave(e) {
8075
- var target = e.target;
8076
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
8077
- 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)";
8078
- },
8079
- title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
8080
- children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaCompress, {
8081
- size: Math.max(14, 16 * responsiveScale),
8095
+ })
8096
+ ]
8097
+ }),
8098
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8099
+ style: {
8100
+ fontSize: "".concat(13 * responsiveScale, "px"),
8101
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
8102
+ color: "rgba(255, 255, 255, 0.9)",
8103
+ display: viewportWidth < 480 ? "none" : "block",
8104
+ fontVariantNumeric: "tabular-nums",
8105
+ userSelect: "none",
8106
+ marginLeft: "".concat(4 * responsiveScale, "px")
8107
+ },
8108
+ children: [
8109
+ formatTime(currentTime),
8110
+ " ",
8111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
8082
8112
  style: {
8083
- filter: "drop-shadow(0 0 0 transparent)"
8084
- }
8085
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaExpand, {
8086
- size: Math.max(14, 16 * responsiveScale),
8113
+ color: "rgba(255,255,255,0.5)"
8114
+ },
8115
+ children: "/"
8116
+ }),
8117
+ " ",
8118
+ formatTime(duration)
8119
+ ]
8120
+ })
8121
+ ]
8122
+ }),
8123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8124
+ style: {
8125
+ display: "flex",
8126
+ alignItems: "center",
8127
+ gap: "".concat(8 * responsiveScale, "px")
8128
+ },
8129
+ children: [
8130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8131
+ style: {
8132
+ position: "relative",
8133
+ display: viewportWidth < 600 ? "none" : "block"
8134
+ },
8135
+ children: [
8136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8137
+ className: "sc-ctrl-btn",
8138
+ onClick: function onClick() {
8139
+ setShowSpeedMenu(!showSpeedMenu);
8140
+ resetControlsTimer();
8141
+ },
8087
8142
  style: {
8088
- filter: "drop-shadow(0 0 0 transparent)"
8089
- }
8143
+ padding: "".concat(6 * responsiveScale, "px ").concat(10 * responsiveScale, "px"),
8144
+ borderRadius: "".concat(6 * responsiveScale, "px"),
8145
+ fontSize: "".concat(13 * responsiveScale, "px"),
8146
+ fontFamily: "'SF Mono', 'Cascadia Code', monospace",
8147
+ fontWeight: "600",
8148
+ minHeight: "".concat(32 * responsiveScale, "px")
8149
+ },
8150
+ title: "Playback Speed",
8151
+ children: [
8152
+ playbackRate,
8153
+ "x"
8154
+ ]
8155
+ }),
8156
+ showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8157
+ style: {
8158
+ position: "absolute",
8159
+ bottom: "100%",
8160
+ right: 0,
8161
+ marginBottom: "8px",
8162
+ background: "rgba(0, 0, 0, 0.8)",
8163
+ backdropFilter: "blur(24px)",
8164
+ WebkitBackdropFilter: "blur(24px)",
8165
+ borderRadius: "10px",
8166
+ border: "1px solid rgba(255, 255, 255, 0.1)",
8167
+ overflow: "hidden",
8168
+ minWidth: "80px",
8169
+ boxShadow: "0 12px 40px rgba(0, 0, 0, 0.5)",
8170
+ animation: "sc-fade-in 0.15s ease"
8171
+ },
8172
+ children: [
8173
+ 0.25,
8174
+ 0.5,
8175
+ 0.75,
8176
+ 1,
8177
+ 1.25,
8178
+ 1.5,
8179
+ 1.75,
8180
+ 2
8181
+ ].map(function(speed) {
8182
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
8183
+ onClick: function onClick() {
8184
+ return handlePlaybackRateChange(speed);
8185
+ },
8186
+ style: {
8187
+ display: "block",
8188
+ width: "100%",
8189
+ padding: "".concat(8 * responsiveScale, "px ").concat(14 * responsiveScale, "px"),
8190
+ background: playbackRate === speed ? "rgba(255, 255, 255, 0.12)" : "transparent",
8191
+ border: "none",
8192
+ color: playbackRate === speed ? "#fff" : "rgba(255, 255, 255, 0.7)",
8193
+ cursor: "pointer",
8194
+ fontSize: "".concat(12 * responsiveScale, "px"),
8195
+ fontFamily: "'SF Mono', monospace",
8196
+ fontWeight: playbackRate === speed ? "700" : "500",
8197
+ textAlign: "center",
8198
+ transition: "background 0.15s ease, color 0.15s ease"
8199
+ },
8200
+ onMouseEnter: function onMouseEnter(e) {
8201
+ if (playbackRate !== speed) {
8202
+ e.target.style.background = "rgba(255, 255, 255, 0.08)";
8203
+ e.target.style.color = "#fff";
8204
+ }
8205
+ },
8206
+ onMouseLeave: function onMouseLeave(e) {
8207
+ if (playbackRate !== speed) {
8208
+ e.target.style.background = "transparent";
8209
+ e.target.style.color = "rgba(255, 255, 255, 0.7)";
8210
+ }
8211
+ },
8212
+ children: [
8213
+ speed,
8214
+ "x"
8215
+ ]
8216
+ }, speed);
8217
+ })
8090
8218
  })
8219
+ ]
8220
+ }),
8221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8222
+ className: "sc-ctrl-btn",
8223
+ onClick: function onClick() {
8224
+ if (onFullscreenToggle) {
8225
+ onFullscreenToggle();
8226
+ } else if (wrapperRef.current) {
8227
+ if (!document.fullscreenElement) {
8228
+ wrapperRef.current.requestFullscreen().catch(function() {});
8229
+ } else {
8230
+ document.exitFullscreen().catch(function() {});
8231
+ }
8232
+ }
8233
+ resetControlsTimer();
8234
+ },
8235
+ style: {
8236
+ padding: "".concat(8 * responsiveScale, "px"),
8237
+ borderRadius: "50%",
8238
+ minWidth: "".concat(36 * responsiveScale, "px"),
8239
+ minHeight: "".concat(36 * responsiveScale, "px")
8240
+ },
8241
+ title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
8242
+ children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaCompress, {
8243
+ size: Math.max(14, 18 * responsiveScale)
8244
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaExpand, {
8245
+ size: Math.max(14, 18 * responsiveScale)
8091
8246
  })
8092
- ]
8093
- })
8094
- ]
8095
- })
8096
- ]
8097
- })
8247
+ })
8248
+ ]
8249
+ })
8250
+ ]
8251
+ })
8252
+ ]
8098
8253
  }) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8254
+ className: "sc-controls-bar",
8099
8255
  style: {
8100
8256
  position: "absolute",
8101
8257
  bottom: "".concat(10 * responsiveScale, "px"),
8102
8258
  right: "".concat(10 * responsiveScale, "px"),
8103
- transform: "none",
8104
8259
  display: "flex",
8105
8260
  flexDirection: isPortrait ? "column" : "row",
8106
- gap: "".concat(10 * responsiveScale, "px"),
8107
- zIndex: 10
8261
+ gap: "".concat(8 * responsiveScale, "px"),
8262
+ zIndex: 10,
8263
+ opacity: controlsVisible ? 1 : 0,
8264
+ transform: controlsVisible ? "translateY(0)" : "translateY(4px)",
8265
+ pointerEvents: controlsVisible ? "auto" : "none"
8108
8266
  },
8109
8267
  children: [
8110
8268
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8111
8269
  style: {
8112
- position: "relative",
8113
8270
  display: "flex",
8114
8271
  alignItems: "center",
8115
- padding: "8px",
8116
- margin: "-8px"
8272
+ background: "rgba(0, 0, 0, 0.6)",
8273
+ borderRadius: "".concat(18 * responsiveScale, "px"),
8274
+ padding: "2px"
8117
8275
  },
8118
8276
  onMouseEnter: function onMouseEnter() {
8119
8277
  return setShowVolumeSlider(true);
@@ -8123,260 +8281,128 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
8123
8281
  },
8124
8282
  children: [
8125
8283
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8284
+ className: "sc-ctrl-btn",
8126
8285
  onClick: function onClick() {
8127
- if (playerRef.current) {
8128
- playerRef.current.toggleMute();
8129
- }
8130
- if (onVolumeToggle) {
8131
- onVolumeToggle();
8132
- }
8133
- },
8134
- onMouseEnter: function onMouseEnter(e) {
8135
- var target = e.currentTarget;
8136
- 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)";
8137
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8138
- },
8139
- onMouseLeave: function onMouseLeave(e) {
8140
- var target = e.currentTarget;
8141
- 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)";
8142
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8286
+ if (playerRef.current) playerRef.current.toggleMute();
8287
+ onVolumeToggle === null || onVolumeToggle === void 0 ? void 0 : onVolumeToggle();
8288
+ resetControlsTimer();
8143
8289
  },
8144
8290
  style: {
8145
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
8146
- color: "#ffffff",
8147
- border: "none",
8148
- borderRadius: "".concat(18 * responsiveScale, "px"),
8149
8291
  padding: "".concat(8 * responsiveScale, "px"),
8150
- cursor: "pointer",
8151
- display: "flex",
8152
- alignItems: "center",
8153
- justifyContent: "center",
8154
- backdropFilter: "blur(20px)",
8155
- 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)",
8156
- transition: "all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
8157
- minWidth: "".concat(46 * responsiveScale, "px"),
8158
- minHeight: "".concat(46 * responsiveScale, "px")
8292
+ borderRadius: "50%",
8293
+ minWidth: "".concat(36 * responsiveScale, "px"),
8294
+ minHeight: "".concat(36 * responsiveScale, "px")
8159
8295
  },
8160
8296
  title: isMuted ? "Unmute" : "Mute",
8161
- children: isMuted || volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeMute, {
8162
- size: Math.max(14, 16 * responsiveScale),
8163
- style: {
8164
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8165
- color: "#ffffff"
8166
- }
8167
- }) : volume < 0.5 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeDown, {
8168
- size: Math.max(14, 16 * responsiveScale),
8169
- style: {
8170
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8171
- color: "#ffffff"
8172
- }
8173
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaVolumeUp, {
8174
- size: Math.max(14, 16 * responsiveScale),
8175
- style: {
8176
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8177
- color: "#ffffff"
8178
- }
8297
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VolumeIcon, {
8298
+ size: Math.max(14, 18 * responsiveScale)
8179
8299
  })
8180
8300
  }),
8181
- showVolumeSlider && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
8182
- children: [
8183
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8184
- style: {
8185
- position: "absolute",
8186
- bottom: "100%",
8187
- left: "50%",
8188
- transform: "translateX(-50%)",
8189
- width: "60px",
8190
- height: "20px",
8191
- marginBottom: "-16px",
8192
- zIndex: 9
8193
- },
8194
- onMouseEnter: function onMouseEnter() {
8195
- return setShowVolumeSlider(true);
8196
- },
8197
- onMouseLeave: function onMouseLeave() {
8198
- return setShowVolumeSlider(false);
8199
- }
8200
- }),
8201
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8202
- style: {
8203
- position: "absolute",
8204
- bottom: "100%",
8205
- left: "50%",
8206
- transform: "translateX(-50%)",
8207
- marginBottom: "4px",
8208
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.96) 0%, rgba(20, 20, 20, 0.92) 100%)",
8209
- backdropFilter: "blur(20px)",
8210
- padding: "10px 14px",
8211
- borderRadius: "14px",
8212
- border: "2px solid rgba(255, 255, 255, 0.7)",
8213
- display: "flex",
8214
- flexDirection: "column",
8215
- alignItems: "center",
8216
- justifyContent: "center",
8217
- height: "128px",
8218
- 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)",
8219
- zIndex: 10,
8220
- transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8221
- },
8222
- onMouseEnter: function onMouseEnter(e) {
8223
- setShowVolumeSlider(true);
8224
- 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)";
8225
- e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
8226
- },
8227
- onMouseLeave: function onMouseLeave(e) {
8228
- setShowVolumeSlider(false);
8229
- 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)";
8230
- e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
8231
- },
8232
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8301
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8302
+ style: {
8303
+ width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8304
+ overflow: "hidden",
8305
+ transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8306
+ display: "flex",
8307
+ alignItems: "center",
8308
+ paddingLeft: showVolumeSlider ? "2px" : "0",
8309
+ paddingRight: showVolumeSlider ? "6px" : "0"
8310
+ },
8311
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
8312
+ style: {
8313
+ position: "relative",
8314
+ width: "".concat(56 * responsiveScale, "px"),
8315
+ height: "3px",
8316
+ cursor: "pointer",
8317
+ borderRadius: "1.5px"
8318
+ },
8319
+ onMouseDown: function onMouseDown(e) {
8320
+ e.preventDefault();
8321
+ var el = e.currentTarget;
8322
+ var move = function move(ev) {
8323
+ var r2 = el.getBoundingClientRect();
8324
+ handleVolumeChange(Math.max(0, Math.min(1, (ev.clientX - r2.left) / r2.width)));
8325
+ };
8326
+ var up = function up1() {
8327
+ document.removeEventListener("mousemove", move);
8328
+ document.removeEventListener("mouseup", up);
8329
+ };
8330
+ document.addEventListener("mousemove", move);
8331
+ document.addEventListener("mouseup", up);
8332
+ var r = el.getBoundingClientRect();
8333
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
8334
+ },
8335
+ onClick: function onClick(e) {
8336
+ e.stopPropagation();
8337
+ var r = e.currentTarget.getBoundingClientRect();
8338
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
8339
+ },
8340
+ children: [
8341
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8233
8342
  style: {
8234
- position: "relative",
8235
- width: "8px",
8236
- height: "104px",
8237
- cursor: "pointer",
8238
- transition: "transform 0.2s ease-in-out"
8239
- },
8240
- onMouseDown: function onMouseDown(e) {
8241
- e.preventDefault();
8242
- var sliderElement = e.currentTarget;
8243
- var handleMouseMove = function handleMouseMove(moveEvent) {
8244
- if (!sliderElement) return;
8245
- var rect2 = sliderElement.getBoundingClientRect();
8246
- var y2 = moveEvent.clientY - rect2.top;
8247
- var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8248
- handleVolumeChange(percentage2);
8249
- };
8250
- var handleMouseUp = function handleMouseUp1() {
8251
- document.removeEventListener("mousemove", handleMouseMove);
8252
- document.removeEventListener("mouseup", handleMouseUp);
8253
- };
8254
- document.addEventListener("mousemove", handleMouseMove);
8255
- document.addEventListener("mouseup", handleMouseUp);
8256
- var rect = sliderElement.getBoundingClientRect();
8257
- var y = e.clientY - rect.top;
8258
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8259
- handleVolumeChange(percentage);
8260
- },
8261
- onClick: function onClick(e) {
8262
- e.stopPropagation();
8263
- var rect = e.currentTarget.getBoundingClientRect();
8264
- var y = e.clientY - rect.top;
8265
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8266
- handleVolumeChange(percentage);
8267
- },
8268
- children: [
8269
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8270
- style: {
8271
- position: "absolute",
8272
- bottom: "0",
8273
- left: "0",
8274
- width: "100%",
8275
- height: "100%",
8276
- background: "linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.5) 100%)",
8277
- borderRadius: "4px",
8278
- border: "1px solid rgba(255, 255, 255, 0.4)",
8279
- boxShadow: "inset 0 1px 3px rgba(0, 0, 0, 0.3)"
8280
- }
8281
- }),
8282
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8283
- style: {
8284
- position: "absolute",
8285
- bottom: "0",
8286
- left: "0",
8287
- width: "100%",
8288
- height: "".concat((isMuted ? 0 : volume) * 100, "%"),
8289
- background: "linear-gradient(180deg, rgba(125, 211, 252, 1) 0%, rgba(96, 165, 250, 0.98) 50%, rgba(59, 130, 246, 0.95) 100%)",
8290
- borderRadius: "4px",
8291
- transition: "height 0.15s ease-out, box-shadow 0.2s ease-in-out",
8292
- boxShadow: "0 0 12px rgba(96, 165, 250, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4)"
8293
- }
8294
- }),
8295
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8296
- style: {
8297
- position: "absolute",
8298
- bottom: "calc(".concat((isMuted ? 0 : volume) * 100, "% - 8px)"),
8299
- left: "50%",
8300
- transform: "translateX(-50%)",
8301
- width: "16px",
8302
- height: "16px",
8303
- background: "linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%)",
8304
- borderRadius: "50%",
8305
- border: "2px solid rgba(96, 165, 250, 0.9)",
8306
- 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)",
8307
- 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",
8308
- cursor: "grab"
8309
- },
8310
- onMouseEnter: function onMouseEnter(e) {
8311
- 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)";
8312
- e.currentTarget.style.cursor = "grab";
8313
- },
8314
- onMouseLeave: function onMouseLeave(e) {
8315
- 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)";
8316
- },
8317
- onMouseDown: function onMouseDown(e) {
8318
- e.currentTarget.style.cursor = "grabbing";
8319
- },
8320
- onMouseUp: function onMouseUp(e) {
8321
- e.currentTarget.style.cursor = "grab";
8322
- }
8323
- })
8324
- ]
8343
+ position: "absolute",
8344
+ inset: 0,
8345
+ background: "rgba(255, 255, 255, 0.2)",
8346
+ borderRadius: "1.5px"
8347
+ }
8348
+ }),
8349
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8350
+ style: {
8351
+ position: "absolute",
8352
+ top: 0,
8353
+ left: 0,
8354
+ bottom: 0,
8355
+ width: "".concat((isMuted ? 0 : volume) * 100, "%"),
8356
+ background: "#fff",
8357
+ borderRadius: "1.5px",
8358
+ transition: "width 0.1s ease-out"
8359
+ }
8360
+ }),
8361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8362
+ style: {
8363
+ position: "absolute",
8364
+ top: "50%",
8365
+ left: "".concat((isMuted ? 0 : volume) * 100, "%"),
8366
+ transform: "translate(-50%, -50%)",
8367
+ width: "12px",
8368
+ height: "12px",
8369
+ background: "#fff",
8370
+ borderRadius: "50%",
8371
+ boxShadow: "0 0 3px rgba(0, 0, 0, 0.3)",
8372
+ transition: "left 0.1s ease-out"
8373
+ }
8325
8374
  })
8326
- })
8327
- ]
8375
+ ]
8376
+ })
8328
8377
  })
8329
8378
  ]
8330
8379
  }),
8331
8380
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
8381
+ className: "sc-ctrl-btn",
8332
8382
  onClick: function onClick() {
8333
8383
  if (onFullscreenToggle) {
8334
8384
  onFullscreenToggle();
8335
- } else if (playerRef.current) {
8336
- playerRef.current.toggleFullscreen().catch(function(err) {
8337
- console.error("Fullscreen error:", err);
8338
- });
8385
+ } else if (wrapperRef.current) {
8386
+ if (!document.fullscreenElement) {
8387
+ wrapperRef.current.requestFullscreen().catch(function() {});
8388
+ } else {
8389
+ document.exitFullscreen().catch(function() {});
8390
+ }
8339
8391
  }
8340
- },
8341
- onMouseEnter: function onMouseEnter(e) {
8342
- var target = e.currentTarget;
8343
- 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)";
8344
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8345
- },
8346
- onMouseLeave: function onMouseLeave(e) {
8347
- var target = e.currentTarget;
8348
- 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)";
8349
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8392
+ resetControlsTimer();
8350
8393
  },
8351
8394
  style: {
8352
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
8353
- color: "#ffffff",
8354
- border: "none",
8355
- borderRadius: "".concat(18 * responsiveScale, "px"),
8356
8395
  padding: "".concat(8 * responsiveScale, "px"),
8357
- cursor: "pointer",
8358
- display: "flex",
8359
- alignItems: "center",
8360
- justifyContent: "center",
8361
- backdropFilter: "blur(20px)",
8362
- 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)",
8363
- transition: "all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
8364
- minWidth: "".concat(46 * responsiveScale, "px"),
8365
- minHeight: "".concat(46 * responsiveScale, "px")
8396
+ borderRadius: "50%",
8397
+ minWidth: "".concat(36 * responsiveScale, "px"),
8398
+ minHeight: "".concat(36 * responsiveScale, "px"),
8399
+ background: "rgba(0, 0, 0, 0.6)"
8366
8400
  },
8367
8401
  title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
8368
8402
  children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaCompress, {
8369
- size: Math.max(14, 16 * responsiveScale),
8370
- style: {
8371
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8372
- color: "#ffffff"
8373
- }
8403
+ size: Math.max(14, 18 * responsiveScale)
8374
8404
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaExpand, {
8375
- size: Math.max(14, 16 * responsiveScale),
8376
- style: {
8377
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8378
- color: "#ffffff"
8379
- }
8405
+ size: Math.max(14, 18 * responsiveScale)
8380
8406
  })
8381
8407
  })
8382
8408
  ]
@@ -9674,6 +9700,9 @@ var StormcloudPlayer_default = StormcloudPlayer;
9674
9700
  parseQuery: parseQuery,
9675
9701
  players: players,
9676
9702
  randomString: randomString,
9703
+ sendAdDetectTracking: sendAdDetectTracking,
9704
+ sendAdImpressionTracking: sendAdImpressionTracking,
9705
+ sendAdLoadedTracking: sendAdLoadedTracking,
9677
9706
  sendHeartbeat: sendHeartbeat,
9678
9707
  sendInitialTracking: sendInitialTracking,
9679
9708
  supportsFeature: supportsFeature,