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/lib/index.cjs CHANGED
@@ -7387,7 +7387,7 @@ var PANEL_BASE_RIGHT_OFFSET = 10;
7387
7387
  var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props) {
7388
7388
  var _ref;
7389
7389
  var _aiLiveContext_context;
7390
- 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, [
7390
+ 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, [
7391
7391
  "src",
7392
7392
  "autoplay",
7393
7393
  "muted",
@@ -7415,7 +7415,12 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
7415
7415
  "minSegmentsBeforePlay",
7416
7416
  "disableAds",
7417
7417
  "disableFiller",
7418
- "swirlProjectId"
7418
+ "swirlProjectId",
7419
+ "disableOverlays",
7420
+ "showAdsControl",
7421
+ "showOverlaysControl",
7422
+ "showAiContextControl",
7423
+ "showDebugControl"
7419
7424
  ]);
7420
7425
  var videoRef = (0, import_react2.useRef)(null);
7421
7426
  var playerRef = (0, import_react2.useRef)(null);
@@ -7452,12 +7457,13 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
7452
7457
  var _import_react2_default_useState22 = _sliced_to_array(import_react2.default.useState([]), 2), debugMarkers = _import_react2_default_useState22[0], setDebugMarkers = _import_react2_default_useState22[1];
7453
7458
  var _import_react2_default_useState23 = _sliced_to_array(import_react2.default.useState(false), 2), showAiPanel = _import_react2_default_useState23[0], setShowAiPanel = _import_react2_default_useState23[1];
7454
7459
  var _import_react2_default_useState24 = _sliced_to_array(import_react2.default.useState(disableAds !== null && disableAds !== void 0 ? disableAds : false), 2), adsDisabled = _import_react2_default_useState24[0], setAdsDisabled = _import_react2_default_useState24[1];
7455
- var _import_react2_default_useState25 = _sliced_to_array(import_react2.default.useState({
7460
+ var _import_react2_default_useState25 = _sliced_to_array(import_react2.default.useState(disableOverlays !== null && disableOverlays !== void 0 ? disableOverlays : false), 2), overlaysDisabled = _import_react2_default_useState25[0], setOverlaysDisabled = _import_react2_default_useState25[1];
7461
+ var _import_react2_default_useState26 = _sliced_to_array(import_react2.default.useState({
7456
7462
  context: null,
7457
7463
  isLoading: false,
7458
7464
  error: null,
7459
7465
  lastPolledAt: null
7460
- }), 2), aiLiveContext = _import_react2_default_useState25[0], setAiLiveContext = _import_react2_default_useState25[1];
7466
+ }), 2), aiLiveContext = _import_react2_default_useState26[0], setAiLiveContext = _import_react2_default_useState26[1];
7461
7467
  var getResponsiveScale = function getResponsiveScale() {
7462
7468
  if (viewportWidth < 480) return 0.7;
7463
7469
  if (viewportWidth < 768) return 0.8;
@@ -8132,7 +8138,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
8132
8138
  }, restVideoAttrs), {
8133
8139
  children: children
8134
8140
  })),
8135
- overlays.length > 0 && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
8141
+ overlays.length > 0 && !adStatus.showAds && !overlaysDisabled && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
8136
8142
  overlays: overlays,
8137
8143
  currentTime: currentTime,
8138
8144
  videoRef: videoRef,
@@ -8944,7 +8950,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
8944
8950
  gap: "".concat(8 * responsiveScale, "px")
8945
8951
  },
