stormcloud-video-player 0.7.16 → 0.7.17
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/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +66 -12
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +5 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +67 -13
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs.map +1 -1
- package/lib/sdk/vastParser.cjs.map +1 -1
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +66 -12
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +5 -0
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -270,6 +270,11 @@ type StormcloudVideoPlayerProps = Omit<StormcloudVideoPlayerConfig, "videoElemen
|
|
|
270
270
|
wrapperStyle?: React.CSSProperties;
|
|
271
271
|
licenseKey?: string;
|
|
272
272
|
swirlProjectId?: number;
|
|
273
|
+
disableOverlays?: boolean;
|
|
274
|
+
showAdsControl?: boolean;
|
|
275
|
+
showOverlaysControl?: boolean;
|
|
276
|
+
showAiContextControl?: boolean;
|
|
277
|
+
showDebugControl?: boolean;
|
|
273
278
|
};
|
|
274
279
|
declare const StormcloudVideoPlayerComponent: React.FC<StormcloudVideoPlayerProps>;
|
|
275
280
|
|
package/lib/index.d.ts
CHANGED
|
@@ -270,6 +270,11 @@ type StormcloudVideoPlayerProps = Omit<StormcloudVideoPlayerConfig, "videoElemen
|
|
|
270
270
|
wrapperStyle?: React.CSSProperties;
|
|
271
271
|
licenseKey?: string;
|
|
272
272
|
swirlProjectId?: number;
|
|
273
|
+
disableOverlays?: boolean;
|
|
274
|
+
showAdsControl?: boolean;
|
|
275
|
+
showOverlaysControl?: boolean;
|
|
276
|
+
showAiContextControl?: boolean;
|
|
277
|
+
showDebugControl?: boolean;
|
|
273
278
|
};
|
|
274
279
|
declare const StormcloudVideoPlayerComponent: React.FC<StormcloudVideoPlayerProps>;
|
|
275
280
|
|
package/lib/index.js
CHANGED
|
@@ -5607,7 +5607,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5607
5607
|
return StormcloudVideoPlayer;
|
|
5608
5608
|
}();
|
|
5609
5609
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
5610
|
-
import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress, FaCog, FaTimes, FaCopy } from "react-icons/fa";
|
|
5610
|
+
import { FaPlay, FaPause, FaVolumeUp, FaVolumeMute, FaVolumeDown, FaExpand, FaCompress, FaCog, FaTimes, FaCopy, FaLayerGroup } from "react-icons/fa";
|
|
5611
5611
|
// src/ui/OverlayRenderer.tsx
|
|
5612
5612
|
import React, { useEffect, useRef, useState, useCallback, useMemo, useId } from "react";
|
|
5613
5613
|
// src/utils/overlays.ts
|
|
@@ -7221,7 +7221,7 @@ var PANEL_BASE_RIGHT_OFFSET = 10;
|
|
|
7221
7221
|
var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
7222
7222
|
var _ref;
|
|
7223
7223
|
var _aiLiveContext_context;
|
|
7224
|
-
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, minSegmentsBeforePlay = props.minSegmentsBeforePlay, disableAds = props.disableAds, disableFiller = props.disableFiller, swirlProjectId = props.swirlProjectId, restVideoAttrs = _object_without_properties(props, [
|
|
7224
|
+
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, minSegmentsBeforePlay = props.minSegmentsBeforePlay, disableAds = props.disableAds, disableFiller = props.disableFiller, swirlProjectId = props.swirlProjectId, disableOverlays = props.disableOverlays, showAdsControl = props.showAdsControl, showOverlaysControl = props.showOverlaysControl, showAiContextControl = props.showAiContextControl, showDebugControl = props.showDebugControl, restVideoAttrs = _object_without_properties(props, [
|
|
7225
7225
|
"src",
|
|
7226
7226
|
"autoplay",
|
|
7227
7227
|
"muted",
|
|
@@ -7249,7 +7249,12 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
7249
7249
|
"minSegmentsBeforePlay",
|
|
7250
7250
|
"disableAds",
|
|
7251
7251
|
"disableFiller",
|
|
7252
|
-
"swirlProjectId"
|
|
7252
|
+
"swirlProjectId",
|
|
7253
|
+
"disableOverlays",
|
|
7254
|
+
"showAdsControl",
|
|
7255
|
+
"showOverlaysControl",
|
|
7256
|
+
"showAiContextControl",
|
|
7257
|
+
"showDebugControl"
|
|
7253
7258
|
]);
|
|
7254
7259
|
var videoRef = useRef2(null);
|
|
7255
7260
|
var playerRef = useRef2(null);
|
|
@@ -7286,12 +7291,13 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
7286
7291
|
var _React2_useState22 = _sliced_to_array(React2.useState([]), 2), debugMarkers = _React2_useState22[0], setDebugMarkers = _React2_useState22[1];
|
|
7287
7292
|
var _React2_useState23 = _sliced_to_array(React2.useState(false), 2), showAiPanel = _React2_useState23[0], setShowAiPanel = _React2_useState23[1];
|
|
7288
7293
|
var _React2_useState24 = _sliced_to_array(React2.useState(disableAds !== null && disableAds !== void 0 ? disableAds : false), 2), adsDisabled = _React2_useState24[0], setAdsDisabled = _React2_useState24[1];
|
|
7289
|
-
var _React2_useState25 = _sliced_to_array(React2.useState(
|
|
7294
|
+
var _React2_useState25 = _sliced_to_array(React2.useState(disableOverlays !== null && disableOverlays !== void 0 ? disableOverlays : false), 2), overlaysDisabled = _React2_useState25[0], setOverlaysDisabled = _React2_useState25[1];
|
|
7295
|
+
var _React2_useState26 = _sliced_to_array(React2.useState({
|
|
7290
7296
|
context: null,
|
|
7291
7297
|
isLoading: false,
|
|
7292
7298
|
error: null,
|
|
7293
7299
|
lastPolledAt: null
|
|
7294
|
-
}), 2), aiLiveContext =
|
|
7300
|
+
}), 2), aiLiveContext = _React2_useState26[0], setAiLiveContext = _React2_useState26[1];
|
|
7295
7301
|
var getResponsiveScale = function getResponsiveScale() {
|
|
7296
7302
|
if (viewportWidth < 480) return 0.7;
|
|
7297
7303
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -7966,7 +7972,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
7966
7972
|
}, restVideoAttrs), {
|
|
7967
7973
|
children: children
|
|
7968
7974
|
})),
|
|
7969
|
-
overlays.length > 0 && !adStatus.showAds && /* @__PURE__ */ jsx2(OverlayRenderer, {
|
|
7975
|
+
overlays.length > 0 && !adStatus.showAds && !overlaysDisabled && /* @__PURE__ */ jsx2(OverlayRenderer, {
|
|
7970
7976
|
overlays: overlays,
|
|
7971
7977
|
currentTime: currentTime,
|
|
7972
7978
|
videoRef: videoRef,
|
|
@@ -8778,7 +8784,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
8778
8784
|
gap: "".concat(8 * responsiveScale, "px")
|
|
8779
8785
|
},
|
|
8780
8786
|
children: [
|
|
8781
|
-
/* @__PURE__ */ jsx2("button", {
|
|
8787
|
+
(showAdsControl !== null && showAdsControl !== void 0 ? showAdsControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
8782
8788
|
className: "sc-ctrl-btn",
|
|
8783
8789
|
onClick: function onClick() {
|
|
8784
8790
|
var _playerRef_current;
|
|
@@ -8803,7 +8809,29 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
8803
8809
|
title: adsDisabled ? "Enable ads" : "Disable ads",
|
|
8804
8810
|
children: "AD"
|
|
8805
8811
|
}),
|
|
8806
|
-
swirlProjectId && /* @__PURE__ */ jsx2("button", {
|
|
8812
|
+
swirlProjectId && (showOverlaysControl !== null && showOverlaysControl !== void 0 ? showOverlaysControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
8813
|
+
className: "sc-ctrl-btn",
|
|
8814
|
+
onClick: function onClick() {
|
|
8815
|
+
setOverlaysDisabled(function(prev) {
|
|
8816
|
+
return !prev;
|
|
8817
|
+
});
|
|
8818
|
+
resetControlsTimer();
|
|
8819
|
+
},
|
|
8820
|
+
style: {
|
|
8821
|
+
padding: "".concat(8 * responsiveScale, "px"),
|
|
8822
|
+
borderRadius: "50%",
|
|
8823
|
+
minWidth: "".concat(36 * responsiveScale, "px"),
|
|
8824
|
+
minHeight: "".concat(36 * responsiveScale, "px"),
|
|
8825
|
+
background: overlaysDisabled ? "rgba(239, 68, 68, 0.28)" : "transparent",
|
|
8826
|
+
color: overlaysDisabled ? "rgba(252, 165, 165, 0.9)" : "rgba(255, 255, 255, 0.75)",
|
|
8827
|
+
opacity: overlaysDisabled ? 1 : 0.9
|
|
8828
|
+
},
|
|
8829
|
+
title: overlaysDisabled ? "Enable overlays" : "Disable overlays",
|
|
8830
|
+
children: /* @__PURE__ */ jsx2(FaLayerGroup, {
|
|
8831
|
+
size: Math.max(14, 18 * responsiveScale)
|
|
8832
|
+
})
|
|
8833
|
+
}),
|
|
8834
|
+
swirlProjectId && (showAiContextControl !== null && showAiContextControl !== void 0 ? showAiContextControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
8807
8835
|
className: "sc-ctrl-btn",
|
|
8808
8836
|
onClick: function onClick() {
|
|
8809
8837
|
setShowAiPanel(function(prev) {
|
|
@@ -8825,7 +8853,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
8825
8853
|
title: showAiPanel ? "Hide AI context" : "Show AI context",
|
|
8826
8854
|
children: "AI"
|
|
8827
8855
|
}),
|
|
8828
|
-
debugAdTiming && /* @__PURE__ */ jsx2("button", {
|
|
8856
|
+
debugAdTiming && (showDebugControl !== null && showDebugControl !== void 0 ? showDebugControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
8829
8857
|
className: "sc-ctrl-btn",
|
|
8830
8858
|
onClick: function onClick() {
|
|
8831
8859
|
setShowDebugPanel(function(prev) {
|
|
@@ -9096,7 +9124,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
9096
9124
|
})
|
|
9097
9125
|
]
|
|
9098
9126
|
}),
|
|
9099
|
-
/* @__PURE__ */ jsx2("button", {
|
|
9127
|
+
(showAdsControl !== null && showAdsControl !== void 0 ? showAdsControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
9100
9128
|
className: "sc-ctrl-btn",
|
|
9101
9129
|
onClick: function onClick() {
|
|
9102
9130
|
var _playerRef_current;
|
|
@@ -9121,7 +9149,28 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
9121
9149
|
title: adsDisabled ? "Enable ads" : "Disable ads",
|
|
9122
9150
|
children: "AD"
|
|
9123
9151
|
}),
|
|
9124
|
-
swirlProjectId && /* @__PURE__ */ jsx2("button", {
|
|
9152
|
+
swirlProjectId && (showOverlaysControl !== null && showOverlaysControl !== void 0 ? showOverlaysControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
9153
|
+
className: "sc-ctrl-btn",
|
|
9154
|
+
onClick: function onClick() {
|
|
9155
|
+
setOverlaysDisabled(function(prev) {
|
|
9156
|
+
return !prev;
|
|
9157
|
+
});
|
|
9158
|
+
resetControlsTimer();
|
|
9159
|
+
},
|
|
9160
|
+
style: {
|
|
9161
|
+
padding: "".concat(8 * responsiveScale, "px"),
|
|
9162
|
+
borderRadius: "50%",
|
|
9163
|
+
minWidth: "".concat(36 * responsiveScale, "px"),
|
|
9164
|
+
minHeight: "".concat(36 * responsiveScale, "px"),
|
|
9165
|
+
background: overlaysDisabled ? "rgba(239, 68, 68, 0.28)" : "rgba(0, 0, 0, 0.6)",
|
|
9166
|
+
color: overlaysDisabled ? "rgba(252, 165, 165, 0.9)" : "rgba(255, 255, 255, 0.75)"
|
|
9167
|
+
},
|
|
9168
|
+
title: overlaysDisabled ? "Enable overlays" : "Disable overlays",
|
|
9169
|
+
children: /* @__PURE__ */ jsx2(FaLayerGroup, {
|
|
9170
|
+
size: Math.max(14, 18 * responsiveScale)
|
|
9171
|
+
})
|
|
9172
|
+
}),
|
|
9173
|
+
swirlProjectId && (showAiContextControl !== null && showAiContextControl !== void 0 ? showAiContextControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
9125
9174
|
className: "sc-ctrl-btn",
|
|
9126
9175
|
onClick: function onClick() {
|
|
9127
9176
|
setShowAiPanel(function(prev) {
|
|
@@ -9143,7 +9192,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
9143
9192
|
title: showAiPanel ? "Hide AI context" : "Show AI context",
|
|
9144
9193
|
children: "AI"
|
|
9145
9194
|
}),
|
|
9146
|
-
debugAdTiming && /* @__PURE__ */ jsx2("button", {
|
|
9195
|
+
debugAdTiming && (showDebugControl !== null && showDebugControl !== void 0 ? showDebugControl : true) && /* @__PURE__ */ jsx2("button", {
|
|
9147
9196
|
className: "sc-ctrl-btn",
|
|
9148
9197
|
onClick: function onClick() {
|
|
9149
9198
|
setShowDebugPanel(function(prev) {
|
|
@@ -9245,7 +9294,12 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
9245
9294
|
"preload",
|
|
9246
9295
|
"poster",
|
|
9247
9296
|
"children",
|
|
9248
|
-
"swirlProjectId"
|
|
9297
|
+
"swirlProjectId",
|
|
9298
|
+
"disableOverlays",
|
|
9299
|
+
"showAdsControl",
|
|
9300
|
+
"showOverlaysControl",
|
|
9301
|
+
"showAiContextControl",
|
|
9302
|
+
"showDebugControl"
|
|
9249
9303
|
];
|
|
9250
9304
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
9251
9305
|
try {
|