stormcloud-video-player 0.1.12 → 0.1.13

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
@@ -1854,7 +1854,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
1854
1854
  });
1855
1855
  }
1856
1856
  };
1857
- const interval = setInterval(checkAdStatus, 500);
1857
+ const interval = setInterval(checkAdStatus, 100);
1858
1858
  return () => clearInterval(interval);
1859
1859
  }, []);
1860
1860
  (0, import_react.useEffect)(() => {
@@ -1932,7 +1932,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
1932
1932
  setShowCenterPlay(false);
1933
1933
  };
1934
1934
  const handlePause = () => {
1935
- setShowCenterPlay(true);
1935
+ if (playerRef.current && !playerRef.current.isShowingAds()) {
1936
+ setShowCenterPlay(true);
1937
+ } else {
1938
+ setShowCenterPlay(false);
1939
+ }
1936
1940
  };
1937
1941
  const handleEnded = () => {
1938
1942
  setShowCenterPlay(true);
@@ -2097,7 +2101,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
2097
2101
  )
2098
2102
  }
2099
2103
  ),
2100
- showCenterPlay && !isLoading && !isBuffering && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2104
+ showCenterPlay && !isLoading && !isBuffering && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2101
2105
  "div",
2102
2106
  {
2103
2107
  onClick: handleCenterPlayClick,
@@ -2148,29 +2152,6 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(
2148
2152
  )
2149
2153
  }
2150
2154
  ),
2151
- adStatus.showAds && adStatus.totalAds > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2152
- "div",
2153
- {
2154
- style: {
2155
- position: "absolute",
2156
- top: "10px",
2157
- right: "10px",
2158
- backgroundColor: "rgba(0, 0, 0, 0.7)",
2159
- color: "white",
2160
- padding: "4px 8px",
2161
- borderRadius: "4px",
2162
- fontSize: "12px",
2163
- fontFamily: "Arial, sans-serif",
2164
- zIndex: 10
2165
- },
2166
- children: [
2167
- "Ad ",
2168
- adStatus.currentIndex,
2169
- "/",
2170
- adStatus.totalAds
2171
- ]
2172
- }
2173
- ),
2174
2155
  shouldShowEnhancedControls ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2175
2156
  "div",
2176
2157
  {