stormcloud-video-player 0.3.54 → 0.3.56

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.js CHANGED
@@ -367,7 +367,7 @@ function _ts_values(o) {
367
367
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
368
368
  }
369
369
  // src/ui/StormcloudVideoPlayer.tsx
370
- import React, { useEffect, useRef, useMemo } from "react";
370
+ import React, { useEffect, useRef, useMemo, useCallback } from "react";
371
371
  // src/player/StormcloudVideoPlayer.ts
372
372
  import Hls2 from "hls.js";
373
373
  // src/utils/browserCompat.ts
@@ -2660,9 +2660,6 @@ function sendInitialTracking(licenseKey) {
2660
2660
  headers = {
2661
2661
  "Content-Type": "application/json"
2662
2662
  };
2663
- if (licenseKey) {
2664
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2665
- }
2666
2663
  return [
2667
2664
  4,
2668
2665
  fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track", {
@@ -2768,6 +2765,234 @@ function sendHeartbeat(licenseKey) {
2768
2765
  });
2769
2766
  })();
2770
2767
  }
2768
+ var TRACK_API_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2769
+ function mapToAdTrackingSource(source, adPlayerType) {
2770
+ if (source === "prebid" || source === "ima" || source === "hls") {
2771
+ return source;
2772
+ }
2773
+ if (source === "preload" || source === "ssp") {
2774
+ return source === "ssp" ? "prebid" : "ima";
2775
+ }
2776
+ return adPlayerType === "hls" ? "hls" : "ima";
2777
+ }
2778
+ function postAdTracking(licenseKey, body) {
2779
+ return _async_to_generator(function() {
2780
+ var headers, response;
2781
+ return _ts_generator(this, function(_state) {
2782
+ switch(_state.label){
2783
+ case 0:
2784
+ headers = {
2785
+ "Content-Type": "application/json"
2786
+ };
2787
+ if (licenseKey) {
2788
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2789
+ }
2790
+ return [
2791
+ 4,
2792
+ fetch(TRACK_API_URL, {
2793
+ method: "POST",
2794
+ headers: headers,
2795
+ body: JSON.stringify(body)
2796
+ })
2797
+ ];
2798
+ case 1:
2799
+ response = _state.sent();
2800
+ if (!response.ok) {
2801
+ throw new Error("HTTP error! status: ".concat(response.status));
2802
+ }
2803
+ return [
2804
+ 4,
2805
+ response.json()
2806
+ ];
2807
+ case 2:
2808
+ _state.sent();
2809
+ return [
2810
+ 2
2811
+ ];
2812
+ }
2813
+ });
2814
+ })();
2815
+ }
2816
+ function sendAdDetectTracking(licenseKey, payload) {
2817
+ return _async_to_generator(function() {
2818
+ var _payload_source, _payload_timestamp, clientInfo, browserId, adDetectInfo, body, error;
2819
+ return _ts_generator(this, function(_state) {
2820
+ switch(_state.label){
2821
+ case 0:
2822
+ _state.trys.push([
2823
+ 0,
2824
+ 3,
2825
+ ,
2826
+ 4
2827
+ ]);
2828
+ clientInfo = getClientInfo();
2829
+ return [
2830
+ 4,
2831
+ getBrowserID(clientInfo)
2832
+ ];
2833
+ case 1:
2834
+ browserId = _state.sent();
2835
+ adDetectInfo = _object_spread({
2836
+ source: (_payload_source = payload.source) !== null && _payload_source !== void 0 ? _payload_source : "scte35",
2837
+ timestamp: (_payload_timestamp = payload.timestamp) !== null && _payload_timestamp !== void 0 ? _payload_timestamp : /* @__PURE__ */ new Date().toISOString()
2838
+ }, payload.durationSeconds != null && {
2839
+ durationSeconds: payload.durationSeconds
2840
+ }, payload.ptsSeconds != null && {
2841
+ ptsSeconds: payload.ptsSeconds
2842
+ }, payload.detectedAtFragmentSn != null && {
2843
+ detectedAtFragmentSn: payload.detectedAtFragmentSn
2844
+ });
2845
+ body = _object_spread_props(_object_spread({
2846
+ browserId: browserId
2847
+ }, clientInfo, licenseKey && {
2848
+ licenseKey: licenseKey
2849
+ }), {
2850
+ adDetectInfo: adDetectInfo
2851
+ });
2852
+ return [
2853
+ 4,
2854
+ postAdTracking(licenseKey, body)
2855
+ ];
2856
+ case 2:
2857
+ _state.sent();
2858
+ return [
2859
+ 3,
2860
+ 4
2861
+ ];
2862
+ case 3:
2863
+ error = _state.sent();
2864
+ console.error("[StormcloudVideoPlayer] Error sending ad-detect tracking:", error);
2865
+ return [
2866
+ 3,
2867
+ 4
2868
+ ];
2869
+ case 4:
2870
+ return [
2871
+ 2
2872
+ ];
2873
+ }
2874
+ });
2875
+ })();
2876
+ }
2877
+ function sendAdLoadedTracking(licenseKey, payload, adPlayerType) {
2878
+ return _async_to_generator(function() {
2879
+ var clientInfo, browserId, source, adLoadedInfo, body, error;
2880
+ return _ts_generator(this, function(_state) {
2881
+ switch(_state.label){
2882
+ case 0:
2883
+ _state.trys.push([
2884
+ 0,
2885
+ 3,
2886
+ ,
2887
+ 4
2888
+ ]);
2889
+ clientInfo = getClientInfo();
2890
+ return [
2891
+ 4,
2892
+ getBrowserID(clientInfo)
2893
+ ];
2894
+ case 1:
2895
+ browserId = _state.sent();
2896
+ source = mapToAdTrackingSource(payload.source, adPlayerType);
2897
+ adLoadedInfo = _object_spread({
2898
+ source: source,
2899
+ timestamp: /* @__PURE__ */ new Date().toISOString()
2900
+ }, payload.vastUrl != null && {
2901
+ vastUrl: payload.vastUrl
2902
+ }, payload.durationSeconds != null && {
2903
+ durationSeconds: payload.durationSeconds
2904
+ });
2905
+ body = _object_spread_props(_object_spread({
2906
+ browserId: browserId
2907
+ }, clientInfo, licenseKey && {
2908
+ licenseKey: licenseKey
2909
+ }), {
2910
+ adLoadedInfo: adLoadedInfo
2911
+ });
2912
+ return [
2913
+ 4,
2914
+ postAdTracking(licenseKey, body)
2915
+ ];
2916
+ case 2:
2917
+ _state.sent();
2918
+ return [
2919
+ 3,
2920
+ 4
2921
+ ];
2922
+ case 3:
2923
+ error = _state.sent();
2924
+ console.error("[StormcloudVideoPlayer] Error sending ad-loaded tracking:", error);
2925
+ return [
2926
+ 3,
2927
+ 4
2928
+ ];
2929
+ case 4:
2930
+ return [
2931
+ 2
2932
+ ];
2933
+ }
2934
+ });
2935
+ })();
2936
+ }
2937
+ function sendAdImpressionTracking(licenseKey, payload, adPlayerType) {
2938
+ return _async_to_generator(function() {
2939
+ var clientInfo, browserId, source, adImpressionInfo, body, error;
2940
+ return _ts_generator(this, function(_state) {
2941
+ switch(_state.label){
2942
+ case 0:
2943
+ _state.trys.push([
2944
+ 0,
2945
+ 3,
2946
+ ,
2947
+ 4
2948
+ ]);
2949
+ clientInfo = getClientInfo();
2950
+ return [
2951
+ 4,
2952
+ getBrowserID(clientInfo)
2953
+ ];
2954
+ case 1:
2955
+ browserId = _state.sent();
2956
+ source = mapToAdTrackingSource(payload.source, adPlayerType);
2957
+ adImpressionInfo = _object_spread({
2958
+ source: source,
2959
+ adIndex: payload.adIndex,
2960
+ timestamp: /* @__PURE__ */ new Date().toISOString()
2961
+ }, payload.durationSeconds != null && {
2962
+ durationSeconds: payload.durationSeconds
2963
+ });
2964
+ body = _object_spread_props(_object_spread({
2965
+ browserId: browserId
2966
+ }, clientInfo, licenseKey && {
2967
+ licenseKey: licenseKey
2968
+ }), {
2969
+ adImpressionInfo: adImpressionInfo
2970
+ });
2971
+ return [
2972
+ 4,
2973
+ postAdTracking(licenseKey, body)
2974
+ ];
2975
+ case 2:
2976
+ _state.sent();
2977
+ return [
2978
+ 3,
2979
+ 4
2980
+ ];
2981
+ case 3:
2982
+ error = _state.sent();
2983
+ console.error("[StormcloudVideoPlayer] Error sending ad-impression tracking:", error);
2984
+ return [
2985
+ 3,
2986
+ 4
2987
+ ];
2988
+ case 4:
2989
+ return [
2990
+ 2
2991
+ ];
2992
+ }
2993
+ });
2994
+ })();
2995
+ }
2771
2996
  // src/utils/polyfills.ts
