stormcloud-video-player 0.3.56 → 0.3.58
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/README.md +243 -10
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +147 -58
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +148 -59
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +39 -35
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +39 -35
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +39 -35
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +1 -1
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/ima.cjs +3 -3
- package/lib/sdk/ima.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +147 -58
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -880,7 +880,7 @@ function createImaController(video, options) {
|
|
|
880
880
|
adVideo.style.height = "100%";
|
|
881
881
|
adVideo.style.objectFit = "contain";
|
|
882
882
|
adVideo.style.backgroundColor = "transparent";
|
|
883
|
-
adVideo.style.zIndex = "
|
|
883
|
+
adVideo.style.zIndex = "2";
|
|
884
884
|
adVideo.playsInline = true;
|
|
885
885
|
adVideo.volume = originalVolume;
|
|
886
886
|
adVideo.muted = originalMutedState;
|
|
@@ -1173,7 +1173,7 @@ function createImaController(video, options) {
|
|
|
1173
1173
|
container.style.alignItems = "center";
|
|
1174
1174
|
container.style.justifyContent = "center";
|
|
1175
1175
|
container.style.pointerEvents = "none";
|
|
1176
|
-
container.style.zIndex = "
|
|
1176
|
+
container.style.zIndex = "30";
|
|
1177
1177
|
container.style.backgroundColor = "#000";
|
|
1178
1178
|
container.style.transition = "opacity 0.3s ease-in-out";
|
|
1179
1179
|
container.style.opacity = "0";
|
|
@@ -1288,7 +1288,7 @@ function createImaController(video, options) {
|
|
|
1288
1288
|
container.style.alignItems = "center";
|
|
1289
1289
|
container.style.justifyContent = "center";
|
|
1290
1290
|
container.style.pointerEvents = "none";
|
|
1291
|
-
container.style.zIndex = "
|
|
1291
|
+
container.style.zIndex = "30";
|
|
1292
1292
|
container.style.backgroundColor = "transparent";
|
|
1293
1293
|
container.style.transition = "opacity 0.3s ease-in-out, background-color 0.3s ease-in-out";
|
|
1294
1294
|
container.style.opacity = "0";
|
|
@@ -2203,7 +2203,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
2203
2203
|
container.style.alignItems = "center";
|
|
2204
2204
|
container.style.justifyContent = "center";
|
|
2205
2205
|
container.style.pointerEvents = "none";
|
|
2206
|
-
container.style.zIndex = "
|
|
2206
|
+
container.style.zIndex = "30";
|
|
2207
2207
|
container.style.backgroundColor = "#000";
|
|
2208
2208
|
(_contentVideo_parentElement = contentVideo.parentElement) === null || _contentVideo_parentElement === void 0 ? void 0 : _contentVideo_parentElement.appendChild(container);
|
|
2209
2209
|
adContainerEl = container;
|
|
@@ -3983,13 +3983,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3983
3983
|
_this.activeAdRequestToken = null;
|
|
3984
3984
|
_this.showAds = true;
|
|
3985
3985
|
_this.resetGamNoFillCounter();
|
|
3986
|
-
if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null) {
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
if (_this.config.debugAdTiming) {
|
|
3991
|
-
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3992
|
-
}
|
|
3986
|
+
if (_this.inAdBreak && _this.expectedAdBreakDurationMs != null && _this.adStopTimerId == null) {
|
|
3987
|
+
_this.scheduleAdStopCountdown(_this.getRemainingAdMs());
|
|
3988
|
+
if (_this.config.debugAdTiming) {
|
|
3989
|
+
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3993
3990
|
}
|
|
3994
3991
|
}
|
|
3995
3992
|
var currentMuted = _this.video.muted;
|
|
@@ -4052,6 +4049,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4052
4049
|
this.ima.showPlaceholder();
|
|
4053
4050
|
this.isShowingPlaceholder = true;
|
|
4054
4051
|
}
|
|
4052
|
+
var preservedMutedState = this.ima.getOriginalMutedState();
|
|
4053
|
+
var preservedVolumeState = this.ima.getOriginalVolume();
|
|
4055
4054
|
if (this.ima) {
|
|
4056
4055
|
try {
|
|
4057
4056
|
this.ima.destroy();
|
|
@@ -4066,7 +4065,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4066
4065
|
var continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
|
|
4067
4066
|
this.ima = this.createAdPlayer(continueLiveStreamDuringAds);
|
|
4068
4067
|
this.ima.initialize();
|
|
4069
|
-
this.ima.updateOriginalMutedState(
|
|
4068
|
+
this.ima.updateOriginalMutedState(preservedMutedState, preservedVolumeState);
|
|
4070
4069
|
this.attachImaEventListeners();
|
|
4071
4070
|
if (shouldShowPlaceholder) {
|
|
4072
4071
|
this.showPlaceholderLayer();
|
|
@@ -4382,12 +4381,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4382
4381
|
}
|
|
4383
4382
|
}
|
|
4384
4383
|
if (this.inAdBreak) {
|
|
4385
|
-
if (
|
|
4386
|
-
|
|
4387
|
-
if (this.
|
|
4388
|
-
|
|
4384
|
+
if (marker.durationSeconds != null) {
|
|
4385
|
+
var newDurationMs = marker.durationSeconds * 1e3;
|
|
4386
|
+
if (this.expectedAdBreakDurationMs == null || newDurationMs > this.expectedAdBreakDurationMs) {
|
|
4387
|
+
this.expectedAdBreakDurationMs = newDurationMs;
|
|
4388
|
+
var elapsedMs = this.currentAdBreakStartWallClockMs != null ? Date.now() - this.currentAdBreakStartWallClockMs : 0;
|
|
4389
|
+
var remainingMs = Math.max(0, newDurationMs - elapsedMs);
|
|
4390
|
+
this.scheduleAdStopCountdown(remainingMs);
|
|
4391
|
+
if (this.config.debugAdTiming) {
|
|
4392
|
+
console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(newDurationMs, "ms, remaining: ").concat(remainingMs, "ms"));
|
|
4393
|
+
}
|
|
4389
4394
|
}
|
|
4390
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
4391
4395
|
}
|
|
4392
4396
|
return;
|
|
4393
4397
|
}
|
|
@@ -4463,9 +4467,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4463
4467
|
this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
|
|
4464
4468
|
}
|
|
4465
4469
|
if (this.expectedAdBreakDurationMs != null && this.currentAdBreakStartWallClockMs != null) {
|
|
4466
|
-
var
|
|
4467
|
-
var
|
|
4468
|
-
this.scheduleAdStopCountdown(
|
|
4470
|
+
var elapsedMs1 = Date.now() - this.currentAdBreakStartWallClockMs;
|
|
4471
|
+
var remainingMs1 = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs1);
|
|
4472
|
+
this.scheduleAdStopCountdown(remainingMs1);
|
|
4469
4473
|
}
|
|
4470
4474
|
if (!this.ima.isAdPlaying() && this.activeAdRequestToken === null && this.adRequestQueue.length > 0) {
|
|
4471
4475
|
this.tryNextAvailableAdWithRateLimit();
|
|
@@ -5033,6 +5037,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5033
5037
|
return this.totalAdsInBreak;
|
|
5034
5038
|
}
|
|
5035
5039
|
},
|
|
5040
|
+
{
|
|
5041
|
+
key: "getAdRemainingMs",
|
|
5042
|
+
value: function getAdRemainingMs() {
|
|
5043
|
+
return this.getRemainingAdMs();
|
|
5044
|
+
}
|
|
5045
|
+
},
|
|
5036
5046
|
{
|
|
5037
5047
|
key: "generateVastUrlsWithCorrelators",
|
|
5038
5048
|
value: function generateVastUrlsWithCorrelators(baseUrl, count) {
|
|
@@ -5685,9 +5695,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5685
5695
|
];
|
|
5686
5696
|
case 2:
|
|
5687
5697
|
_state.sent();
|
|
5688
|
-
if (this.expectedAdBreakDurationMs != null) {
|
|
5689
|
-
this.
|
|
5690
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
5698
|
+
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
5699
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
5691
5700
|
}
|
|
5692
5701
|
adVolume = currentMuted ? 0 : currentVolume;
|
|
5693
5702
|
this.ima.setAdVolume(adVolume);
|
|
@@ -5728,9 +5737,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5728
5737
|
];
|
|
5729
5738
|
case 6:
|
|
5730
5739
|
_state.sent();
|
|
5731
|
-
if (this.expectedAdBreakDurationMs != null) {
|
|
5732
|
-
this.
|
|
5733
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
5740
|
+
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
5741
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
5734
5742
|
}
|
|
5735
5743
|
adVolume1 = currentMuted ? 0 : currentVolume;
|
|
5736
5744
|
this.ima.setAdVolume(adVolume1);
|
|
@@ -5784,9 +5792,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5784
5792
|
];
|
|
5785
5793
|
case 10:
|
|
5786
5794
|
_state.sent();
|
|
5787
|
-
if (this.expectedAdBreakDurationMs != null) {
|
|
5788
|
-
this.
|
|
5789
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
5795
|
+
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
5796
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
5790
5797
|
}
|
|
5791
5798
|
adVolume2 = currentMuted ? 0 : currentVolume;
|
|
5792
5799
|
this.ima.setAdVolume(adVolume2);
|
|
@@ -6137,8 +6144,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6137
6144
|
case 2:
|
|
6138
6145
|
_state.sent();
|
|
6139
6146
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6140
|
-
this.
|
|
6141
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
6147
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6142
6148
|
}
|
|
6143
6149
|
currentMuted = this.video.muted;
|
|
6144
6150
|
currentVolume = this.video.volume;
|
|
@@ -6891,8 +6897,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6891
6897
|
case 5:
|
|
6892
6898
|
_state.sent();
|
|
6893
6899
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6894
|
-
this.
|
|
6895
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
6900
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6896
6901
|
}
|
|
6897
6902
|
currentMuted = this.video.muted;
|
|
6898
6903
|
currentVolume = this.video.volume;
|
|
@@ -6942,8 +6947,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6942
6947
|
case 8:
|
|
6943
6948
|
_state.sent();
|
|
6944
6949
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6945
|
-
this.
|
|
6946
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
6950
|
+
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6947
6951
|
}
|
|
6948
6952
|
currentMuted1 = this.video.muted;
|
|
6949
6953
|
currentVolume1 = this.video.volume;
|
|
@@ -7534,6 +7538,7 @@ var CRITICAL_PROPS = [
|
|
|
7534
7538
|
"vastMode"
|
|
7535
7539
|
];
|
|
7536
7540
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
7541
|
+
var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
|
|
7537
7542
|
var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
7538
7543
|
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, [
|
|
7539
7544
|
"src",
|
|
@@ -7574,7 +7579,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7574
7579
|
var _import_react_default_useState = _sliced_to_array(import_react.default.useState({
|
|
7575
7580
|
showAds: false,
|
|
7576
7581
|
currentIndex: 0,
|
|
7577
|
-
totalAds: 0
|
|
7582
|
+
totalAds: 0,
|
|
7583
|
+
remainingSeconds: 0
|
|
7578
7584
|
}), 2), adStatus = _import_react_default_useState[0], setAdStatus = _import_react_default_useState[1];
|
|
7579
7585
|
var _import_react_default_useState1 = _sliced_to_array(import_react.default.useState(true), 2), shouldShowNativeControls = _import_react_default_useState1[0], setShouldShowNativeControls = _import_react_default_useState1[1];
|
|
7580
7586
|
var _import_react_default_useState2 = _sliced_to_array(import_react.default.useState(false), 2), isMuted = _import_react_default_useState2[0], setIsMuted = _import_react_default_useState2[1];
|
|
@@ -7593,6 +7599,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7593
7599
|
var _import_react_default_useState15 = _sliced_to_array(import_react.default.useState(true), 2), controlsVisible = _import_react_default_useState15[0], setControlsVisible = _import_react_default_useState15[1];
|
|
7594
7600
|
var _import_react_default_useState16 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react_default_useState16[0], setViewportWidth = _import_react_default_useState16[1];
|
|
7595
7601
|
var _import_react_default_useState17 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react_default_useState17[0], setIsPortrait = _import_react_default_useState17[1];
|
|
7602
|
+
var _import_react_default_useState18 = _sliced_to_array(import_react.default.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _import_react_default_useState18[0], setPlayerAspectRatio = _import_react_default_useState18[1];
|
|
7596
7603
|
var getResponsiveScale = function getResponsiveScale() {
|
|
7597
7604
|
if (viewportWidth < 480) return 0.7;
|
|
7598
7605
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -7797,15 +7804,18 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7797
7804
|
var showAds = showAdsFromMethod || showAdsFromAttribute;
|
|
7798
7805
|
var currentIndex = playerRef.current.getCurrentAdIndex();
|
|
7799
7806
|
var totalAds = playerRef.current.getTotalAdsInBreak();
|
|
7807
|
+
var remainingMs = playerRef.current.getAdRemainingMs();
|
|
7808
|
+
var remainingSeconds = showAds ? Math.max(0, Math.ceil(remainingMs / 1e3)) : 0;
|
|
7800
7809
|
setAdStatus(function(prev) {
|
|
7801
|
-
if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds) {
|
|
7810
|
+
if (prev.showAds !== showAds || prev.currentIndex !== currentIndex || prev.totalAds !== totalAds || prev.remainingSeconds !== remainingSeconds) {
|
|
7802
7811
|
if (showAds && !prev.showAds) {
|
|
7803
7812
|
setShowCenterPlay(false);
|
|
7804
7813
|
}
|
|
7805
7814
|
return {
|
|
7806
7815
|
showAds: showAds,
|
|
7807
7816
|
currentIndex: currentIndex,
|
|
7808
|
-
totalAds: totalAds
|
|
7817
|
+
totalAds: totalAds,
|
|
7818
|
+
remainingSeconds: remainingSeconds
|
|
7809
7819
|
};
|
|
7810
7820
|
}
|
|
7811
7821
|
return prev;
|
|
@@ -7863,8 +7873,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7863
7873
|
(0, import_react.useEffect)(function() {
|
|
7864
7874
|
if (!videoRef.current) return;
|
|
7865
7875
|
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
7866
|
-
|
|
7867
|
-
|
|
7876
|
+
var video2 = videoRef.current;
|
|
7877
|
+
if (video2) {
|
|
7878
|
+
if (video2.videoWidth > 0 && video2.videoHeight > 0) {
|
|
7879
|
+
setPlayerAspectRatio(video2.videoWidth / video2.videoHeight);
|
|
7880
|
+
}
|
|
7868
7881
|
void video2.offsetHeight;
|
|
7869
7882
|
}
|
|
7870
7883
|
if (debugAdTiming) {
|
|
@@ -7980,6 +7993,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7980
7993
|
}, [
|
|
7981
7994
|
debugAdTiming
|
|
7982
7995
|
]);
|
|
7996
|
+
(0, import_react.useEffect)(function() {
|
|
7997
|
+
setPlayerAspectRatio(DEFAULT_PLAYER_ASPECT_RATIO);
|
|
7998
|
+
}, [
|
|
7999
|
+
src
|
|
8000
|
+
]);
|
|
7983
8001
|
(0, import_react.useEffect)(function() {
|
|
7984
8002
|
return function() {
|
|
7985
8003
|
if (controlsTimerRef.current) {
|
|
@@ -7992,7 +8010,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7992
8010
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
7993
8011
|
children: [
|
|
7994
8012
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
7995
|
-
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 "
|
|
8013
|
+
children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-loading-glow {\n 0%, 100% { opacity: 0.85; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
|
|
7996
8014
|
}),
|
|
7997
8015
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7998
8016
|
ref: wrapperRef,
|
|
@@ -8010,6 +8028,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8010
8028
|
width: isFullscreen ? "100vw" : "100%",
|
|
8011
8029
|
height: isFullscreen ? "100vh" : "auto",
|
|
8012
8030
|
minHeight: isFullscreen ? "100vh" : "auto",
|
|
8031
|
+
aspectRatio: isFullscreen ? void 0 : playerAspectRatio,
|
|
8013
8032
|
maxWidth: isFullscreen ? "100vw" : "100%",
|
|
8014
8033
|
maxHeight: isFullscreen ? "100vh" : "none",
|
|
8015
8034
|
zIndex: isFullscreen ? 999999 : void 0,
|
|
@@ -8024,7 +8043,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8024
8043
|
style: _object_spread({
|
|
8025
8044
|
display: "block",
|
|
8026
8045
|
width: "100%",
|
|
8027
|
-
height:
|
|
8046
|
+
height: "100%",
|
|
8028
8047
|
maxWidth: "100%",
|
|
8029
8048
|
maxHeight: isFullscreen ? "100%" : "none",
|
|
8030
8049
|
objectFit: isFullscreen ? "cover" : "contain",
|
|
@@ -8038,18 +8057,44 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8038
8057
|
}, restVideoAttrs), {
|
|
8039
8058
|
children: children
|
|
8040
8059
|
})),
|
|
8041
|
-
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime.
|
|
8060
|
+
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8042
8061
|
className: "sc-loading-indicator",
|
|
8043
|
-
size: 40,
|
|
8044
|
-
color: "rgba(255, 255, 255, 0.85)",
|
|
8045
8062
|
style: {
|
|
8046
8063
|
position: "absolute",
|
|
8047
|
-
top: "
|
|
8048
|
-
left: "
|
|
8064
|
+
top: "50%",
|
|
8065
|
+
left: "50%",
|
|
8066
|
+
transform: "translate(-50%, -50%)",
|
|
8049
8067
|
zIndex: 20,
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8068
|
+
width: "".concat(Math.max(34, 38 * responsiveScale), "px"),
|
|
8069
|
+
height: "".concat(Math.max(34, 38 * responsiveScale), "px"),
|
|
8070
|
+
display: "flex",
|
|
8071
|
+
alignItems: "center",
|
|
8072
|
+
justifyContent: "center",
|
|
8073
|
+
animation: "sc-loading-glow 1.4s ease-in-out infinite",
|
|
8074
|
+
filter: "drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55))"
|
|
8075
|
+
},
|
|
8076
|
+
children: [
|
|
8077
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8078
|
+
style: {
|
|
8079
|
+
position: "absolute",
|
|
8080
|
+
inset: 0,
|
|
8081
|
+
borderRadius: "50%",
|
|
8082
|
+
border: "3px solid rgba(255, 255, 255, 0.25)",
|
|
8083
|
+
borderTopColor: "#ff0000",
|
|
8084
|
+
borderRightColor: "rgba(255, 255, 255, 0.85)",
|
|
8085
|
+
animation: "sc-spin 0.8s linear infinite"
|
|
8086
|
+
}
|
|
8087
|
+
}),
|
|
8088
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8089
|
+
style: {
|
|
8090
|
+
width: "7px",
|
|
8091
|
+
height: "7px",
|
|
8092
|
+
borderRadius: "50%",
|
|
8093
|
+
background: "#ff0000",
|
|
8094
|
+
boxShadow: "0 0 10px rgba(255, 0, 0, 0.65)"
|
|
8095
|
+
}
|
|
8096
|
+
})
|
|
8097
|
+
]
|
|
8053
8098
|
}),
|
|
8054
8099
|
showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8055
8100
|
style: {
|
|
@@ -8093,6 +8138,48 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8093
8138
|
})
|
|
8094
8139
|
]
|
|
8095
8140
|
}),
|
|
8141
|
+
adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8142
|
+
style: {
|
|
8143
|
+
position: "absolute",
|
|
8144
|
+
top: "".concat(12 * responsiveScale, "px"),
|
|
8145
|
+
left: "".concat(12 * responsiveScale, "px"),
|
|
8146
|
+
zIndex: 50,
|
|
8147
|
+
display: "flex",
|
|
8148
|
+
alignItems: "center",
|
|
8149
|
+
gap: "8px",
|
|
8150
|
+
pointerEvents: "none",
|
|
8151
|
+
animation: "sc-fade-in 0.3s ease"
|
|
8152
|
+
},
|
|
8153
|
+
children: [
|
|
8154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8155
|
+
style: {
|
|
8156
|
+
background: "rgba(234, 179, 8, 0.95)",
|
|
8157
|
+
color: "#111",
|
|
8158
|
+
padding: "".concat(4 * responsiveScale, "px ").concat(12 * responsiveScale, "px"),
|
|
8159
|
+
borderRadius: "6px",
|
|
8160
|
+
fontSize: "".concat(11 * responsiveScale, "px"),
|
|
8161
|
+
fontWeight: 700,
|
|
8162
|
+
letterSpacing: "0.08em",
|
|
8163
|
+
textTransform: "uppercase",
|
|
8164
|
+
boxShadow: "0 2px 12px rgba(234, 179, 8, 0.35)"
|
|
8165
|
+
},
|
|
8166
|
+
children: "Ad"
|
|
8167
|
+
}),
|
|
8168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8169
|
+
style: {
|
|
8170
|
+
background: "rgba(0, 0, 0, 0.58)",
|
|
8171
|
+
color: "rgba(255, 255, 255, 0.92)",
|
|
8172
|
+
padding: "".concat(4 * responsiveScale, "px ").concat(10 * responsiveScale, "px"),
|
|
8173
|
+
borderRadius: "6px",
|
|
8174
|
+
fontSize: "".concat(11 * responsiveScale, "px"),
|
|
8175
|
+
fontWeight: 600,
|
|
8176
|
+
border: "1px solid rgba(255, 255, 255, 0.1)",
|
|
8177
|
+
boxShadow: "0 2px 10px rgba(0, 0, 0, 0.25)"
|
|
8178
|
+
},
|
|
8179
|
+
children: "".concat(Math.max(1, adStatus.currentIndex), " of ").concat(Math.max(Math.max(1, adStatus.currentIndex), adStatus.totalAds))
|
|
8180
|
+
})
|
|
8181
|
+
]
|
|
8182
|
+
}),
|
|
8096
8183
|
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8097
8184
|
onClick: handleCenterPlayClick,
|
|
8098
8185
|
style: {
|
|
@@ -8232,7 +8319,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8232
8319
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8233
8320
|
style: {
|
|
8234
8321
|
display: "flex",
|
|
8235
|
-
alignItems: "center"
|
|
8322
|
+
alignItems: "center",
|
|
8323
|
+
paddingRight: "".concat(6 * responsiveScale, "px")
|
|
8236
8324
|
},
|
|
8237
8325
|
onMouseEnter: function onMouseEnter() {
|
|
8238
8326
|
return setShowVolumeSlider(true);
|
|
@@ -8261,13 +8349,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8261
8349
|
}),
|
|
8262
8350
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8263
8351
|
style: {
|
|
8264
|
-
width: showVolumeSlider ? "".concat(
|
|
8352
|
+
width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
|
|
8265
8353
|
overflow: "hidden",
|
|
8266
8354
|
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
8267
8355
|
display: "flex",
|
|
8268
8356
|
alignItems: "center",
|
|
8269
|
-
paddingLeft: showVolumeSlider ? "
|
|
8270
|
-
paddingRight: showVolumeSlider ? "
|
|
8357
|
+
paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
|
|
8358
|
+
paddingRight: showVolumeSlider ? "".concat(8 * responsiveScale, "px") : "0"
|
|
8271
8359
|
},
|
|
8272
8360
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8273
8361
|
style: {
|
|
@@ -8514,7 +8602,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8514
8602
|
alignItems: "center",
|
|
8515
8603
|
background: "rgba(0, 0, 0, 0.6)",
|
|
8516
8604
|
borderRadius: "".concat(18 * responsiveScale, "px"),
|
|
8517
|
-
padding: "2px"
|
|
8605
|
+
padding: "2px",
|
|
8606
|
+
paddingRight: "".concat(8 * responsiveScale, "px")
|
|
8518
8607
|
},
|
|
8519
8608
|
onMouseEnter: function onMouseEnter() {
|
|
8520
8609
|
return setShowVolumeSlider(true);
|
|
@@ -8543,13 +8632,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8543
8632
|
}),
|
|
8544
8633
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8545
8634
|
style: {
|
|
8546
|
-
width: showVolumeSlider ? "".concat(
|
|
8635
|
+
width: showVolumeSlider ? "".concat(68 * responsiveScale, "px") : "0px",
|
|
8547
8636
|
overflow: "hidden",
|
|
8548
8637
|
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
8549
8638
|
display: "flex",
|
|
8550
8639
|
alignItems: "center",
|
|
8551
|
-
paddingLeft: showVolumeSlider ? "
|
|
8552
|
-
paddingRight: showVolumeSlider ? "
|
|
8640
|
+
paddingLeft: showVolumeSlider ? "".concat(3 * responsiveScale, "px") : "0",
|
|
8641
|
+
paddingRight: showVolumeSlider ? "".concat(10 * responsiveScale, "px") : "0"
|
|
8553
8642
|
},
|
|
8554
8643
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8555
8644
|
style: {
|