8946
8952
  children: [
8947
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8953
+ (showAdsControl !== null && showAdsControl !== void 0 ? showAdsControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8948
8954
  className: "sc-ctrl-btn",
8949
8955
  onClick: function onClick() {
8950
8956
  var _playerRef_current;
@@ -8969,7 +8975,29 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
8969
8975
  title: adsDisabled ? "Enable ads" : "Disable ads",
8970
8976
  children: "AD"
8971
8977
  }),
8972
- swirlProjectId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8978
+ swirlProjectId && (showOverlaysControl !== null && showOverlaysControl !== void 0 ? showOverlaysControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8979
+ className: "sc-ctrl-btn",
8980
+ onClick: function onClick() {
8981
+ setOverlaysDisabled(function(prev) {
8982
+ return !prev;
8983
+ });
8984
+ resetControlsTimer();
8985
+ },
8986
+ style: {
8987
+ padding: "".concat(8 * responsiveScale, "px"),
8988
+ borderRadius: "50%",
8989
+ minWidth: "".concat(36 * responsiveScale, "px"),
8990
+ minHeight: "".concat(36 * responsiveScale, "px"),
8991
+ background: overlaysDisabled ? "rgba(239, 68, 68, 0.28)" : "transparent",
8992
+ color: overlaysDisabled ? "rgba(252, 165, 165, 0.9)" : "rgba(255, 255, 255, 0.75)",
8993
+ opacity: overlaysDisabled ? 1 : 0.9
8994
+ },
8995
+ title: overlaysDisabled ? "Enable overlays" : "Disable overlays",
8996
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaLayerGroup, {
8997
+ size: Math.max(14, 18 * responsiveScale)
8998
+ })
8999
+ }),
9000
+ swirlProjectId && (showAiContextControl !== null && showAiContextControl !== void 0 ? showAiContextControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8973
9001
  className: "sc-ctrl-btn",
8974
9002
  onClick: function onClick() {
8975
9003
  setShowAiPanel(function(prev) {
@@ -8991,7 +9019,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
8991
9019
  title: showAiPanel ? "Hide AI context" : "Show AI context",
8992
9020
  children: "AI"
8993
9021
  }),
8994
- debugAdTiming && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9022
+ debugAdTiming && (showDebugControl !== null && showDebugControl !== void 0 ? showDebugControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
8995
9023
  className: "sc-ctrl-btn",
8996
9024
  onClick: function onClick() {
8997
9025
  setShowDebugPanel(function(prev) {
@@ -9262,7 +9290,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
9262
9290
  })
9263
9291
  ]
9264
9292
  }),
9265
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9293
+ (showAdsControl !== null && showAdsControl !== void 0 ? showAdsControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9266
9294
  className: "sc-ctrl-btn",
9267
9295
  onClick: function onClick() {
9268
9296
  var _playerRef_current;
@@ -9287,7 +9315,28 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
9287
9315
  title: adsDisabled ? "Enable ads" : "Disable ads",
9288
9316
  children: "AD"
9289
9317
  }),
9290
- swirlProjectId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9318
+ swirlProjectId && (showOverlaysControl !== null && showOverlaysControl !== void 0 ? showOverlaysControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9319
+ className: "sc-ctrl-btn",
9320
+ onClick: function onClick() {
9321
+ setOverlaysDisabled(function(prev) {
9322
+ return !prev;
9323
+ });
9324
+ resetControlsTimer();
9325
+ },
9326
+ style: {
9327
+ padding: "".concat(8 * responsiveScale, "px"),
9328
+ borderRadius: "50%",
9329
+ minWidth: "".concat(36 * responsiveScale, "px"),
9330
+ minHeight: "".concat(36 * responsiveScale, "px"),
9331
+ background: overlaysDisabled ? "rgba(239, 68, 68, 0.28)" : "rgba(0, 0, 0, 0.6)",
9332
+ color: overlaysDisabled ? "rgba(252, 165, 165, 0.9)" : "rgba(255, 255, 255, 0.75)"
9333
+ },
9334
+ title: overlaysDisabled ? "Enable overlays" : "Disable overlays",
9335
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaLayerGroup, {
9336
+ size: Math.max(14, 18 * responsiveScale)
9337
+ })
9338
+ }),
9339
+ swirlProjectId && (showAiContextControl !== null && showAiContextControl !== void 0 ? showAiContextControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9291
9340
  className: "sc-ctrl-btn",
9292
9341
  onClick: function onClick() {
9293
9342
  setShowAiPanel(function(prev) {
@@ -9309,7 +9358,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
9309
9358
  title: showAiPanel ? "Hide AI context" : "Show AI context",
9310
9359
  children: "AI"
9311
9360
  }),
9312
- debugAdTiming && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9361
+ debugAdTiming && (showDebugControl !== null && showDebugControl !== void 0 ? showDebugControl : true) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
9313
9362
  className: "sc-ctrl-btn",
9314
9363
  onClick: function onClick() {
9315
9364
  setShowDebugPanel(function(prev) {
@@ -9411,7 +9460,12 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
9411
9460
  "preload",
9412
9461
  "poster",
9413
9462
  "children",
9414
- "swirlProjectId"
9463
+ "swirlProjectId",
9464
+ "disableOverlays",
9465
+ "showAdsControl",
9466
+ "showOverlaysControl",
9467
+ "showAiContextControl",
9468
+ "showDebugControl"
9415
9469
  ];
9416
9470
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
9417
9471
  try {