2772
2997
  function polyfillURLSearchParams() {
2773
2998
  if (typeof URLSearchParams !== "undefined") {
@@ -3030,6 +3255,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3030
3255
  this.inAdBreak = false;
3031
3256
  this.ptsDriftEmaMs = 0;
3032
3257
  this.adPodQueue = [];
3258
+ this.vmapBreaks = [];
3259
+ this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
3033
3260
  this.lastHeartbeatTime = 0;
3034
3261
  this.currentAdIndex = 0;
3035
3262
  this.totalAdsInBreak = 0;
@@ -3071,6 +3298,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3071
3298
  this.maxPreloadPoolSize = 2;
3072
3299
  this.preloadPoolActive = false;
3073
3300
  this.preloadPoolLoopRunning = false;
3301
+ this.adDetectSentForCurrentBreak = false;
3074
3302
  this.continuousFetchLoopRunning = false;
3075
3303
  initializePolyfills();
3076
3304
  var browserOverrides = getBrowserConfigOverrides();
@@ -3540,6 +3768,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3540
3768
  value: function attachImaEventListeners() {
3541
3769
  var _this = this;
3542
3770
  this.ima.on("all_ads_completed", function() {
3771
+ sendAdImpressionTracking(_this.config.licenseKey, {
3772
+ adIndex: _this.currentAdIndex
3773
+ }, _this.config.adPlayerType).catch(function() {});
3543
3774
  var remaining = _this.getRemainingAdMs();
3544
3775
  _this.consecutiveFailures = 0;
3545
3776
  if (_this.config.debugAdTiming) {
@@ -3602,6 +3833,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3602
3833
  }
3603
3834
  });
3604
3835
  this.ima.on("content_resume", function() {
3836
+ sendAdImpressionTracking(_this.config.licenseKey, {
3837
+ adIndex: _this.currentAdIndex
3838
+ }, _this.config.adPlayerType).catch(function() {});
3605
3839
  if (!_this.video.muted) {
3606
3840
  _this.video.muted = true;
3607
3841
  _this.video.volume = 0;
@@ -3985,6 +4219,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3985
4219
  }
3986
4220
  return;
3987
4221
  }
4222
+ if (!this.adDetectSentForCurrentBreak) {
4223
+ this.adDetectSentForCurrentBreak = true;
4224
+ var detectPayload = {};
4225
+ if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4226
+ if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4227
+ sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4228
+ }
3988
4229
  var hasPrefetchedAds = this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0;
3989
4230
  this.inAdBreak = true;
3990
4231
  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;
@@ -4344,6 +4585,18 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4344
4585
  return _ts_generator(this, function(_state) {
4345
4586
  switch(_state.label){
4346
4587
  case 0:
4588
+ if (!this.config.vmapUrl) return [
4589
+ 3,
4590
+ 2
4591
+ ];
4592
+ return [
4593
+ 4,
4594
+ this.fetchAndParseVmap(this.config.vmapUrl)
4595
+ ];
4596
+ case 1:
4597
+ _state.sent();
4598
+ _state.label = 2;
4599
+ case 2:
4347
4600
  vastMode = this.config.vastMode || "default";
4348
4601
  if (this.config.debugAdTiming) {
4349
4602
  console.log("[StormcloudVideoPlayer] VAST mode:", vastMode);
@@ -4389,7 +4642,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4389
4642
  headers: headers
4390
4643
  })
4391
4644
  ];
4392
- case 1:
4645
+ case 3:
4393
4646
  response = _state.sent();
4394
4647
  if (!response.ok) {
4395
4648
  if (this.config.debugAdTiming) {
@@ -4403,7 +4656,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4403
4656
  4,
4404
4657
  response.json()
4405
4658
  ];
4406
- case 2:
4659
+ case 4:
4407
4660
  data = _state.sent();
4408
4661
  imaPayload = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : (_data_response_ima = _data_response.ima) === null || _data_response_ima === void 0 ? void 0 : (_data_response_ima_publisherdeskima = _data_response_ima["publisherdesk.ima"]) === null || _data_response_ima_publisherdeskima === void 0 ? void 0 : _data_response_ima_publisherdeskima.payload;
4409
4662
  if (imaPayload) {
@@ -4432,35 +4685,200 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4432
4685
  }
4433
4686
  },
4434
4687
  {
4435
- key: "getCurrentAdIndex",
4436
- value: function getCurrentAdIndex() {
4437
- return this.currentAdIndex;
4688
+ key: "fetchAndParseVmap",
4689
+ value: function fetchAndParseVmap(vmapUrl) {
4690
+ return _async_to_generator(function() {
4691
+ var response, vmapXml, error;
4692
+ return _ts_generator(this, function(_state) {
4693
+ switch(_state.label){
4694
+ case 0:
4695
+ if (!vmapUrl.trim()) {
4696
+ return [
4697
+ 2
4698
+ ];
4699
+ }
4700
+ _state.label = 1;
4701
+ case 1:
4702
+ _state.trys.push([
4703
+ 1,
4704
+ 4,
4705
+ ,
4706
+ 5
4707
+ ]);
4708
+ return [
4709
+ 4,
4710
+ fetch(vmapUrl)
4711
+ ];
4712
+ case 2:
4713
+ response = _state.sent();
4714
+ if (!response.ok) {
4715
+ throw new Error("Failed to fetch VMAP (".concat(response.status, ")"));
4716
+ }
4717
+ return [
4718
+ 4,
4719
+ response.text()
4720
+ ];
4721
+ case 3:
4722
+ vmapXml = _state.sent();
4723
+ this.vmapBreaks = this.parseVmapToBreaks(vmapXml);
4724
+ this.consumedVmapBreakIds.clear();
4725
+ if (this.config.debugAdTiming) {
4726
+ console.log("[StormcloudVideoPlayer] Loaded ".concat(this.vmapBreaks.length, " VMAP ad break(s) from:"), vmapUrl);
4727
+ }
4728
+ return [
4729
+ 3,
4730
+ 5
4731
+ ];
4732
+ case 4:
4733
+ error = _state.sent();
4734
+ this.vmapBreaks = [];
4735
+ this.consumedVmapBreakIds.clear();
4736
+ if (this.config.debugAdTiming) {
4737
+ console.warn("[StormcloudVideoPlayer] Failed to load VMAP:", error);
4738
+ }
4739
+ return [
4740
+ 3,
4741
+ 5
4742
+ ];
4743
+ case 5:
4744
+ return [
4745
+ 2
4746
+ ];
4747
+ }
4748
+ });
4749
+ }).call(this);
4438
4750
  }
4439
4751
  },
4440
4752
  {
4441
- key: "getTotalAdsInBreak",
4442
- value: function getTotalAdsInBreak() {
4443
- return this.totalAdsInBreak;
4753
+ key: "parseVmapToBreaks",
4754
+ value: function parseVmapToBreaks(vmapXml) {
4755
+ var _this = this;
4756
+ if (typeof DOMParser === "undefined") {
4757
+ return [];
4758
+ }
4759
+ var doc = new DOMParser().parseFromString(vmapXml, "application/xml");
4760
+ if (doc.querySelector("parsererror")) {
4761
+ if (this.config.debugAdTiming) {
4762
+ console.warn("[StormcloudVideoPlayer] Invalid VMAP XML received");
4763
+ }
4764
+ return [];
4765
+ }
4766
+ var adBreakNodes = Array.from(doc.querySelectorAll("AdBreak, vmap\\:AdBreak"));
4767
+ var parsed = [];
4768
+ adBreakNodes.forEach(function(node, index) {
4769
+ var timeOffsetRaw = (node.getAttribute("timeOffset") || "").trim();
4770
+ var startTimeMs = _this.parseVmapTimeOffsetToMs(timeOffsetRaw);
4771
+ if (startTimeMs == null) {
4772
+ return;
4773
+ }
4774
+ var adTagNode = node.querySelector("AdTagURI, vmap\\:AdTagURI");
4775
+ var adTagUrl = ((adTagNode === null || adTagNode === void 0 ? void 0 : adTagNode.textContent) || "").trim();
4776
+ if (!adTagUrl) {
4777
+ return;
4778
+ }
4779
+ var breakId = node.getAttribute("breakId") || "vmap-break-".concat(index, "-").concat(timeOffsetRaw || "unknown");
4780
+ parsed.push({
4781
+ id: breakId,
4782
+ startTimeMs: startTimeMs,
4783
+ vastTagUrl: adTagUrl
4784
+ });
4785
+ });
4786
+ parsed.sort(function(a, b) {
4787
+ var aStart = a.startTimeMs < 0 ? Number.MAX_SAFE_INTEGER : a.startTimeMs;
4788
+ var bStart = b.startTimeMs < 0 ? Number.MAX_SAFE_INTEGER : b.startTimeMs;
4789
+ return aStart - bStart;
4790
+ });
4791
+ return parsed;
4444
4792
  }
4445
4793
  },
4446
4794
  {
4447
- key: "generateVastUrlsWithCorrelators",
4448
- value: function generateVastUrlsWithCorrelators(baseUrl, count) {
4449
- var urls = [];
4450
- var baseTimestamp = Date.now();
4451
- for(var i = 0; i < count; i++){
4452
- var timestamp = baseTimestamp + i;
4453
- var random = Math.floor(Math.random() * 1e12);
4454
- var uniqueCorrelator = "".concat(timestamp, "_").concat(random, "_").concat(i);
4455
- var urlWithCorrelator = void 0;
4456
- var correlatorRegex = /([?&])correlator=([^&]*)/;
4457
- if (correlatorRegex.test(baseUrl)) {
4458
- urlWithCorrelator = baseUrl.replace(correlatorRegex, "$1correlator=".concat(uniqueCorrelator));
4459
- } else if (baseUrl.includes("?")) {
4460
- urlWithCorrelator = "".concat(baseUrl, "&correlator=").concat(uniqueCorrelator);
4461
- } else {
4462
- urlWithCorrelator = "".concat(baseUrl, "?correlator=").concat(uniqueCorrelator);
4463
- }
4795
+ key: "parseVmapTimeOffsetToMs",
4796
+ value: function parseVmapTimeOffsetToMs(timeOffset) {
4797
+ if (!timeOffset) {
4798
+ return void 0;
4799
+ }
4800
+ var normalized = timeOffset.trim().toLowerCase();
4801
+ if (normalized === "start") {
4802
+ return 0;
4803
+ }
4804
+ if (normalized === "end") {
4805
+ return -1;
4806
+ }
4807
+ var hms = timeOffset.match(/^(\d{1,2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/);
4808
+ if (hms) {
4809
+ var _hms = _sliced_to_array(hms, 5), hh = _hms[1], mm = _hms[2], ss = _hms[3], tmp = _hms[4], ms = tmp === void 0 ? "0" : tmp;
4810
+ var hours = Number(hh);
4811
+ var minutes = Number(mm);
4812
+ var seconds = Number(ss);
4813
+ var millis = Number(ms.padEnd(3, "0").slice(0, 3));
4814
+ return (hours * 3600 + minutes * 60 + seconds) * 1e3 + millis;
4815
+ }
4816
+ var percent = timeOffset.match(/^(\d+(?:\.\d+)?)%$/);
4817
+ if (percent) {
4818
+ var ratio = Number(percent[1]) / 100;
4819
+ var durationSec = this.video.duration;
4820
+ if (Number.isFinite(durationSec) && durationSec > 0) {
4821
+ return Math.floor(durationSec * 1e3 * ratio);
4822
+ }
4823
+ return void 0;
4824
+ }
4825
+ return void 0;
4826
+ }
4827
+ },
4828
+ {
4829
+ key: "getAdBreakKey",
4830
+ value: function getAdBreakKey(adBreak) {
4831
+ if (adBreak.id) {
4832
+ return adBreak.id;
4833
+ }
4834
+ return "".concat(adBreak.startTimeMs, "-").concat(adBreak.vastTagUrl || "");
4835
+ }
4836
+ },
4837
+ {
4838
+ key: "resolveBreakStartMs",
4839
+ value: function resolveBreakStartMs(adBreak) {
4840
+ if (adBreak.startTimeMs >= 0) {
4841
+ return adBreak.startTimeMs;
4842
+ }
4843
+ if (adBreak.startTimeMs === -1) {
4844
+ var durationSec = this.video.duration;
4845
+ if (Number.isFinite(durationSec) && durationSec > 0) {
4846
+ return Math.floor(durationSec * 1e3);
4847
+ }
4848
+ }
4849
+ return void 0;
4850
+ }
4851
+ },
4852
+ {
4853
+ key: "getCurrentAdIndex",
4854
+ value: function getCurrentAdIndex() {
4855
+ return this.currentAdIndex;
4856
+ }
4857
+ },
4858
+ {
4859
+ key: "getTotalAdsInBreak",
4860
+ value: function getTotalAdsInBreak() {
4861
+ return this.totalAdsInBreak;
4862
+ }
4863
+ },
4864
+ {
4865
+ key: "generateVastUrlsWithCorrelators",
4866
+ value: function generateVastUrlsWithCorrelators(baseUrl, count) {
4867
+ var urls = [];
4868
+ var baseTimestamp = Date.now();
4869
+ for(var i = 0; i < count; i++){
4870
+ var timestamp = baseTimestamp + i;
4871
+ var random = Math.floor(Math.random() * 1e12);
4872
+ var uniqueCorrelator = "".concat(timestamp, "_").concat(random, "_").concat(i);
4873
+ var urlWithCorrelator = void 0;
4874
+ var correlatorRegex = /([?&])correlator=([^&]*)/;
4875
+ if (correlatorRegex.test(baseUrl)) {
4876
+ urlWithCorrelator = baseUrl.replace(correlatorRegex, "$1correlator=".concat(uniqueCorrelator));
4877
+ } else if (baseUrl.includes("?")) {
4878
+ urlWithCorrelator = "".concat(baseUrl, "&correlator=").concat(uniqueCorrelator);
4879
+ } else {
4880
+ urlWithCorrelator = "".concat(baseUrl, "?correlator=").concat(uniqueCorrelator);
4881
+ }
4464
4882
  urls.push(urlWithCorrelator);
4465
4883
  }
4466
4884
  return urls;
@@ -4521,10 +4939,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4521
4939
  var scheduled = this.findCurrentOrNextBreak(this.video.currentTime * 1e3);
4522
4940
  var tags = this.selectVastTagsForBreak(scheduled);
4523
4941
  var baseVastUrl;
4524
- if (this.apiVastTagUrl) {
4525
- baseVastUrl = this.apiVastTagUrl;
4526
- } else if (tags && tags.length > 0 && tags[0]) {
4942
+ if (tags && tags.length > 0 && tags[0]) {
4527
4943
  baseVastUrl = tags[0];
4944
+ } else if (this.apiVastTagUrl) {
4945
+ baseVastUrl = this.apiVastTagUrl;
4528
4946
  } else {
4529
4947
  if (this.config.debugAdTiming) {
4530
4948
  console.warn("[StormcloudVideoPlayer] No VAST URL available for prefetch");
@@ -4542,6 +4960,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4542
4960
  isFetching: false,
4543
4961
  fetchStartTime: Date.now()
4544
4962
  });
4963
+ this.adDetectSentForCurrentBreak = true;
4964
+ var detectPayload = {};
4965
+ if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4966
+ if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4967
+ if (fragmentSn !== void 0) detectPayload.detectedAtFragmentSn = fragmentSn;
4968
+ sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4545
4969
  if (this.config.debugAdTiming) {
4546
4970
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
4547
4971
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
@@ -4968,11 +5392,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4968
5392
  switch(_state.label){
4969
5393
  case 0:
4970
5394
  scheduled = this.findCurrentOrNextBreak(this.video.currentTime * 1e3);
5395
+ if (scheduled) {
5396
+ this.consumedVmapBreakIds.add(this.getAdBreakKey(scheduled));
5397
+ }
4971
5398
  tags = this.selectVastTagsForBreak(scheduled);
4972
- if (this.apiVastTagUrl) {
4973
- baseVastUrl = this.apiVastTagUrl;
4974
- } else if (tags && tags.length > 0 && tags[0]) {
5399
+ if (tags && tags.length > 0 && tags[0]) {
4975
5400
  baseVastUrl = tags[0];
5401
+ } else if (this.apiVastTagUrl) {
5402
+ baseVastUrl = this.apiVastTagUrl;
4976
5403
  } else {
4977
5404
  this.clearPendingAdBreak();
4978
5405
  return [
@@ -5017,6 +5444,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5017
5444
  firstAdUrl = preloaded.vastUrl;
5018
5445
  preloadedController = preloaded.imaController;
5019
5446
  usePreloadedAd = true;
5447
+ sendAdLoadedTracking(this.config.licenseKey, {
5448
+ source: "preload",
5449
+ vastUrl: firstAdUrl
5450
+ }, this.config.adPlayerType).catch(function() {});
5020
5451
  if (this.config.debugAdTiming) {
5021
5452
  console.log("[CONTINUOUS-FETCH] \uD83D\uDE80 Using preloaded ad from pool (preloaded in advance, ready immediately!)");
5022
5453
  console.log("[CONTINUOUS-FETCH] Pool still has ".concat(this.preloadPool.length, " preloaded ads ready"));
@@ -5106,6 +5537,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5106
5537
  ];
5107
5538
  case 5:
5108
5539
  _state.sent();
5540
+ sendAdLoadedTracking(this.config.licenseKey, {
5541
+ source: "ssp",
5542
+ vastUrl: firstAdUrl
5543
+ }, this.config.adPlayerType).catch(function() {});
5109
5544
  if (this.config.debugAdTiming) {
5110
5545
  console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
5111
5546
  }
@@ -5502,6 +5937,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5502
5937
  if (this.config.debugAdTiming) {
5503
5938
  console.log("[CONTINUOUS-FETCH] \uD83C\uDFAF Using preloaded ad from pool (".concat(this.preloadPool.length, " remaining in pool)"));
5504
5939
  }
5940
+ sendAdLoadedTracking(this.config.licenseKey, {
5941
+ source: "preload",
5942
+ vastUrl: preloaded.vastUrl
5943
+ }, this.config.adPlayerType).catch(function() {});
5505
5944
  _state.label = 1;
5506
5945
  case 1:
5507
5946
  _state.trys.push([
@@ -5839,15 +6278,22 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5839
6278
  {
5840
6279
  key: "findCurrentOrNextBreak",
5841
6280
  value: function findCurrentOrNextBreak(nowMs) {
5842
- var schedule = [];
6281
+ var schedule = this.vmapBreaks;
5843
6282
  var candidate;
5844
6283
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5845
6284
  try {
5846
6285
  for(var _iterator = schedule[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5847
6286
  var b = _step.value;
5848
- var _this_config_driftToleranceMs;
6287
+ var _this_config_driftToleranceMs, _this_resolveBreakStartMs;
6288
+ if (this.consumedVmapBreakIds.has(this.getAdBreakKey(b))) {
6289
+ continue;
6290
+ }
6291
+ var breakStartMs = this.resolveBreakStartMs(b);
6292
+ if (breakStartMs == null) {
6293
+ continue;
6294
+ }
5849
6295
  var tol = (_this_config_driftToleranceMs = this.config.driftToleranceMs) !== null && _this_config_driftToleranceMs !== void 0 ? _this_config_driftToleranceMs : 1e3;
5850
- if (b.startTimeMs <= nowMs + tol && (candidate == null || b.startTimeMs > (candidate.startTimeMs || 0))) {
6296
+ if (breakStartMs <= nowMs + tol && (candidate == null || breakStartMs > ((_this_resolveBreakStartMs = this.resolveBreakStartMs(candidate)) !== null && _this_resolveBreakStartMs !== void 0 ? _this_resolveBreakStartMs : 0))) {
5851
6297
  candidate = b;
5852
6298
  }
5853
6299
  }
@@ -5871,11 +6317,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5871
6317
  {
5872
6318
  key: "onTimeUpdate",
5873
6319
  value: function onTimeUpdate(currentTimeSec) {
5874
- if (this.ima.isAdPlaying()) return;
6320
+ var _this = this;
6321
+ if (this.ima.isAdPlaying() || this.inAdBreak) return;
5875
6322
  var nowMs = currentTimeSec * 1e3;
5876
6323
  var breakToPlay = this.findBreakForTime(nowMs);
5877
6324
  if (breakToPlay) {
5878
- this.handleMidAdJoin(breakToPlay, nowMs);
6325
+ void this.handleMidAdJoin(breakToPlay, nowMs).catch(function(error) {
6326
+ if (_this.config.debugAdTiming) {
6327
+ console.warn("[StormcloudVideoPlayer] Mid-roll VMAP join failed gracefully:", error);
6328
+ }
6329
+ });
5879
6330
  }
5880
6331
  }
5881
6332
  },
@@ -5883,40 +6334,76 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5883
6334
  key: "handleMidAdJoin",
5884
6335
  value: function handleMidAdJoin(adBreak, nowMs) {
5885
6336
  return _async_to_generator(function() {
5886
- var _adBreak_durationMs, durationMs, endMs, remainingMs, tags, first, rest;
6337
+ var _adBreak_durationMs, _this_config_driftToleranceMs, key, breakStartMs, durationMs, endMs, tol, inWindow, remainingMs, tags, first, rest, error;
5887
6338
  return _ts_generator(this, function(_state) {
5888
6339
  switch(_state.label){
5889
6340
  case 0:
6341
+ key = this.getAdBreakKey(adBreak);
6342
+ if (this.consumedVmapBreakIds.has(key)) {
6343
+ return [
6344
+ 2
6345
+ ];
6346
+ }
6347
+ breakStartMs = this.resolveBreakStartMs(adBreak);
6348
+ if (breakStartMs == null) {
6349
+ return [
6350
+ 2
6351
+ ];
6352
+ }
5890
6353
  durationMs = (_adBreak_durationMs = adBreak.durationMs) !== null && _adBreak_durationMs !== void 0 ? _adBreak_durationMs : 0;
5891
- endMs = adBreak.startTimeMs + durationMs;
5892
- if (!(durationMs > 0 && nowMs > adBreak.startTimeMs && nowMs < endMs)) return [
6354
+ endMs = breakStartMs + durationMs;
6355
+ tol = (_this_config_driftToleranceMs = this.config.driftToleranceMs) !== null && _this_config_driftToleranceMs !== void 0 ? _this_config_driftToleranceMs : 1e3;
6356
+ inWindow = durationMs > 0 ? nowMs > breakStartMs && nowMs < endMs : nowMs + tol >= breakStartMs;
6357
+ if (!inWindow) return [
5893
6358
  3,
5894
- 2
6359
+ 4
5895
6360
  ];
5896
- remainingMs = endMs - nowMs;
6361
+ this.consumedVmapBreakIds.add(key);
6362
+ remainingMs = durationMs > 0 ? Math.max(0, endMs - nowMs) : 0;
5897
6363
  tags = this.selectVastTagsForBreak(adBreak) || (this.apiVastTagUrl ? [
5898
6364
  this.apiVastTagUrl
5899
6365
  ] : void 0);
5900
6366
  if (!(tags && tags.length > 0)) return [
5901
6367
  3,
5902
- 2
6368
+ 4
5903
6369
  ];
5904
6370
  first = tags[0];
5905
6371
  rest = tags.slice(1);
5906
6372
  this.adPodQueue = rest;
5907
6373
  this.ima.updateOriginalMutedState(this.video.muted, this.video.volume);
6374
+ _state.label = 1;
6375
+ case 1:
6376
+ _state.trys.push([
6377
+ 1,
6378
+ 3,
6379
+ ,
6380
+ 4
6381
+ ]);
5908
6382
  return [
5909
6383
  4,
5910
6384
  this.playSingleAd(first)
5911
6385
  ];
5912
- case 1:
6386
+ case 2:
5913
6387
  _state.sent();
5914
6388
  this.inAdBreak = true;
5915
6389
  this.expectedAdBreakDurationMs = remainingMs;
5916
6390
  this.currentAdBreakStartWallClockMs = Date.now();
5917
6391
  this.scheduleAdStopCountdown(remainingMs);
5918
- _state.label = 2;
5919
- case 2:
6392
+ return [
6393
+ 3,
6394
+ 4
6395
+ ];
6396
+ case 3:
6397
+ error = _state.sent();
6398
+ this.adPodQueue = [];
6399
+ if (this.config.debugAdTiming) {
6400
+ console.warn("[StormcloudVideoPlayer] Mid-roll VMAP ad request failed:", error);
6401
+ }
6402
+ return [
6403
+ 3,
6404
+ 4
6405
+ ];
6406
+ case 4:
5920
6407
  return [
5921
6408
  2
5922
6409
  ];
@@ -6206,6 +6693,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6206
6693
  ];
6207
6694
  case 3:
6208
6695
  _state.sent();
6696
+ sendAdLoadedTracking(this.config.licenseKey, {
6697
+ source: "ssp",
6698
+ vastUrl: vastTagUrl
6699
+ }, this.config.adPlayerType).catch(function() {});
6209
6700
  this.clearAdRequestWatchdog();
6210
6701
  if (this.activeAdRequestToken !== requestToken) {
6211
6702
  return [
@@ -6420,6 +6911,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6420
6911
  }
6421
6912
  this.adRequestQueue = [];
6422
6913
  this.inAdBreak = false;
6914
+ this.adDetectSentForCurrentBreak = false;
6423
6915
  this.expectedAdBreakDurationMs = void 0;
6424
6916
  this.currentAdBreakStartWallClockMs = void 0;
6425
6917
  this.clearAdStartTimer();
@@ -6617,13 +7109,22 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6617
7109
  {
6618
7110
  key: "findBreakForTime",
6619
7111
  value: function findBreakForTime(nowMs) {
6620
- var schedule = [];
7112
+ var _this_config_driftToleranceMs;
7113
+ var schedule = this.vmapBreaks;
7114
+ var tol = (_this_config_driftToleranceMs = this.config.driftToleranceMs) !== null && _this_config_driftToleranceMs !== void 0 ? _this_config_driftToleranceMs : 1e3;
6621
7115
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
6622
7116
  try {
6623
7117
  for(var _iterator = schedule[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
6624
7118
  var b = _step.value;
6625
- var end = (b.startTimeMs || 0) + (b.durationMs || 0);
6626
- if (nowMs >= (b.startTimeMs || 0) && (b.durationMs ? nowMs < end : true)) {
7119
+ if (this.consumedVmapBreakIds.has(this.getAdBreakKey(b))) {
7120
+ continue;
7121
+ }
7122
+ var breakStartMs = this.resolveBreakStartMs(b);
7123
+ if (breakStartMs == null) {
7124
+ continue;
7125
+ }
7126
+ var end = breakStartMs + (b.durationMs || 0);
7127
+ if (nowMs >= breakStartMs && (b.durationMs ? nowMs < end : nowMs <= breakStartMs + tol)) {
6627
7128
  return b;
6628
7129
  }
6629
7130
  }
@@ -6855,12 +7356,14 @@ var CRITICAL_PROPS = [
6855
7356
  "src",
6856
7357
  "allowNativeHls",
6857
7358
  "licenseKey",
7359
+ "vmapUrl",
6858
7360
  "lowLatencyMode",
6859
7361
  "driftToleranceMs",
6860
7362
  "vastMode"
6861
7363
  ];
7364
+ var CONTROLS_HIDE_DELAY = 3e3;
6862
7365
  var StormcloudVideoPlayerComponent = React.memo(function(props) {
6863
- 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, [
7366
+ 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, [
6864
7367
  "src",
6865
7368
  "autoplay",
6866
7369
  "muted",
@@ -6887,12 +7390,15 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6887
7390
  "licenseKey",
6888
7391
  "vastMode",
6889
7392
  "vastTagUrl",
7393
+ "vmapUrl",
6890
7394
  "adPlayerType",
6891
7395
  "minSegmentsBeforePlay"
6892
7396
  ]);
6893
7397
  var videoRef = useRef(null);
6894
7398
  var playerRef = useRef(null);
6895
7399
  var bufferingTimeoutRef = useRef(null);
7400
+ var controlsTimerRef = useRef(null);
7401
+ var wrapperRef = useRef(null);
6896
7402
  var _React_useState = _sliced_to_array(React.useState({
6897
7403
  showAds: false,
6898
7404
  currentIndex: 0,
@@ -6912,8 +7418,9 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6912
7418
  var _React_useState12 = _sliced_to_array(React.useState(false), 2), isBuffering = _React_useState12[0], setIsBuffering = _React_useState12[1];
6913
7419
  var _React_useState13 = _sliced_to_array(React.useState(false), 2), showCenterPlay = _React_useState13[0], setShowCenterPlay = _React_useState13[1];
6914
7420
  var _React_useState14 = _sliced_to_array(React.useState(false), 2), showLicenseWarning = _React_useState14[0], setShowLicenseWarning = _React_useState14[1];
6915
- var _React_useState15 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React_useState15[0], setViewportWidth = _React_useState15[1];
6916
- var _React_useState16 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React_useState16[0], setIsPortrait = _React_useState16[1];
7421
+ var _React_useState15 = _sliced_to_array(React.useState(true), 2), controlsVisible = _React_useState15[0], setControlsVisible = _React_useState15[1];
7422
+ var _React_useState16 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React_useState16[0], setViewportWidth = _React_useState16[1];
7423
+ 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];
6917
7424
  var getResponsiveScale = function getResponsiveScale() {
6918
7425
  if (viewportWidth < 480) return 0.7;
6919
7426
  if (viewportWidth < 768) return 0.8;
@@ -6921,6 +7428,33 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6921
7428
  return 1;
6922
7429
  };
6923
7430
  var responsiveScale = getResponsiveScale();
7431
+ var resetControlsTimer = useCallback(function() {
7432
+ if (controlsTimerRef.current) {
7433
+ clearTimeout(controlsTimerRef.current);
7434
+ }
7435
+ setControlsVisible(true);
7436
+ controlsTimerRef.current = window.setTimeout(function() {
7437
+ if (!showVolumeSlider && !showSpeedMenu) {
7438
+ setControlsVisible(false);
7439
+ }
7440
+ }, CONTROLS_HIDE_DELAY);
7441
+ }, [
7442
+ showVolumeSlider,
7443
+ showSpeedMenu
7444
+ ]);
7445
+ var handleWrapperMouseMove = useCallback(function() {
7446
+ resetControlsTimer();
7447
+ }, [
7448
+ resetControlsTimer
7449
+ ]);
7450
+ var handleWrapperMouseLeave = useCallback(function() {
7451
+ if (!showVolumeSlider && !showSpeedMenu) {
7452
+ setControlsVisible(false);
7453
+ }
7454
+ }, [
7455
+ showVolumeSlider,
7456
+ showSpeedMenu
7457
+ ]);
6924
7458
  var formatTime = function formatTime(seconds) {
6925
7459
  if (!isFinite(seconds)) return "0:00:00";
6926
7460
  var hours = Math.floor(seconds / 3600);
@@ -6946,6 +7480,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6946
7480
  setShowCenterPlay(true);
6947
7481
  }
6948
7482
  }
7483
+ resetControlsTimer();
6949
7484
  };
6950
7485
  var handleCenterPlayClick = function handleCenterPlayClick() {
6951
7486
  if (videoRef.current && videoRef.current.paused) {
@@ -6971,6 +7506,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6971
7506
  videoRef.current.currentTime = newTime;
6972
7507
  }
6973
7508
  }
7509
+ resetControlsTimer();
6974
7510
  };
6975
7511
  var handleVolumeChange = function handleVolumeChange(newVolume) {
6976
7512
  if (playerRef.current && isFinite(newVolume)) {
@@ -6994,6 +7530,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
6994
7530
  src,
6995
7531
  allowNativeHls,
6996
7532
  licenseKey,
7533
+ vmapUrl,
6997
7534
  lowLatencyMode,
6998
7535
  driftToleranceMs,
6999
7536
  vastMode
@@ -7036,6 +7573,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7036
7573
  if (licenseKey !== void 0) cfg.licenseKey = licenseKey;
7037
7574
  if (vastMode !== void 0) cfg.vastMode = vastMode;
7038
7575
  if (vastTagUrl !== void 0) cfg.vastTagUrl = vastTagUrl;
7576
+ if (vmapUrl !== void 0) cfg.vmapUrl = vmapUrl;
7039
7577
  if (adPlayerType !== void 0) cfg.adPlayerType = adPlayerType;
7040
7578
  if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
7041
7579
  var player = new StormcloudVideoPlayer(cfg);
@@ -7126,7 +7664,6 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7126
7664
  useEffect(function() {
7127
7665
  if (!playerRef.current || !videoRef.current) return;
7128
7666
  var updateStates = function updateStates() {
7129
- var _videoRef_current;
7130
7667
  if (playerRef.current && videoRef.current) {
7131
7668
  setIsMuted(playerRef.current.isMuted());
7132
7669
  setIsPlaying(!videoRef.current.paused);
@@ -7139,12 +7676,11 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7139
7676
  var rateValue = videoRef.current.playbackRate;
7140
7677
  setPlaybackRate(isFinite(rateValue) && rateValue > 0 ? rateValue : 1);
7141
7678
  }
7142
- setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
7679
+ setIsFullscreen(document.fullscreenElement === wrapperRef.current);
7143
7680
  };
7144
7681
  var interval = setInterval(updateStates, 200);
7145
7682
  var handleFullscreenChange = function handleFullscreenChange() {
7146
- var _videoRef_current;
7147
- setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
7683
+ setIsFullscreen(document.fullscreenElement === wrapperRef.current);
7148
7684
  };
7149
7685
  document.addEventListener("fullscreenchange", handleFullscreenChange);
7150
7686
  return function() {
@@ -7272,13 +7808,25 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7272
7808
  }, [
7273
7809
  debugAdTiming
7274
7810
  ]);
7811
+ useEffect(function() {
7812
+ return function() {
7813
+ if (controlsTimerRef.current) {
7814
+ clearTimeout(controlsTimerRef.current);
7815
+ }
7816
+ };
7817
+ }, []);
7818
+ var progressPercent = duration > 0 ? currentTime / duration * 100 : 0;
7819
+ var VolumeIcon = isMuted || volume === 0 ? FaVolumeMute : volume < 0.5 ? FaVolumeDown : FaVolumeUp;
7275
7820
  return /* @__PURE__ */ jsxs(Fragment, {
7276
7821
  children: [
7277
7822
  /* @__PURE__ */ jsx("style", {
7278
- 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 "
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 "
7279
7824
  }),
7280
7825
  /* @__PURE__ */ jsxs("div", {
7281
- className: "stormcloud-video-wrapper ".concat(wrapperClassName || ""),
7826
+ ref: wrapperRef,
7827
+ className: "sc-wrapper ".concat(wrapperClassName || ""),
7828
+ onMouseMove: handleWrapperMouseMove,
7829
+ onMouseLeave: handleWrapperMouseLeave,
7282
7830
  style: _object_spread({
7283
7831
  display: "flex",
7284
7832
  alignItems: "center",
@@ -7293,7 +7841,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7293
7841
  maxWidth: isFullscreen ? "100vw" : "100%",
7294
7842
  maxHeight: isFullscreen ? "100vh" : "none",
7295
7843
  zIndex: isFullscreen ? 999999 : void 0,
7296
- backgroundColor: isFullscreen ? "#000" : void 0,
7844
+ backgroundColor: "#000",
7297
7845
  borderRadius: isFullscreen ? 0 : void 0,
7298
7846
  boxShadow: isFullscreen ? "none" : void 0
7299
7847
  }, wrapperStyle),
@@ -7319,16 +7867,16 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7319
7867
  children: children
7320
7868
  })),
7321
7869
  (isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ jsx(FaSpinner, {
7322
- className: "stormcloud-loading-indicator",
7323
- size: 42,
7324
- color: "white",
7870
+ className: "sc-loading-indicator",
7871
+ size: 40,
7872
+ color: "rgba(255, 255, 255, 0.85)",
7325
7873
  style: {
7326
7874
  position: "absolute",
7327
- top: "calc(50% - 21px)",
7328
- left: "calc(50% - 21px)",
7875
+ top: "calc(50% - 20px)",
7876
+ left: "calc(50% - 20px)",
7329
7877
  zIndex: 20,
7330
- animation: "spin 1s linear infinite",
7331
- filter: "drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8))"
7878
+ animation: "sc-spin 0.9s linear infinite",
7879
+ filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
7332
7880
  }
7333
7881
  }),
7334
7882
  showLicenseWarning && /* @__PURE__ */ jsxs("div", {
@@ -7338,13 +7886,13 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7338
7886
  left: "50%",
7339
7887
  transform: "translate(-50%, -50%)",
7340
7888
  zIndex: 25,
7341
- background: "linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%)",
7889
+ background: "rgba(220, 38, 38, 0.92)",
7890
+ backdropFilter: "blur(24px)",
7342
7891
  color: "white",
7343
- padding: "24px 32px",
7344
- borderRadius: "16px",
7345
- backdropFilter: "blur(20px)",
7346
- border: "2px solid rgba(255, 255, 255, 0.2)",
7347
- boxShadow: "0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.2)",
7892
+ padding: "28px 36px",
7893
+ borderRadius: "14px",
7894
+ border: "1px solid rgba(255, 255, 255, 0.15)",
7895
+ boxShadow: "0 24px 64px rgba(0, 0, 0, 0.5)",
7348
7896
  textAlign: "center",
7349
7897
  maxWidth: "400px",
7350
7898
  margin: "0 16px"
@@ -7352,20 +7900,18 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7352
7900
  children: [
7353
7901
  /* @__PURE__ */ jsx("div", {
7354
7902
  style: {
7355
- fontSize: "20px",
7356
- fontWeight: "bold",
7357
- marginBottom: "12px",
7358
- color: "#ffffff",
7359
- textShadow: "0 2px 4px rgba(0, 0, 0, 0.5)"
7903
+ fontSize: "18px",
7904
+ fontWeight: "700",
7905
+ marginBottom: "10px",
7906
+ letterSpacing: "-0.02em"
7360
7907
  },
7361
7908
  children: "License Key Required"
7362
7909
  }),
7363
7910
  /* @__PURE__ */ jsxs("div", {
7364
7911
  style: {
7365
- fontSize: "14px",
7366
- lineHeight: "1.5",
7367
- color: "rgba(255, 255, 255, 0.9)",
7368
- textShadow: "0 1px 2px rgba(0, 0, 0, 0.3)"
7912
+ fontSize: "13px",
7913
+ lineHeight: "1.6",
7914
+ color: "rgba(255, 255, 255, 0.85)"
7369
7915
  },
7370
7916
  children: [
7371
7917
  "Please provide a valid license key to use the Stormcloud Video Player.",
@@ -7384,573 +7930,419 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7384
7930
  transform: "translate(-50%, -50%)",
7385
7931
  zIndex: 15,
7386
7932
  cursor: "pointer",
7387
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)",
7933
+ background: "rgba(0, 0, 0, 0.55)",
7934
+ backdropFilter: "blur(8px)",
7388
7935
  borderRadius: "50%",
7389
- width: "100px",
7390
- height: "100px",
7936
+ width: "".concat(92 * responsiveScale, "px"),
7937
+ height: "".concat(92 * responsiveScale, "px"),
7391
7938
  display: "flex",
7392
7939
  alignItems: "center",
7393
7940
  justifyContent: "center",
7394
- backdropFilter: "blur(20px)",
7395
- border: "3px solid rgba(255, 255, 255, 0.8)",
7396
- boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
7397
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
7941
+ transition: "background 0.2s ease, transform 0.2s ease",
7942
+ animation: "sc-fade-in 0.2s ease"
7398
7943
  },
7399
7944
  onMouseEnter: function onMouseEnter(e) {
7400
- var target = e.currentTarget;
7401
- target.style.transform = "translate(-50%, -50%)";
7402
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
7403
- target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
7404
- target.style.borderColor = "rgba(255, 255, 255, 0.9)";
7945
+ e.currentTarget.style.background = "rgba(0, 0, 0, 0.72)";
7946
+ e.currentTarget.style.transform = "translate(-50%, -50%) scale(1.06)";
7405
7947
  },
7406
7948
  onMouseLeave: function onMouseLeave(e) {
7407
- var target = e.currentTarget;
7408
- target.style.transform = "translate(-50%, -50%)";
7409
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
7410
- target.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)";
7411
- target.style.borderColor = "rgba(255, 255, 255, 0.8)";
7949
+ e.currentTarget.style.background = "rgba(0, 0, 0, 0.55)";
7950
+ e.currentTarget.style.transform = "translate(-50%, -50%) scale(1)";
7412
7951
  },
7413
7952
  title: "Play",
7414
7953
  children: /* @__PURE__ */ jsx(FaPlay, {
7415
- size: 36,
7954
+ size: Math.max(24, 32 * responsiveScale),
7416
7955
  color: "white",
7417
7956
  style: {
7418
- marginLeft: "6px",
7419
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))"
7957
+ marginLeft: "4px"
7420
7958
  }
7421
7959
  })
7422
7960
  }),
7423
- shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ jsx(Fragment, {
7424
- children: /* @__PURE__ */ jsxs("div", {
7425
- style: {
7426
- position: "absolute",
7427
- bottom: 0,
7428
- left: 0,
7429
- right: 0,
7430
- background: "linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%)",
7431
- padding: "20px 16px 16px",
7432
- zIndex: 10
7433
- },
7434
- children: [
7435
- /* @__PURE__ */ jsxs("div", {
7436
- style: {
7437
- width: "100%",
7438
- height: "8px",
7439
- background: "linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%)",
7440
- borderRadius: "8px",
7441
- marginBottom: "16px",
7442
- cursor: "pointer",
7443
- position: "relative",
7444
- backdropFilter: "blur(5px)",
7445
- border: "1px solid rgba(255, 255, 255, 0.1)",
7446
- boxShadow: "inset 0 2px 4px rgba(0, 0, 0, 0.2)"
7447
- },
7448
- onClick: handleTimelineSeek,
7449
- children: [
7450
- /* @__PURE__ */ jsx("div", {
7451
- style: {
7452
- height: "100%",
7453
- 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%)",
7454
- borderRadius: "8px",
7455
- width: "".concat(duration > 0 ? currentTime / duration * 100 : 0, "%"),
7456
- transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7457
- boxShadow: "0 2px 8px rgba(139, 92, 246, 0.4)"
7458
- }
7459
- }),
7460
- /* @__PURE__ */ jsx("div", {
7461
- style: {
7462
- position: "absolute",
7463
- top: "-6px",
7464
- right: "".concat(duration > 0 ? 100 - currentTime / duration * 100 : 100, "%"),
7465
- width: "20px",
7466
- height: "20px",
7467
- background: "linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.9) 100%)",
7468
- borderRadius: "50%",
7469
- border: "3px solid rgba(139, 92, 246, 0.8)",
7470
- boxShadow: "0 4px 16px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8)",
7471
- transform: "translateX(50%)",
7472
- transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
7473
- }
7474
- })
7475
- ]
7476
- }),
7477
- /* @__PURE__ */ jsxs("div", {
7478
- style: {
7479
- display: "flex",
7480
- alignItems: "center",
7481
- justifyContent: "space-between",
7482
- color: "white",
7483
- flexWrap: viewportWidth < 768 ? "wrap" : "nowrap",
7484
- gap: "".concat(8 * responsiveScale, "px")
7485
- },
7486
- children: [
7487
- /* @__PURE__ */ jsxs("div", {
7488
- style: {
7489
- display: "flex",
7490
- alignItems: "center",
7491
- gap: "".concat(12 * responsiveScale, "px"),
7492
- flexWrap: viewportWidth < 480 ? "wrap" : "nowrap"
7493
- },
7494
- children: [
7495
- /* @__PURE__ */ jsx("button", {
7496
- onClick: handlePlayPause,
7961
+ shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ jsxs("div", {
7962
+ className: "sc-controls-bar",
7963
+ style: {
7964
+ position: "absolute",
7965
+ bottom: 0,
7966
+ left: 0,
7967
+ right: 0,
7968
+ background: "linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%)",
7969
+ padding: "".concat(20 * responsiveScale, "px ").concat(12 * responsiveScale, "px ").concat(8 * responsiveScale, "px"),
7970
+ zIndex: 10,
7971
+ opacity: controlsVisible || adStatus.showAds ? 1 : 0,
7972
+ transform: controlsVisible || adStatus.showAds ? "translateY(0)" : "translateY(6px)",
7973
+ pointerEvents: controlsVisible || adStatus.showAds ? "auto" : "none"
7974
+ },
7975
+ children: [
7976
+ /* @__PURE__ */ jsxs("div", {
7977
+ className: "sc-progress-track",
7978
+ style: {
7979
+ width: "100%",
7980
+ height: "3px",
7981
+ background: "rgba(255, 255, 255, 0.2)",
7982
+ borderRadius: "1.5px",
7983
+ marginBottom: "".concat(8 * responsiveScale, "px"),
7984
+ cursor: "pointer",
7985
+ position: "relative",
7986
+ transition: "height 0.1s ease"
7987
+ },
7988
+ onClick: handleTimelineSeek,
7989
+ onMouseEnter: function onMouseEnter(e) {
7990
+ e.currentTarget.style.height = "5px";
7991
+ },
7992
+ onMouseLeave: function onMouseLeave(e) {
7993
+ e.currentTarget.style.height = "3px";
7994
+ },
7995
+ children: [
7996
+ /* @__PURE__ */ jsx("div", {
7997
+ style: {
7998
+ position: "absolute",
7999
+ top: 0,
8000
+ left: 0,
8001
+ bottom: 0,
8002
+ background: adStatus.showAds ? "#f5c518" : "#ff0000",
8003
+ borderRadius: "1.5px",
8004
+ width: "".concat(progressPercent, "%"),
8005
+ transition: "width 0.15s linear"
8006
+ }
8007
+ }),
8008
+ /* @__PURE__ */ jsx("div", {
8009
+ className: "sc-progress-thumb",
8010
+ style: {
8011
+ position: "absolute",
8012
+ top: "50%",
8013
+ left: "".concat(progressPercent, "%"),
8014
+ transform: "translate(-50%, -50%) scale(0)",
8015
+ width: "13px",
8016
+ height: "13px",
8017
+ background: adStatus.showAds ? "#f5c518" : "#ff0000",
8018
+ borderRadius: "50%",
8019
+ boxShadow: "0 0 4px rgba(0, 0, 0, 0.3)",
8020
+ transition: "transform 0.1s ease, left 0.15s linear"
8021
+ }
8022
+ })
8023
+ ]
8024
+ }),
8025
+ /* @__PURE__ */ jsxs("div", {
8026
+ style: {
8027
+ display: "flex",
8028
+ alignItems: "center",
8029
+ justifyContent: "space-between",
8030
+ color: "white",
8031
+ gap: "".concat(8 * responsiveScale, "px")
8032
+ },
8033
+ children: [
8034
+ /* @__PURE__ */ jsxs("div", {
8035
+ style: {
8036
+ display: "flex",
8037
+ alignItems: "center",
8038
+ gap: "".concat(8 * responsiveScale, "px")
8039
+ },
8040
+ children: [
8041
+ /* @__PURE__ */ jsx("button", {
8042
+ className: "sc-ctrl-btn",
8043
+ onClick: handlePlayPause,
8044
+ style: {
8045
+ padding: "".concat(8 * responsiveScale, "px"),
8046
+ borderRadius: "50%",
8047
+ minWidth: "".concat(36 * responsiveScale, "px"),
8048
+ minHeight: "".concat(36 * responsiveScale, "px")
8049
+ },
8050
+ title: isPlaying ? "Pause" : "Play",
8051
+ children: isPlaying ? /* @__PURE__ */ jsx(FaPause, {
8052
+ size: Math.max(14, 18 * responsiveScale)
8053
+ }) : /* @__PURE__ */ jsx(FaPlay, {
8054
+ size: Math.max(14, 18 * responsiveScale),
7497
8055
  style: {
7498
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
7499
- backdropFilter: "blur(12px)",
7500
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7501
- color: "#ffffff",
7502
- cursor: "pointer",
7503
- padding: "".concat(10 * responsiveScale, "px"),
7504
- borderRadius: "".concat(16 * responsiveScale, "px"),
7505
- display: "flex",
7506
- alignItems: "center",
7507
- justifyContent: "center",
7508
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7509
- 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)",
7510
- minWidth: "".concat(48 * responsiveScale, "px"),
7511
- minHeight: "".concat(48 * responsiveScale, "px")
7512
- },
7513
- onMouseEnter: function onMouseEnter(e) {
7514
- var target = e.target;
7515
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
7516
- 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)";
7517
- },
7518
- onMouseLeave: function onMouseLeave(e) {
7519
- var target = e.target;
7520
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
7521
- 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)";
7522
- },
7523
- title: isPlaying ? "Pause" : "Play",
7524
- children: isPlaying ? /* @__PURE__ */ jsx(FaPause, {
7525
- size: Math.max(16, 20 * responsiveScale),
8056
+ marginLeft: "2px"
8057
+ }
8058
+ })
8059
+ }),
8060
+ /* @__PURE__ */ jsxs("div", {
8061
+ style: {
8062
+ display: "flex",
8063
+ alignItems: "center"
8064
+ },
8065
+ onMouseEnter: function onMouseEnter() {
8066
+ return setShowVolumeSlider(true);
8067
+ },
8068
+ onMouseLeave: function onMouseLeave() {
8069
+ return setShowVolumeSlider(false);
8070
+ },
8071
+ children: [
8072
+ /* @__PURE__ */ jsx("button", {
8073
+ className: "sc-ctrl-btn",
8074
+ onClick: function onClick() {
8075
+ if (playerRef.current) playerRef.current.toggleMute();
8076
+ onVolumeToggle === null || onVolumeToggle === void 0 ? void 0 : onVolumeToggle();
8077
+ resetControlsTimer();
8078
+ },
7526
8079
  style: {
7527
- filter: "drop-shadow(0 0 0 transparent)"
7528
- }
7529
- }) : /* @__PURE__ */ jsx(FaPlay, {
7530
- size: Math.max(16, 20 * responsiveScale),
8080
+ padding: "".concat(8 * responsiveScale, "px"),
8081
+ borderRadius: "50%",
8082
+ minWidth: "".concat(36 * responsiveScale, "px"),
8083
+ minHeight: "".concat(36 * responsiveScale, "px")
8084
+ },
8085
+ title: isMuted ? "Unmute" : "Mute",
8086
+ children: /* @__PURE__ */ jsx(VolumeIcon, {
8087
+ size: Math.max(14, 18 * responsiveScale)
8088
+ })
8089
+ }),
8090
+ /* @__PURE__ */ jsx("div", {
7531
8091
  style: {
7532
- filter: "drop-shadow(0 0 0 transparent)"
7533
- }
7534
- })
7535
- }),
7536
- /* @__PURE__ */ jsxs("div", {
7537
- style: {
7538
- position: "relative",
7539
- display: "flex",
7540
- alignItems: "center",
7541
- padding: "8px",
7542
- margin: "-8px"
7543
- },
7544
- onMouseEnter: function onMouseEnter() {
7545
- return setShowVolumeSlider(true);
7546
- },
7547
- onMouseLeave: function onMouseLeave() {
7548
- return setShowVolumeSlider(false);
7549
- },
7550
- children: [
7551
- /* @__PURE__ */ jsx("button", {
7552
- onClick: function onClick() {
7553
- if (playerRef.current) {
7554
- playerRef.current.toggleMute();
7555
- }
7556
- if (onVolumeToggle) {
7557
- onVolumeToggle();
7558
- }
7559
- },
8092
+ width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8093
+ overflow: "hidden",
8094
+ transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8095
+ display: "flex",
8096
+ alignItems: "center",
8097
+ paddingLeft: showVolumeSlider ? "2px" : "0",
8098
+ paddingRight: showVolumeSlider ? "4px" : "0"
8099
+ },
8100
+ children: /* @__PURE__ */ jsxs("div", {
7560
8101
  style: {
7561
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
7562
- backdropFilter: "blur(10px)",
7563
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7564
- color: "#ffffff",
8102
+ position: "relative",
8103
+ width: "".concat(56 * responsiveScale, "px"),
8104
+ height: "3px",
7565
8105
  cursor: "pointer",
7566
- padding: "".concat(8 * responsiveScale, "px"),
7567
- borderRadius: "".concat(16 * responsiveScale, "px"),
7568
- display: "flex",
7569
- alignItems: "center",
7570
- justifyContent: "center",
7571
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7572
- 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)",
7573
- minWidth: "".concat(44 * responsiveScale, "px"),
7574
- minHeight: "".concat(44 * responsiveScale, "px")
8106
+ borderRadius: "1.5px"
7575
8107
  },
7576
- onMouseEnter: function onMouseEnter(e) {
7577
- var target = e.target;
7578
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
7579
- 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)";
8108
+ onMouseDown: function onMouseDown(e) {
8109
+ e.preventDefault();
8110
+ var el = e.currentTarget;
8111
+ var move = function move(ev) {
8112
+ var r2 = el.getBoundingClientRect();
8113
+ handleVolumeChange(Math.max(0, Math.min(1, (ev.clientX - r2.left) / r2.width)));
8114
+ };
8115
+ var up = function up1() {
8116
+ document.removeEventListener("mousemove", move);
8117
+ document.removeEventListener("mouseup", up);
8118
+ };
8119
+ document.addEventListener("mousemove", move);
8120
+ document.addEventListener("mouseup", up);
8121
+ var r = el.getBoundingClientRect();
8122
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
7580
8123
  },
7581
- onMouseLeave: function onMouseLeave(e) {
7582
- var target = e.target;
7583
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
7584
- 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)";
8124
+ onClick: function onClick(e) {
8125
+ e.stopPropagation();
8126
+ var r = e.currentTarget.getBoundingClientRect();
8127
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
7585
8128
  },
7586
- title: isMuted ? "Unmute" : "Mute",
7587
- children: isMuted || volume === 0 ? /* @__PURE__ */ jsx(FaVolumeMute, {
7588
- size: Math.max(14, 16 * responsiveScale),
7589
- style: {
7590
- filter: "drop-shadow(0 0 0 transparent)"
7591
- }
7592
- }) : volume < 0.5 ? /* @__PURE__ */ jsx(FaVolumeDown, {
7593
- size: Math.max(14, 16 * responsiveScale),
7594
- style: {
7595
- filter: "drop-shadow(0 0 0 transparent)"
7596
- }
7597
- }) : /* @__PURE__ */ jsx(FaVolumeUp, {
7598
- size: Math.max(14, 16 * responsiveScale),
7599
- style: {
7600
- filter: "drop-shadow(0 0 0 transparent)"
7601
- }
7602
- })
7603
- }),
7604
- showVolumeSlider && /* @__PURE__ */ jsxs(Fragment, {
7605
8129
  children: [
7606
8130
  /* @__PURE__ */ jsx("div", {
7607
8131
  style: {
7608
8132
  position: "absolute",
7609
- bottom: "100%",
7610
- left: "50%",
7611
- transform: "translateX(-50%)",
7612
- width: "60px",
7613
- height: "20px",
7614
- marginBottom: "-16px",
7615
- zIndex: 9
7616
- },
7617
- onMouseEnter: function onMouseEnter() {
7618
- return setShowVolumeSlider(true);
7619
- },
7620
- onMouseLeave: function onMouseLeave() {
7621
- return setShowVolumeSlider(false);
8133
+ inset: 0,
8134
+ background: "rgba(255, 255, 255, 0.2)",
8135
+ borderRadius: "1.5px"
7622
8136
  }
7623
8137
  }),
7624
8138
  /* @__PURE__ */ jsx("div", {
7625
8139
  style: {
7626
8140
  position: "absolute",
7627
- bottom: "100%",
7628
- left: "50%",
7629
- transform: "translateX(-50%)",
7630
- marginBottom: "4px",
7631
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.88) 0%, rgba(20, 20, 20, 0.92) 100%)",
7632
- backdropFilter: "blur(15px)",
7633
- padding: "10px 14px",
7634
- borderRadius: "14px",
7635
- border: "1px solid rgba(255, 255, 255, 0.15)",
7636
- display: "flex",
7637
- flexDirection: "column",
7638
- alignItems: "center",
7639
- justifyContent: "center",
7640
- height: "128px",
7641
- 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)",
7642
- zIndex: 10,
7643
- transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
7644
- },
7645
- onMouseEnter: function onMouseEnter(e) {
7646
- setShowVolumeSlider(true);
7647
- 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)";
7648
- e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
7649
- },
7650
- onMouseLeave: function onMouseLeave(e) {
7651
- setShowVolumeSlider(false);
7652
- 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)";
7653
- e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
7654
- },
7655
- children: /* @__PURE__ */ jsxs("div", {
7656
- style: {
7657
- position: "relative",
7658
- width: "8px",
7659
- height: "104px",
7660
- cursor: "pointer",
7661
- transition: "transform 0.2s ease-in-out"
7662
- },
7663
- onMouseEnter: function onMouseEnter(e) {},
7664
- onMouseLeave: function onMouseLeave(e) {},
7665
- onMouseDown: function onMouseDown(e) {
7666
- e.preventDefault();
7667
- var sliderElement = e.currentTarget;
7668
- var handleMouseMove = function handleMouseMove(moveEvent) {
7669
- if (!sliderElement) return;
7670
- var rect2 = sliderElement.getBoundingClientRect();
7671
- var y2 = moveEvent.clientY - rect2.top;
7672
- var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
7673
- handleVolumeChange(percentage2);
7674
- };
7675
- var handleMouseUp = function handleMouseUp1() {
7676
- document.removeEventListener("mousemove", handleMouseMove);
7677
- document.removeEventListener("mouseup", handleMouseUp);
7678
- };
7679
- document.addEventListener("mousemove", handleMouseMove);
7680
- document.addEventListener("mouseup", handleMouseUp);
7681
- var rect = sliderElement.getBoundingClientRect();
7682
- var y = e.clientY - rect.top;
7683
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
7684
- handleVolumeChange(percentage);
7685
- },
7686
- onClick: function onClick(e) {
7687
- e.stopPropagation();
7688
- var rect = e.currentTarget.getBoundingClientRect();
7689
- var y = e.clientY - rect.top;
7690
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
7691
- handleVolumeChange(percentage);
7692
- },
7693
- children: [
7694
- /* @__PURE__ */ jsx("div", {
7695
- style: {
7696
- position: "absolute",
7697
- bottom: "0",
7698
- left: "0",
7699
- width: "100%",
7700
- height: "100%",
7701
- background: "linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%)",
7702
- borderRadius: "4px",
7703
- boxShadow: "inset 0 1px 3px rgba(0, 0, 0, 0.2)"
7704
- }
7705
- }),
7706
- /* @__PURE__ */ jsx("div", {
7707
- style: {
7708
- position: "absolute",
7709
- bottom: "0",
7710
- left: "0",
7711
- width: "100%",
7712
- height: "".concat((isMuted ? 0 : volume) * 100, "%"),
7713
- background: "linear-gradient(180deg, rgba(96, 165, 250, 1) 0%, rgba(59, 130, 246, 0.95) 50%, rgba(37, 99, 235, 0.9) 100%)",
7714
- borderRadius: "4px",
7715
- transition: "height 0.15s ease-out, box-shadow 0.2s ease-in-out",
7716
- boxShadow: "0 0 8px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3)"
7717
- }
7718
- }),
7719
- /* @__PURE__ */ jsx("div", {
7720
- style: {
7721
- position: "absolute",
7722
- bottom: "calc(".concat((isMuted ? 0 : volume) * 100, "% - 7px)"),
7723
- left: "50%",
7724
- transform: "translateX(-50%)",
7725
- width: "14px",
7726
- height: "14px",
7727
- background: "linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%)",
7728
- borderRadius: "50%",
7729
- 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)",
7730
- 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",
7731
- cursor: "grab"
7732
- },
7733
- onMouseEnter: function onMouseEnter(e) {
7734
- 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)";
7735
- e.currentTarget.style.cursor = "grab";
7736
- },
7737
- onMouseLeave: function onMouseLeave(e) {
7738
- 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)";
7739
- },
7740
- onMouseDown: function onMouseDown(e) {
7741
- e.currentTarget.style.cursor = "grabbing";
7742
- },
7743
- onMouseUp: function onMouseUp(e) {
7744
- e.currentTarget.style.cursor = "grab";
7745
- }
7746
- })
7747
- ]
7748
- })
8141
+ top: 0,
8142
+ left: 0,
8143
+ bottom: 0,
8144
+ width: "".concat((isMuted ? 0 : volume) * 100, "%"),
8145
+ background: "#fff",
8146
+ borderRadius: "1.5px",
8147
+ transition: "width 0.1s ease-out"
8148
+ }
8149
+ }),
8150
+ /* @__PURE__ */ jsx("div", {
8151
+ style: {
8152
+ position: "absolute",
8153
+ top: "50%",
8154
+ left: "".concat((isMuted ? 0 : volume) * 100, "%"),
8155
+ transform: "translate(-50%, -50%)",
8156
+ width: "12px",
8157
+ height: "12px",
8158
+ background: "#fff",
8159
+ borderRadius: "50%",
8160
+ boxShadow: "0 0 3px rgba(0, 0, 0, 0.3)",
8161
+ transition: "left 0.1s ease-out"
8162
+ }
7749
8163
  })
7750
8164
  ]
7751
8165
  })
7752
- ]
7753
- }),
7754
- /* @__PURE__ */ jsxs("div", {
7755
- style: {
7756
- fontSize: "".concat(14 * responsiveScale, "px"),
7757
- fontFamily: "monospace",
7758
- color: "rgba(255, 255, 255, 0.9)",
7759
- display: viewportWidth < 480 ? "none" : "block"
7760
- },
7761
- children: [
7762
- formatTime(currentTime),
7763
- " / ",
7764
- formatTime(duration)
7765
- ]
7766
- })
7767
- ]
7768
- }),
7769
- /* @__PURE__ */ jsxs("div", {
7770
- style: {
7771
- display: "flex",
7772
- alignItems: "center",
7773
- gap: "".concat(12 * responsiveScale, "px")
7774
- },
7775
- children: [
7776
- /* @__PURE__ */ jsxs("div", {
7777
- style: {
7778
- position: "relative",
7779
- display: viewportWidth < 600 ? "none" : "block"
7780
- },
7781
- children: [
7782
- /* @__PURE__ */ jsxs("button", {
7783
- onClick: function onClick() {
7784
- return setShowSpeedMenu(!showSpeedMenu);
7785
- },
7786
- style: {
7787
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
7788
- backdropFilter: "blur(10px)",
7789
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7790
- color: "#ffffff",
7791
- cursor: "pointer",
7792
- padding: "".concat(8 * responsiveScale, "px ").concat(14 * responsiveScale, "px"),
7793
- borderRadius: "".concat(14 * responsiveScale, "px"),
7794
- fontSize: "".concat(14 * responsiveScale, "px"),
7795
- fontFamily: "monospace",
7796
- fontWeight: "700",
7797
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7798
- 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)",
7799
- minWidth: "".concat(56 * responsiveScale, "px"),
7800
- minHeight: "".concat(40 * responsiveScale, "px")
7801
- },
7802
- onMouseEnter: function onMouseEnter(e) {
7803
- var target = e.target;
7804
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
7805
- 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)";
7806
- },
7807
- onMouseLeave: function onMouseLeave(e) {
7808
- var target = e.target;
7809
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
7810
- 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)";
7811
- },
7812
- title: "Playback Speed",
7813
- children: [
7814
- playbackRate,
7815
- "x"
7816
- ]
7817
- }),
7818
- showSpeedMenu && /* @__PURE__ */ jsx("div", {
7819
- style: {
7820
- position: "absolute",
7821
- bottom: "100%",
7822
- right: 0,
7823
- marginBottom: "12px",
7824
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%)",
7825
- backdropFilter: "blur(20px)",
7826
- borderRadius: "12px",
7827
- border: "1px solid rgba(255, 255, 255, 0.1)",
7828
- overflow: "hidden",
7829
- minWidth: "90px",
7830
- boxShadow: "0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1)"
7831
- },
7832
- children: [
7833
- 0.25,
7834
- 0.5,
7835
- 0.75,
7836
- 1,
7837
- 1.25,
7838
- 1.5,
7839
- 1.75,
7840
- 2
7841
- ].map(function(speed) {
7842
- return /* @__PURE__ */ jsxs("button", {
7843
- onClick: function onClick() {
7844
- return handlePlaybackRateChange(speed);
7845
- },
7846
- style: {
7847
- display: "block",
7848
- width: "100%",
7849
- padding: "10px 16px",
7850
- background: playbackRate === speed ? "linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(139, 92, 246, 0.6) 100%)" : "transparent",
7851
- border: "none",
7852
- color: "white",
7853
- cursor: "pointer",
7854
- fontSize: "13px",
7855
- fontFamily: "monospace",
7856
- fontWeight: "600",
7857
- textAlign: "center",
7858
- transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7859
- borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
7860
- },
7861
- onMouseEnter: function onMouseEnter(e) {
7862
- if (playbackRate !== speed) {
7863
- e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
7864
- }
7865
- },
7866
- onMouseLeave: function onMouseLeave(e) {
7867
- if (playbackRate !== speed) {
7868
- e.target.style.background = "transparent";
7869
- }
7870
- },
7871
- children: [
7872
- speed,
7873
- "x"
7874
- ]
7875
- }, speed);
7876
- })
7877
- })
7878
- ]
7879
- }),
7880
- /* @__PURE__ */ jsx("button", {
7881
- onClick: function onClick() {
7882
- if (onFullscreenToggle) {
7883
- onFullscreenToggle();
7884
- } else if (playerRef.current) {
7885
- playerRef.current.toggleFullscreen().catch(function(err) {
7886
- console.error("Fullscreen error:", err);
7887
- });
7888
- }
7889
- },
7890
- style: {
7891
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)",
7892
- backdropFilter: "blur(10px)",
7893
- border: "".concat(2 * responsiveScale, "px solid rgba(255, 255, 255, 0.3)"),
7894
- color: "#ffffff",
7895
- cursor: "pointer",
7896
- padding: "".concat(8 * responsiveScale, "px"),
7897
- borderRadius: "".concat(16 * responsiveScale, "px"),
7898
- display: "flex",
7899
- alignItems: "center",
7900
- justifyContent: "center",
7901
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
7902
- 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)",
7903
- minWidth: "".concat(44 * responsiveScale, "px"),
7904
- minHeight: "".concat(44 * responsiveScale, "px")
7905
- },
7906
- onMouseEnter: function onMouseEnter(e) {
7907
- var target = e.target;
7908
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
7909
- 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)";
7910
- },
7911
- onMouseLeave: function onMouseLeave(e) {
7912
- var target = e.target;
7913
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
7914
- 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)";
7915
- },
7916
- title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
7917
- children: isFullscreen ? /* @__PURE__ */ jsx(FaCompress, {
7918
- size: Math.max(14, 16 * responsiveScale),
8166
+ })
8167
+ ]
8168
+ }),
8169
+ /* @__PURE__ */ jsxs("div", {
8170
+ style: {
8171
+ fontSize: "".concat(13 * responsiveScale, "px"),
8172
+ fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
8173
+ color: "rgba(255, 255, 255, 0.9)",
8174
+ display: viewportWidth < 480 ? "none" : "block",
8175
+ fontVariantNumeric: "tabular-nums",
8176
+ userSelect: "none",
8177
+ marginLeft: "".concat(4 * responsiveScale, "px")
8178
+ },
8179
+ children: [
8180
+ formatTime(currentTime),
8181
+ " ",
8182
+ /* @__PURE__ */ jsx("span", {
7919
8183
  style: {
7920
- filter: "drop-shadow(0 0 0 transparent)"
7921
- }
7922
- }) : /* @__PURE__ */ jsx(FaExpand, {
7923
- size: Math.max(14, 16 * responsiveScale),
8184
+ color: "rgba(255,255,255,0.5)"
8185
+ },
8186
+ children: "/"
8187
+ }),
8188
+ " ",
8189
+ formatTime(duration)
8190
+ ]
8191
+ })
8192
+ ]
8193
+ }),
8194
+ /* @__PURE__ */ jsxs("div", {
8195
+ style: {
8196
+ display: "flex",
8197
+ alignItems: "center",
8198
+ gap: "".concat(8 * responsiveScale, "px")
8199
+ },
8200
+ children: [
8201
+ /* @__PURE__ */ jsxs("div", {
8202
+ style: {
8203
+ position: "relative",
8204
+ display: viewportWidth < 600 ? "none" : "block"
8205
+ },
8206
+ children: [
8207
+ /* @__PURE__ */ jsxs("button", {
8208
+ className: "sc-ctrl-btn",
8209
+ onClick: function onClick() {
8210
+ setShowSpeedMenu(!showSpeedMenu);
8211
+ resetControlsTimer();
8212
+ },
7924
8213
  style: {
7925
- filter: "drop-shadow(0 0 0 transparent)"
7926
- }
8214
+ padding: "".concat(6 * responsiveScale, "px ").concat(10 * responsiveScale, "px"),
8215
+ borderRadius: "".concat(6 * responsiveScale, "px"),
8216
+ fontSize: "".concat(13 * responsiveScale, "px"),
8217
+ fontFamily: "'SF Mono', 'Cascadia Code', monospace",
8218
+ fontWeight: "600",
8219
+ minHeight: "".concat(32 * responsiveScale, "px")
8220
+ },
8221
+ title: "Playback Speed",
8222
+ children: [
8223
+ playbackRate,
8224
+ "x"
8225
+ ]
8226
+ }),
8227
+ showSpeedMenu && /* @__PURE__ */ jsx("div", {
8228
+ style: {
8229
+ position: "absolute",
8230
+ bottom: "100%",
8231
+ right: 0,
8232
+ marginBottom: "8px",
8233
+ background: "rgba(0, 0, 0, 0.8)",
8234
+ backdropFilter: "blur(24px)",
8235
+ WebkitBackdropFilter: "blur(24px)",
8236
+ borderRadius: "10px",
8237
+ border: "1px solid rgba(255, 255, 255, 0.1)",
8238
+ overflow: "hidden",
8239
+ minWidth: "80px",
8240
+ boxShadow: "0 12px 40px rgba(0, 0, 0, 0.5)",
8241
+ animation: "sc-fade-in 0.15s ease"
8242
+ },
8243
+ children: [
8244
+ 0.25,
8245
+ 0.5,
8246
+ 0.75,
8247
+ 1,
8248
+ 1.25,
8249
+ 1.5,
8250
+ 1.75,
8251
+ 2
8252
+ ].map(function(speed) {
8253
+ return /* @__PURE__ */ jsxs("button", {
8254
+ onClick: function onClick() {
8255
+ return handlePlaybackRateChange(speed);
8256
+ },
8257
+ style: {
8258
+ display: "block",
8259
+ width: "100%",
8260
+ padding: "".concat(8 * responsiveScale, "px ").concat(14 * responsiveScale, "px"),
8261
+ background: playbackRate === speed ? "rgba(255, 255, 255, 0.12)" : "transparent",
8262
+ border: "none",
8263
+ color: playbackRate === speed ? "#fff" : "rgba(255, 255, 255, 0.7)",
8264
+ cursor: "pointer",
8265
+ fontSize: "".concat(12 * responsiveScale, "px"),
8266
+ fontFamily: "'SF Mono', monospace",
8267
+ fontWeight: playbackRate === speed ? "700" : "500",
8268
+ textAlign: "center",
8269
+ transition: "background 0.15s ease, color 0.15s ease"
8270
+ },
8271
+ onMouseEnter: function onMouseEnter(e) {
8272
+ if (playbackRate !== speed) {
8273
+ e.target.style.background = "rgba(255, 255, 255, 0.08)";
8274
+ e.target.style.color = "#fff";
8275
+ }
8276
+ },
8277
+ onMouseLeave: function onMouseLeave(e) {
8278
+ if (playbackRate !== speed) {
8279
+ e.target.style.background = "transparent";
8280
+ e.target.style.color = "rgba(255, 255, 255, 0.7)";
8281
+ }
8282
+ },
8283
+ children: [
8284
+ speed,
8285
+ "x"
8286
+ ]
8287
+ }, speed);
8288
+ })
7927
8289
  })
8290
+ ]
8291
+ }),
8292
+ /* @__PURE__ */ jsx("button", {
8293
+ className: "sc-ctrl-btn",
8294
+ onClick: function onClick() {
8295
+ if (onFullscreenToggle) {
8296
+ onFullscreenToggle();
8297
+ } else if (wrapperRef.current) {
8298
+ if (!document.fullscreenElement) {
8299
+ wrapperRef.current.requestFullscreen().catch(function() {});
8300
+ } else {
8301
+ document.exitFullscreen().catch(function() {});
8302
+ }
8303
+ }
8304
+ resetControlsTimer();
8305
+ },
8306
+ style: {
8307
+ padding: "".concat(8 * responsiveScale, "px"),
8308
+ borderRadius: "50%",
8309
+ minWidth: "".concat(36 * responsiveScale, "px"),
8310
+ minHeight: "".concat(36 * responsiveScale, "px")
8311
+ },
8312
+ title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
8313
+ children: isFullscreen ? /* @__PURE__ */ jsx(FaCompress, {
8314
+ size: Math.max(14, 18 * responsiveScale)
8315
+ }) : /* @__PURE__ */ jsx(FaExpand, {
8316
+ size: Math.max(14, 18 * responsiveScale)
7928
8317
  })
7929
- ]
7930
- })
7931
- ]
7932
- })
7933
- ]
7934
- })
8318
+ })
8319
+ ]
8320
+ })
8321
+ ]
8322
+ })
8323
+ ]
7935
8324
  }) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ jsxs("div", {
8325
+ className: "sc-controls-bar",
7936
8326
  style: {
7937
8327
  position: "absolute",
7938
8328
  bottom: "".concat(10 * responsiveScale, "px"),
7939
8329
  right: "".concat(10 * responsiveScale, "px"),
7940
- transform: "none",
7941
8330
  display: "flex",
7942
8331
  flexDirection: isPortrait ? "column" : "row",
7943
- gap: "".concat(10 * responsiveScale, "px"),
7944
- zIndex: 10
8332
+ gap: "".concat(8 * responsiveScale, "px"),
8333
+ zIndex: 10,
8334
+ opacity: controlsVisible ? 1 : 0,
8335
+ transform: controlsVisible ? "translateY(0)" : "translateY(4px)",
8336
+ pointerEvents: controlsVisible ? "auto" : "none"
7945
8337
  },
7946
8338
  children: [
7947
8339
  /* @__PURE__ */ jsxs("div", {
7948
8340
  style: {
7949
- position: "relative",
7950
8341
  display: "flex",
7951
8342
  alignItems: "center",
7952
- padding: "8px",
7953
- margin: "-8px"
8343
+ background: "rgba(0, 0, 0, 0.6)",
8344
+ borderRadius: "".concat(18 * responsiveScale, "px"),
8345
+ padding: "2px"
7954
8346
  },
7955
8347
  onMouseEnter: function onMouseEnter() {
7956
8348
  return setShowVolumeSlider(true);
@@ -7960,260 +8352,128 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
7960
8352
  },
7961
8353
  children: [
7962
8354
  /* @__PURE__ */ jsx("button", {
8355
+ className: "sc-ctrl-btn",
7963
8356
  onClick: function onClick() {
7964
- if (playerRef.current) {
7965
- playerRef.current.toggleMute();
7966
- }
7967
- if (onVolumeToggle) {
7968
- onVolumeToggle();
7969
- }
7970
- },
7971
- onMouseEnter: function onMouseEnter(e) {
7972
- var target = e.currentTarget;
7973
- 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)";
7974
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
7975
- },
7976
- onMouseLeave: function onMouseLeave(e) {
7977
- var target = e.currentTarget;
7978
- 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)";
7979
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8357
+ if (playerRef.current) playerRef.current.toggleMute();
8358
+ onVolumeToggle === null || onVolumeToggle === void 0 ? void 0 : onVolumeToggle();
8359
+ resetControlsTimer();
7980
8360
  },
7981
8361
  style: {
7982
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
7983
- color: "#ffffff",
7984
- border: "none",
7985
- borderRadius: "".concat(18 * responsiveScale, "px"),
7986
8362
  padding: "".concat(8 * responsiveScale, "px"),
7987
- cursor: "pointer",
7988
- display: "flex",
7989
- alignItems: "center",
7990
- justifyContent: "center",
7991
- backdropFilter: "blur(20px)",
7992
- 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)",
7993
- transition: "all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
7994
- minWidth: "".concat(46 * responsiveScale, "px"),
7995
- minHeight: "".concat(46 * responsiveScale, "px")
8363
+ borderRadius: "50%",
8364
+ minWidth: "".concat(36 * responsiveScale, "px"),
8365
+ minHeight: "".concat(36 * responsiveScale, "px")
7996
8366
  },
7997
8367
  title: isMuted ? "Unmute" : "Mute",
7998
- children: isMuted || volume === 0 ? /* @__PURE__ */ jsx(FaVolumeMute, {
7999
- size: Math.max(14, 16 * responsiveScale),
8000
- style: {
8001
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8002
- color: "#ffffff"
8003
- }
8004
- }) : volume < 0.5 ? /* @__PURE__ */ jsx(FaVolumeDown, {
8005
- size: Math.max(14, 16 * responsiveScale),
8006
- style: {
8007
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8008
- color: "#ffffff"
8009
- }
8010
- }) : /* @__PURE__ */ jsx(FaVolumeUp, {
8011
- size: Math.max(14, 16 * responsiveScale),
8012
- style: {
8013
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8014
- color: "#ffffff"
8015
- }
8368
+ children: /* @__PURE__ */ jsx(VolumeIcon, {
8369
+ size: Math.max(14, 18 * responsiveScale)
8016
8370
  })
8017
8371
  }),
8018
- showVolumeSlider && /* @__PURE__ */ jsxs(Fragment, {
8019
- children: [
8020
- /* @__PURE__ */ jsx("div", {
8021
- style: {
8022
- position: "absolute",
8023
- bottom: "100%",
8024
- left: "50%",
8025
- transform: "translateX(-50%)",
8026
- width: "60px",
8027
- height: "20px",
8028
- marginBottom: "-16px",
8029
- zIndex: 9
8030
- },
8031
- onMouseEnter: function onMouseEnter() {
8032
- return setShowVolumeSlider(true);
8033
- },
8034
- onMouseLeave: function onMouseLeave() {
8035
- return setShowVolumeSlider(false);
8036
- }
8037
- }),
8038
- /* @__PURE__ */ jsx("div", {
8039
- style: {
8040
- position: "absolute",
8041
- bottom: "100%",
8042
- left: "50%",
8043
- transform: "translateX(-50%)",
8044
- marginBottom: "4px",
8045
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.96) 0%, rgba(20, 20, 20, 0.92) 100%)",
8046
- backdropFilter: "blur(20px)",
8047
- padding: "10px 14px",
8048
- borderRadius: "14px",
8049
- border: "2px solid rgba(255, 255, 255, 0.7)",
8050
- display: "flex",
8051
- flexDirection: "column",
8052
- alignItems: "center",
8053
- justifyContent: "center",
8054
- height: "128px",
8055
- 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)",
8056
- zIndex: 10,
8057
- transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
8058
- },
8059
- onMouseEnter: function onMouseEnter(e) {
8060
- setShowVolumeSlider(true);
8061
- 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)";
8062
- e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
8063
- },
8064
- onMouseLeave: function onMouseLeave(e) {
8065
- setShowVolumeSlider(false);
8066
- 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)";
8067
- e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
8068
- },
8069
- children: /* @__PURE__ */ jsxs("div", {
8372
+ /* @__PURE__ */ jsx("div", {
8373
+ style: {
8374
+ width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
8375
+ overflow: "hidden",
8376
+ transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
8377
+ display: "flex",
8378
+ alignItems: "center",
8379
+ paddingLeft: showVolumeSlider ? "2px" : "0",
8380
+ paddingRight: showVolumeSlider ? "6px" : "0"
8381
+ },
8382
+ children: /* @__PURE__ */ jsxs("div", {
8383
+ style: {
8384
+ position: "relative",
8385
+ width: "".concat(56 * responsiveScale, "px"),
8386
+ height: "3px",
8387
+ cursor: "pointer",
8388
+ borderRadius: "1.5px"
8389
+ },
8390
+ onMouseDown: function onMouseDown(e) {
8391
+ e.preventDefault();
8392
+ var el = e.currentTarget;
8393
+ var move = function move(ev) {
8394
+ var r2 = el.getBoundingClientRect();
8395
+ handleVolumeChange(Math.max(0, Math.min(1, (ev.clientX - r2.left) / r2.width)));
8396
+ };
8397
+ var up = function up1() {
8398
+ document.removeEventListener("mousemove", move);
8399
+ document.removeEventListener("mouseup", up);
8400
+ };
8401
+ document.addEventListener("mousemove", move);
8402
+ document.addEventListener("mouseup", up);
8403
+ var r = el.getBoundingClientRect();
8404
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
8405
+ },
8406
+ onClick: function onClick(e) {
8407
+ e.stopPropagation();
8408
+ var r = e.currentTarget.getBoundingClientRect();
8409
+ handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
8410
+ },
8411
+ children: [
8412
+ /* @__PURE__ */ jsx("div", {
8070
8413
  style: {
8071
- position: "relative",
8072
- width: "8px",
8073
- height: "104px",
8074
- cursor: "pointer",
8075
- transition: "transform 0.2s ease-in-out"
8076
- },
8077
- onMouseDown: function onMouseDown(e) {
8078
- e.preventDefault();
8079
- var sliderElement = e.currentTarget;
8080
- var handleMouseMove = function handleMouseMove(moveEvent) {
8081
- if (!sliderElement) return;
8082
- var rect2 = sliderElement.getBoundingClientRect();
8083
- var y2 = moveEvent.clientY - rect2.top;
8084
- var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
8085
- handleVolumeChange(percentage2);
8086
- };
8087
- var handleMouseUp = function handleMouseUp1() {
8088
- document.removeEventListener("mousemove", handleMouseMove);
8089
- document.removeEventListener("mouseup", handleMouseUp);
8090
- };
8091
- document.addEventListener("mousemove", handleMouseMove);
8092
- document.addEventListener("mouseup", handleMouseUp);
8093
- var rect = sliderElement.getBoundingClientRect();
8094
- var y = e.clientY - rect.top;
8095
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8096
- handleVolumeChange(percentage);
8097
- },
8098
- onClick: function onClick(e) {
8099
- e.stopPropagation();
8100
- var rect = e.currentTarget.getBoundingClientRect();
8101
- var y = e.clientY - rect.top;
8102
- var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
8103
- handleVolumeChange(percentage);
8104
- },
8105
- children: [
8106
- /* @__PURE__ */ jsx("div", {
8107
- style: {
8108
- position: "absolute",
8109
- bottom: "0",
8110
- left: "0",
8111
- width: "100%",
8112
- height: "100%",
8113
- background: "linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.5) 100%)",
8114
- borderRadius: "4px",
8115
- border: "1px solid rgba(255, 255, 255, 0.4)",
8116
- boxShadow: "inset 0 1px 3px rgba(0, 0, 0, 0.3)"
8117
- }
8118
- }),
8119
- /* @__PURE__ */ jsx("div", {
8120
- style: {
8121
- position: "absolute",
8122
- bottom: "0",
8123
- left: "0",
8124
- width: "100%",
8125
- height: "".concat((isMuted ? 0 : volume) * 100, "%"),
8126
- background: "linear-gradient(180deg, rgba(125, 211, 252, 1) 0%, rgba(96, 165, 250, 0.98) 50%, rgba(59, 130, 246, 0.95) 100%)",
8127
- borderRadius: "4px",
8128
- transition: "height 0.15s ease-out, box-shadow 0.2s ease-in-out",
8129
- boxShadow: "0 0 12px rgba(96, 165, 250, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4)"
8130
- }
8131
- }),
8132
- /* @__PURE__ */ jsx("div", {
8133
- style: {
8134
- position: "absolute",
8135
- bottom: "calc(".concat((isMuted ? 0 : volume) * 100, "% - 8px)"),
8136
- left: "50%",
8137
- transform: "translateX(-50%)",
8138
- width: "16px",
8139
- height: "16px",
8140
- background: "linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%)",
8141
- borderRadius: "50%",
8142
- border: "2px solid rgba(96, 165, 250, 0.9)",
8143
- 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)",
8144
- 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",
8145
- cursor: "grab"
8146
- },
8147
- onMouseEnter: function onMouseEnter(e) {
8148
- 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)";
8149
- e.currentTarget.style.cursor = "grab";
8150
- },
8151
- onMouseLeave: function onMouseLeave(e) {
8152
- 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)";
8153
- },
8154
- onMouseDown: function onMouseDown(e) {
8155
- e.currentTarget.style.cursor = "grabbing";
8156
- },
8157
- onMouseUp: function onMouseUp(e) {
8158
- e.currentTarget.style.cursor = "grab";
8159
- }
8160
- })
8161
- ]
8414
+ position: "absolute",
8415
+ inset: 0,
8416
+ background: "rgba(255, 255, 255, 0.2)",
8417
+ borderRadius: "1.5px"
8418
+ }
8419
+ }),
8420
+ /* @__PURE__ */ jsx("div", {
8421
+ style: {
8422
+ position: "absolute",
8423
+ top: 0,
8424
+ left: 0,
8425
+ bottom: 0,
8426
+ width: "".concat((isMuted ? 0 : volume) * 100, "%"),
8427
+ background: "#fff",
8428
+ borderRadius: "1.5px",
8429
+ transition: "width 0.1s ease-out"
8430
+ }
8431
+ }),
8432
+ /* @__PURE__ */ jsx("div", {
8433
+ style: {
8434
+ position: "absolute",
8435
+ top: "50%",
8436
+ left: "".concat((isMuted ? 0 : volume) * 100, "%"),
8437
+ transform: "translate(-50%, -50%)",
8438
+ width: "12px",
8439
+ height: "12px",
8440
+ background: "#fff",
8441
+ borderRadius: "50%",
8442
+ boxShadow: "0 0 3px rgba(0, 0, 0, 0.3)",
8443
+ transition: "left 0.1s ease-out"
8444
+ }
8162
8445
  })
8163
- })
8164
- ]
8446
+ ]
8447
+ })
8165
8448
  })
8166
8449
  ]
8167
8450
  }),
8168
8451
  /* @__PURE__ */ jsx("button", {
8452
+ className: "sc-ctrl-btn",
8169
8453
  onClick: function onClick() {
8170
8454
  if (onFullscreenToggle) {
8171
8455
  onFullscreenToggle();
8172
- } else if (playerRef.current) {
8173
- playerRef.current.toggleFullscreen().catch(function(err) {
8174
- console.error("Fullscreen error:", err);
8175
- });
8456
+ } else if (wrapperRef.current) {
8457
+ if (!document.fullscreenElement) {
8458
+ wrapperRef.current.requestFullscreen().catch(function() {});
8459
+ } else {
8460
+ document.exitFullscreen().catch(function() {});
8461
+ }
8176
8462
  }
8177
- },
8178
- onMouseEnter: function onMouseEnter(e) {
8179
- var target = e.currentTarget;
8180
- 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)";
8181
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
8182
- },
8183
- onMouseLeave: function onMouseLeave(e) {
8184
- var target = e.currentTarget;
8185
- 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)";
8186
- target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
8463
+ resetControlsTimer();
8187
8464
  },
8188
8465
  style: {
8189
- background: "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)",
8190
- color: "#ffffff",
8191
- border: "none",
8192
- borderRadius: "".concat(18 * responsiveScale, "px"),
8193
8466
  padding: "".concat(8 * responsiveScale, "px"),
8194
- cursor: "pointer",
8195
- display: "flex",
8196
- alignItems: "center",
8197
- justifyContent: "center",
8198
- backdropFilter: "blur(20px)",
8199
- 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)",
8200
- transition: "all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
8201
- minWidth: "".concat(46 * responsiveScale, "px"),
8202
- minHeight: "".concat(46 * responsiveScale, "px")
8467
+ borderRadius: "50%",
8468
+ minWidth: "".concat(36 * responsiveScale, "px"),
8469
+ minHeight: "".concat(36 * responsiveScale, "px"),
8470
+ background: "rgba(0, 0, 0, 0.6)"
8203
8471
  },
8204
8472
  title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
8205
8473
  children: isFullscreen ? /* @__PURE__ */ jsx(FaCompress, {
8206
- size: Math.max(14, 16 * responsiveScale),
8207
- style: {
8208
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8209
- color: "#ffffff"
8210
- }
8474
+ size: Math.max(14, 18 * responsiveScale)
8211
8475
  }) : /* @__PURE__ */ jsx(FaExpand, {
8212
- size: Math.max(14, 16 * responsiveScale),
8213
- style: {
8214
- filter: "drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))",
8215
- color: "#ffffff"
8216
- }
8476
+ size: Math.max(14, 18 * responsiveScale)
8217
8477
  })
8218
8478
  })
8219
8479
  ]
@@ -8353,6 +8613,7 @@ var defaultProps = {
8353
8613
  showCustomControls: false,
8354
8614
  hideLoadingIndicator: false,
8355
8615
  licenseKey: "",
8616
+ vmapUrl: "",
8356
8617
  adFailsafeTimeoutMs: 1e4,
8357
8618
  minSegmentsBeforePlay: 2,
8358
8619
  onStart: noop,
@@ -9299,6 +9560,7 @@ var SUPPORTED_PROPS = [
9299
9560
  "debugAdTiming",
9300
9561
  "showCustomControls",
9301
9562
  "licenseKey",
9563
+ "vmapUrl",
9302
9564
  "adFailsafeTimeoutMs",
9303
9565
  "minSegmentsBeforePlay",
9304
9566
  "onReady",
@@ -9486,5 +9748,5 @@ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallbac
9486
9748
  };
9487
9749
  var StormcloudPlayer = createStormcloudPlayer(players_default, players_default[players_default.length - 1]);
9488
9750
  var StormcloudPlayer_default = StormcloudPlayer;
9489
- export { IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, SUPPORTS_DASH, SUPPORTS_HLS, StormcloudPlayer_default as StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, canPlay, createHlsAdPlayer, createImaController, createStormcloudPlayer, StormcloudVideoPlayerComponent as default, detectBrowser, getBrowserConfigOverrides, getBrowserID, getClientInfo, getRecommendedAdPlayer, initializePolyfills, isMediaStream, lazy, logBrowserInfo, merge, omit, parseQuery, players_default as players, randomString, sendHeartbeat, sendInitialTracking, supportsFeature, supportsGoogleIMA, supportsModernJS, supportsWebKitPresentationMode };
9751
+ export { IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, SUPPORTS_DASH, SUPPORTS_HLS, StormcloudPlayer_default as StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, canPlay, createHlsAdPlayer, createImaController, createStormcloudPlayer, StormcloudVideoPlayerComponent as default, detectBrowser, getBrowserConfigOverrides, getBrowserID, getClientInfo, getRecommendedAdPlayer, initializePolyfills, isMediaStream, lazy, logBrowserInfo, merge, omit, parseQuery, players_default as players, randomString, sendAdDetectTracking, sendAdImpressionTracking, sendAdLoadedTracking, sendHeartbeat, sendInitialTracking, supportsFeature, supportsGoogleIMA, supportsModernJS, supportsWebKitPresentationMode };
9490
9752
  //# sourceMappingURL=index.js.map