stormcloud-video-player 0.6.5 → 0.7.0
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 +570 -119
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +64 -1
- package/lib/index.d.ts +64 -1
- package/lib/index.js +536 -101
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +66 -1
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +4 -0
- package/lib/players/HlsPlayer.cjs +66 -1
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +66 -1
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/vastAdLayer.cjs +26 -1
- package/lib/sdk/vastAdLayer.cjs.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +392 -0
- package/lib/ui/OverlayRenderer.cjs.map +1 -0
- package/lib/ui/OverlayRenderer.d.cts +15 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +530 -95
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/utils/overlays.cjs +286 -0
- package/lib/utils/overlays.cjs.map +1 -0
- package/lib/utils/overlays.d.cts +59 -0
- package/package.json +1 -1
|
@@ -383,7 +383,7 @@ __export(StormcloudVideoPlayer_exports, {
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
module.exports = __toCommonJS(StormcloudVideoPlayer_exports);
|
|
386
|
-
var
|
|
386
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
387
387
|
// src/player/StormcloudVideoPlayer.ts
|
|
388
388
|
var import_hls2 = __toESM(require("hls.js"), 1);
|
|
389
389
|
// src/sdk/vastParser.ts
|
|
@@ -980,6 +980,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
980
980
|
var tornDown = false;
|
|
981
981
|
var trackingFired = createEmptyTrackingState();
|
|
982
982
|
var adStallTimerId;
|
|
983
|
+
var savedContentVideoStyles;
|
|
983
984
|
var currentAdEventHandlers;
|
|
984
985
|
var preloadSlots = /* @__PURE__ */ new Map();
|
|
985
986
|
function emit(event, payload) {
|
|
@@ -1096,7 +1097,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1096
1097
|
video.style.top = "0";
|
|
1097
1098
|
video.style.width = "100%";
|
|
1098
1099
|
video.style.height = "100%";
|
|
1099
|
-
video.style.objectFit = "
|
|
1100
|
+
video.style.objectFit = "cover";
|
|
1100
1101
|
video.style.backgroundColor = "#000";
|
|
1101
1102
|
video.playsInline = true;
|
|
1102
1103
|
video.muted = false;
|
|
@@ -1211,12 +1212,31 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1211
1212
|
delete contentVideo.dataset.stormcloudAdPlaying;
|
|
1212
1213
|
}
|
|
1213
1214
|
}
|
|
1215
|
+
function applyContentVideoAdCoverStyles() {
|
|
1216
|
+
if (!singleElementMode) return;
|
|
1217
|
+
savedContentVideoStyles = {
|
|
1218
|
+
objectFit: contentVideo.style.objectFit,
|
|
1219
|
+
width: contentVideo.style.width,
|
|
1220
|
+
height: contentVideo.style.height
|
|
1221
|
+
};
|
|
1222
|
+
contentVideo.style.objectFit = "cover";
|
|
1223
|
+
contentVideo.style.width = "100%";
|
|
1224
|
+
contentVideo.style.height = "100%";
|
|
1225
|
+
}
|
|
1226
|
+
function restoreContentVideoStyles() {
|
|
1227
|
+
if (!singleElementMode || !savedContentVideoStyles) return;
|
|
1228
|
+
contentVideo.style.objectFit = savedContentVideoStyles.objectFit;
|
|
1229
|
+
contentVideo.style.width = savedContentVideoStyles.width;
|
|
1230
|
+
contentVideo.style.height = savedContentVideoStyles.height;
|
|
1231
|
+
savedContentVideoStyles = void 0;
|
|
1232
|
+
}
|
|
1214
1233
|
function handleAdComplete() {
|
|
1215
1234
|
if (tornDown) return;
|
|
1216
1235
|
clearAdStallTimer();
|
|
1217
1236
|
if (debug) console.log("".concat(LOG, " Handling ad completion"));
|
|
1218
1237
|
adPlaying = false;
|
|
1219
1238
|
setAdPlayingFlag(false);
|
|
1239
|
+
restoreContentVideoStyles();
|
|
1220
1240
|
if (adContainerEl) {
|
|
1221
1241
|
adContainerEl.style.display = "none";
|
|
1222
1242
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1231,6 +1251,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1231
1251
|
if (debug) console.log("".concat(LOG, " Handling ad error"));
|
|
1232
1252
|
adPlaying = false;
|
|
1233
1253
|
setAdPlayingFlag(false);
|
|
1254
|
+
restoreContentVideoStyles();
|
|
1234
1255
|
if (adContainerEl) {
|
|
1235
1256
|
adContainerEl.style.display = "none";
|
|
1236
1257
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1401,6 +1422,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1401
1422
|
];
|
|
1402
1423
|
contentVideo.style.visibility = "visible";
|
|
1403
1424
|
contentVideo.style.opacity = "1";
|
|
1425
|
+
applyContentVideoAdCoverStyles();
|
|
1404
1426
|
emit("content_pause");
|
|
1405
1427
|
setupAdEventListeners();
|
|
1406
1428
|
adVolume2 = originalMutedState ? 1 : originalVolume;
|
|
@@ -1639,6 +1661,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1639
1661
|
];
|
|
1640
1662
|
contentVideo.style.visibility = "visible";
|
|
1641
1663
|
contentVideo.style.opacity = "1";
|
|
1664
|
+
applyContentVideoAdCoverStyles();
|
|
1642
1665
|
emit("content_pause");
|
|
1643
1666
|
setupAdEventListeners();
|
|
1644
1667
|
adVolume2 = originalMutedState ? 1 : originalVolume;
|
|
@@ -1789,6 +1812,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1789
1812
|
if (debug) console.log("".concat(LOG, " Stopping ad"));
|
|
1790
1813
|
adPlaying = false;
|
|
1791
1814
|
setAdPlayingFlag(false);
|
|
1815
|
+
restoreContentVideoStyles();
|
|
1792
1816
|
contentVideo.muted = originalMutedState;
|
|
1793
1817
|
contentVideo.volume = originalMutedState ? 0 : originalVolume;
|
|
1794
1818
|
contentVideo.style.visibility = "visible";
|
|
@@ -1827,6 +1851,7 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1827
1851
|
destroyed = true;
|
|
1828
1852
|
adPlaying = false;
|
|
1829
1853
|
setAdPlayingFlag(false);
|
|
1854
|
+
restoreContentVideoStyles();
|
|
1830
1855
|
contentVideo.muted = originalMutedState;
|
|
1831
1856
|
contentVideo.volume = originalVolume;
|
|
1832
1857
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
@@ -5995,6 +6020,46 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5995
6020
|
return this.isLiveStream;
|
|
5996
6021
|
}
|
|
5997
6022
|
},
|
|
6023
|
+
{
|
|
6024
|
+
key: "getMinHlsResolution",
|
|
6025
|
+
value: function getMinHlsResolution() {
|
|
6026
|
+
var _this_hls;
|
|
6027
|
+
var levels = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : _this_hls.levels;
|
|
6028
|
+
if (!levels || levels.length === 0) return null;
|
|
6029
|
+
var min = null;
|
|
6030
|
+
var minPixels = Infinity;
|
|
6031
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6032
|
+
try {
|
|
6033
|
+
for(var _iterator = levels[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6034
|
+
var level = _step.value;
|
|
6035
|
+
if (level.width && level.height) {
|
|
6036
|
+
var pixels = level.width * level.height;
|
|
6037
|
+
if (pixels < minPixels) {
|
|
6038
|
+
minPixels = pixels;
|
|
6039
|
+
min = {
|
|
6040
|
+
width: level.width,
|
|
6041
|
+
height: level.height
|
|
6042
|
+
};
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
} catch (err) {
|
|
6047
|
+
_didIteratorError = true;
|
|
6048
|
+
_iteratorError = err;
|
|
6049
|
+
} finally{
|
|
6050
|
+
try {
|
|
6051
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6052
|
+
_iterator.return();
|
|
6053
|
+
}
|
|
6054
|
+
} finally{
|
|
6055
|
+
if (_didIteratorError) {
|
|
6056
|
+
throw _iteratorError;
|
|
6057
|
+
}
|
|
6058
|
+
}
|
|
6059
|
+
}
|
|
6060
|
+
return min;
|
|
6061
|
+
}
|
|
6062
|
+
},
|
|
5998
6063
|
{
|
|
5999
6064
|
key: "videoElement",
|
|
6000
6065
|
get: function get() {
|
|
@@ -6057,7 +6122,322 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6057
6122
|
}();
|
|
6058
6123
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
6059
6124
|
var import_fa = require("react-icons/fa");
|
|
6125
|
+
// src/ui/OverlayRenderer.tsx
|
|
6126
|
+
var import_react = require("react");
|
|
6127
|
+
// src/utils/overlays.ts
|
|
6128
|
+
var OVERLAY_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
6129
|
+
function timeStringToSeconds(timeStr) {
|
|
6130
|
+
if (!timeStr) return 0;
|
|
6131
|
+
var parts = timeStr.split(":");
|
|
6132
|
+
if (parts.length >= 3) {
|
|
6133
|
+
var _parts_, _parts_1, _parts_2;
|
|
6134
|
+
var hours = parseInt((_parts_ = parts[0]) !== null && _parts_ !== void 0 ? _parts_ : "0", 10) || 0;
|
|
6135
|
+
var minutes = parseInt((_parts_1 = parts[1]) !== null && _parts_1 !== void 0 ? _parts_1 : "0", 10) || 0;
|
|
6136
|
+
var secStr = (_parts_2 = parts[2]) !== null && _parts_2 !== void 0 ? _parts_2 : "0";
|
|
6137
|
+
var dotIdx = secStr.indexOf(".");
|
|
6138
|
+
var seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;
|
|
6139
|
+
var msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : "";
|
|
6140
|
+
var ms = msFrag ? parseInt(msFrag.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
6141
|
+
return hours * 3600 + minutes * 60 + seconds + ms / 1e3;
|
|
6142
|
+
}
|
|
6143
|
+
if (parts.length === 2) {
|
|
6144
|
+
var _parts_3, _parts_4;
|
|
6145
|
+
var minutes1 = parseInt((_parts_3 = parts[0]) !== null && _parts_3 !== void 0 ? _parts_3 : "0", 10) || 0;
|
|
6146
|
+
var secStr1 = (_parts_4 = parts[1]) !== null && _parts_4 !== void 0 ? _parts_4 : "0";
|
|
6147
|
+
var dotIdx1 = secStr1.indexOf(".");
|
|
6148
|
+
var seconds1 = parseInt(dotIdx1 >= 0 ? secStr1.substring(0, dotIdx1) : secStr1, 10) || 0;
|
|
6149
|
+
var msFrag1 = dotIdx1 >= 0 ? secStr1.substring(dotIdx1 + 1) : "";
|
|
6150
|
+
var ms1 = msFrag1 ? parseInt(msFrag1.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
6151
|
+
return minutes1 * 60 + seconds1 + ms1 / 1e3;
|
|
6152
|
+
}
|
|
6153
|
+
var num = parseFloat(timeStr);
|
|
6154
|
+
return isFinite(num) ? Math.max(0, num) : 0;
|
|
6155
|
+
}
|
|
6156
|
+
function isOverlayActive(overlay, currentTime) {
|
|
6157
|
+
if (!overlay.visible) return false;
|
|
6158
|
+
var startSec = timeStringToSeconds(overlay.start_time);
|
|
6159
|
+
var durationSec = timeStringToSeconds(overlay.duration);
|
|
6160
|
+
if (durationSec <= 0) return false;
|
|
6161
|
+
return currentTime >= startSec && currentTime < startSec + durationSec;
|
|
6162
|
+
}
|
|
6163
|
+
function fetchProjectOverlays(_0) {
|
|
6164
|
+
return _async_to_generator(function(projectId) {
|
|
6165
|
+
var apiBaseUrl, response, data;
|
|
6166
|
+
var _arguments = arguments;
|
|
6167
|
+
return _ts_generator(this, function(_state) {
|
|
6168
|
+
switch(_state.label){
|
|
6169
|
+
case 0:
|
|
6170
|
+
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : OVERLAY_API_BASE;
|
|
6171
|
+
return [
|
|
6172
|
+
4,
|
|
6173
|
+
fetch("".concat(apiBaseUrl, "/adstorm/swirl/projects/").concat(projectId, "/overlays"))
|
|
6174
|
+
];
|
|
6175
|
+
case 1:
|
|
6176
|
+
response = _state.sent();
|
|
6177
|
+
if (!response.ok) {
|
|
6178
|
+
throw new Error("Failed to fetch overlays: ".concat(response.status, " ").concat(response.statusText));
|
|
6179
|
+
}
|
|
6180
|
+
return [
|
|
6181
|
+
4,
|
|
6182
|
+
response.json()
|
|
6183
|
+
];
|
|
6184
|
+
case 2:
|
|
6185
|
+
data = _state.sent();
|
|
6186
|
+
return [
|
|
6187
|
+
2,
|
|
6188
|
+
Array.isArray(data) ? data : []
|
|
6189
|
+
];
|
|
6190
|
+
}
|
|
6191
|
+
});
|
|
6192
|
+
}).apply(this, arguments);
|
|
6193
|
+
}
|
|
6194
|
+
function resolveImageUrl(imageUrl) {
|
|
6195
|
+
var apiBaseUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : OVERLAY_API_BASE;
|
|
6196
|
+
if (!imageUrl) return "";
|
|
6197
|
+
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
6198
|
+
return imageUrl;
|
|
6199
|
+
}
|
|
6200
|
+
if (imageUrl.startsWith("/")) {
|
|
6201
|
+
try {
|
|
6202
|
+
var url = new URL(apiBaseUrl);
|
|
6203
|
+
return "".concat(url.origin).concat(imageUrl);
|
|
6204
|
+
} catch (unused) {
|
|
6205
|
+
return imageUrl;
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
return "".concat(apiBaseUrl, "/").concat(imageUrl);
|
|
6209
|
+
}
|
|
6210
|
+
// src/ui/OverlayRenderer.tsx
|
|
6060
6211
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
6212
|
+
function computeVideoDimensions(video) {
|
|
6213
|
+
var nativeWidth = video.videoWidth;
|
|
6214
|
+
var nativeHeight = video.videoHeight;
|
|
6215
|
+
if (!nativeWidth || !nativeHeight) return null;
|
|
6216
|
+
var displayWidth = video.offsetWidth;
|
|
6217
|
+
var displayHeight = video.offsetHeight;
|
|
6218
|
+
if (!displayWidth || !displayHeight) return null;
|
|
6219
|
+
var videoAspect = nativeWidth / nativeHeight;
|
|
6220
|
+
var displayAspect = displayWidth / displayHeight;
|
|
6221
|
+
var renderWidth;
|
|
6222
|
+
var renderHeight;
|
|
6223
|
+
var offsetX;
|
|
6224
|
+
var offsetY;
|
|
6225
|
+
if (videoAspect > displayAspect) {
|
|
6226
|
+
renderWidth = displayWidth;
|
|
6227
|
+
renderHeight = displayWidth / videoAspect;
|
|
6228
|
+
offsetX = 0;
|
|
6229
|
+
offsetY = (displayHeight - renderHeight) / 2;
|
|
6230
|
+
} else {
|
|
6231
|
+
renderHeight = displayHeight;
|
|
6232
|
+
renderWidth = displayHeight * videoAspect;
|
|
6233
|
+
offsetX = (displayWidth - renderWidth) / 2;
|
|
6234
|
+
offsetY = 0;
|
|
6235
|
+
}
|
|
6236
|
+
return {
|
|
6237
|
+
nativeWidth: nativeWidth,
|
|
6238
|
+
nativeHeight: nativeHeight,
|
|
6239
|
+
displayWidth: renderWidth,
|
|
6240
|
+
displayHeight: renderHeight,
|
|
6241
|
+
offsetX: offsetX,
|
|
6242
|
+
offsetY: offsetY,
|
|
6243
|
+
scaleX: renderWidth / nativeWidth,
|
|
6244
|
+
scaleY: renderHeight / nativeHeight
|
|
6245
|
+
};
|
|
6246
|
+
}
|
|
6247
|
+
function ImageOverlay(param) {
|
|
6248
|
+
var overlay = param.overlay;
|
|
6249
|
+
var src = resolveImageUrl(overlay.image_url || "");
|
|
6250
|
+
if (!src) return null;
|
|
6251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6252
|
+
src: src,
|
|
6253
|
+
alt: overlay.name,
|
|
6254
|
+
draggable: false,
|
|
6255
|
+
style: {
|
|
6256
|
+
width: "100%",
|
|
6257
|
+
height: "100%",
|
|
6258
|
+
objectFit: "contain",
|
|
6259
|
+
display: "block",
|
|
6260
|
+
pointerEvents: "none",
|
|
6261
|
+
userSelect: "none"
|
|
6262
|
+
}
|
|
6263
|
+
});
|
|
6264
|
+
}
|
|
6265
|
+
function TextOverlay(param) {
|
|
6266
|
+
var overlay = param.overlay;
|
|
6267
|
+
var text = overlay.content || "";
|
|
6268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6269
|
+
style: {
|
|
6270
|
+
width: "100%",
|
|
6271
|
+
height: "100%",
|
|
6272
|
+
display: "flex",
|
|
6273
|
+
alignItems: "center",
|
|
6274
|
+
justifyContent: "center",
|
|
6275
|
+
color: "#ffffff",
|
|
6276
|
+
fontSize: "clamp(10px, 1.4vw, 20px)",
|
|
6277
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
6278
|
+
fontWeight: 600,
|
|
6279
|
+
textAlign: "center",
|
|
6280
|
+
padding: "4px 8px",
|
|
6281
|
+
boxSizing: "border-box",
|
|
6282
|
+
wordBreak: "break-word",
|
|
6283
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.7)",
|
|
6284
|
+
pointerEvents: "none",
|
|
6285
|
+
userSelect: "none",
|
|
6286
|
+
lineHeight: 1.3
|
|
6287
|
+
},
|
|
6288
|
+
children: text
|
|
6289
|
+
});
|
|
6290
|
+
}
|
|
6291
|
+
function ScrollerOverlay(param) {
|
|
6292
|
+
var overlay = param.overlay;
|
|
6293
|
+
var _ref, _ref1, _ref2, _ref3, _ref4;
|
|
6294
|
+
var cfg = overlay.scroller_config;
|
|
6295
|
+
var text = (cfg === null || cfg === void 0 ? void 0 : cfg.use_custom_text) && cfg.custom_text ? cfg.custom_text : overlay.content || (cfg === null || cfg === void 0 ? void 0 : cfg.custom_text) || "";
|
|
6296
|
+
var scrollSpeed = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.scroll_speed) !== null && _ref !== void 0 ? _ref : 50;
|
|
6297
|
+
var direction = (_ref1 = cfg === null || cfg === void 0 ? void 0 : cfg.direction) !== null && _ref1 !== void 0 ? _ref1 : "left";
|
|
6298
|
+
var fontSize = (cfg === null || cfg === void 0 ? void 0 : cfg.font_size) ? "".concat(cfg.font_size, "px") : "clamp(10px, 1.2vw, 18px)";
|
|
6299
|
+
var fontFamily = (cfg === null || cfg === void 0 ? void 0 : cfg.font_family) || "Roboto, 'Segoe UI', Arial, sans-serif";
|
|
6300
|
+
var fontWeight = (cfg === null || cfg === void 0 ? void 0 : cfg.font_weight) || "600";
|
|
6301
|
+
var textColor = (cfg === null || cfg === void 0 ? void 0 : cfg.text_color) || "#ffffff";
|
|
6302
|
+
var bgColor = (cfg === null || cfg === void 0 ? void 0 : cfg.background_color) || "transparent";
|
|
6303
|
+
var bgOpacity = (cfg === null || cfg === void 0 ? void 0 : cfg.background_opacity) !== void 0 ? cfg.background_opacity / 100 : 0;
|
|
6304
|
+
var borderColor = (cfg === null || cfg === void 0 ? void 0 : cfg.border_color) || "transparent";
|
|
6305
|
+
var borderWidth = (_ref2 = cfg === null || cfg === void 0 ? void 0 : cfg.border_width) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
6306
|
+
var borderRadius = (_ref3 = cfg === null || cfg === void 0 ? void 0 : cfg.border_radius) !== null && _ref3 !== void 0 ? _ref3 : 0;
|
|
6307
|
+
var padding = (_ref4 = cfg === null || cfg === void 0 ? void 0 : cfg.padding) !== null && _ref4 !== void 0 ? _ref4 : 4;
|
|
6308
|
+
var isVertical = direction === "up" || direction === "down";
|
|
6309
|
+
var isReverse = direction === "right" || direction === "down";
|
|
6310
|
+
var durationSec = Math.max(3, 120 - scrollSpeed);
|
|
6311
|
+
var animId = "sc-scroller-".concat(overlay.id);
|
|
6312
|
+
var keyframes = isVertical ? "@keyframes ".concat(animId, " {\n 0% { transform: translateY(").concat(isReverse ? "-100%" : "100%", "); }\n 100% { transform: translateY(").concat(isReverse ? "100%" : "-100%", "); }\n }") : "@keyframes ".concat(animId, " {\n 0% { transform: translateX(").concat(isReverse ? "-100%" : "100%", "); }\n 100% { transform: translateX(").concat(isReverse ? "100%" : "-100%", "); }\n }");
|
|
6313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
6314
|
+
children: [
|
|
6315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
6316
|
+
children: keyframes
|
|
6317
|
+
}),
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6319
|
+
style: {
|
|
6320
|
+
width: "100%",
|
|
6321
|
+
height: "100%",
|
|
6322
|
+
overflow: "hidden",
|
|
6323
|
+
display: "flex",
|
|
6324
|
+
alignItems: "center",
|
|
6325
|
+
backgroundColor: bgOpacity > 0 ? "rgba(".concat(hexToRgb(bgColor), ", ").concat(bgOpacity, ")") : void 0,
|
|
6326
|
+
border: borderWidth > 0 ? "".concat(borderWidth, "px solid ").concat(borderColor) : void 0,
|
|
6327
|
+
borderRadius: borderRadius > 0 ? "".concat(borderRadius, "px") : void 0,
|
|
6328
|
+
padding: "".concat(padding, "px"),
|
|
6329
|
+
boxSizing: "border-box",
|
|
6330
|
+
pointerEvents: "none"
|
|
6331
|
+
},
|
|
6332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6333
|
+
style: {
|
|
6334
|
+
whiteSpace: "nowrap",
|
|
6335
|
+
fontSize: fontSize,
|
|
6336
|
+
fontFamily: fontFamily,
|
|
6337
|
+
fontWeight: fontWeight,
|
|
6338
|
+
color: textColor,
|
|
6339
|
+
animation: "".concat(animId, " ").concat(durationSec, "s linear infinite"),
|
|
6340
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.5)",
|
|
6341
|
+
userSelect: "none"
|
|
6342
|
+
},
|
|
6343
|
+
children: text
|
|
6344
|
+
})
|
|
6345
|
+
})
|
|
6346
|
+
]
|
|
6347
|
+
});
|
|
6348
|
+
}
|
|
6349
|
+
function hexToRgb(hex) {
|
|
6350
|
+
if (!hex || !hex.startsWith("#")) return "0,0,0";
|
|
6351
|
+
var clean = hex.slice(1);
|
|
6352
|
+
var num = parseInt(clean.length === 3 ? clean.replace(/./g, "$&$&") : clean, 16);
|
|
6353
|
+
return "".concat(num >> 16 & 255, ",").concat(num >> 8 & 255, ",").concat(num & 255);
|
|
6354
|
+
}
|
|
6355
|
+
var OverlayRenderer = function OverlayRenderer(param) {
|
|
6356
|
+
var overlays = param.overlays, currentTime = param.currentTime, videoRef = param.videoRef, coordinateSpace = param.coordinateSpace;
|
|
6357
|
+
var _ref = _sliced_to_array((0, import_react.useState)(null), 2), dims = _ref[0], setDims = _ref[1];
|
|
6358
|
+
var rafRef = (0, import_react.useRef)(null);
|
|
6359
|
+
var updateDims = (0, import_react.useCallback)(function() {
|
|
6360
|
+
var video = videoRef.current;
|
|
6361
|
+
if (video) {
|
|
6362
|
+
var computed = computeVideoDimensions(video);
|
|
6363
|
+
setDims(function(prev) {
|
|
6364
|
+
if (!computed || prev && prev.nativeWidth === computed.nativeWidth && prev.nativeHeight === computed.nativeHeight && prev.displayWidth === computed.displayWidth && prev.displayHeight === computed.displayHeight && prev.offsetX === computed.offsetX && prev.offsetY === computed.offsetY) {
|
|
6365
|
+
return prev;
|
|
6366
|
+
}
|
|
6367
|
+
return computed;
|
|
6368
|
+
});
|
|
6369
|
+
}
|
|
6370
|
+
}, [
|
|
6371
|
+
videoRef
|
|
6372
|
+
]);
|
|
6373
|
+
(0, import_react.useEffect)(function() {
|
|
6374
|
+
updateDims();
|
|
6375
|
+
var interval = setInterval(updateDims, 500);
|
|
6376
|
+
var handleResize = function handleResize() {
|
|
6377
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
6378
|
+
rafRef.current = requestAnimationFrame(updateDims);
|
|
6379
|
+
};
|
|
6380
|
+
window.addEventListener("resize", handleResize);
|
|
6381
|
+
return function() {
|
|
6382
|
+
clearInterval(interval);
|
|
6383
|
+
window.removeEventListener("resize", handleResize);
|
|
6384
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
6385
|
+
};
|
|
6386
|
+
}, [
|
|
6387
|
+
updateDims
|
|
6388
|
+
]);
|
|
6389
|
+
var activeOverlays = overlays.filter(function(o) {
|
|
6390
|
+
return isOverlayActive(o, currentTime);
|
|
6391
|
+
});
|
|
6392
|
+
if (!dims || activeOverlays.length === 0) return null;
|
|
6393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6394
|
+
"aria-hidden": "true",
|
|
6395
|
+
style: {
|
|
6396
|
+
position: "absolute",
|
|
6397
|
+
left: "".concat(dims.offsetX, "px"),
|
|
6398
|
+
top: "".concat(dims.offsetY, "px"),
|
|
6399
|
+
width: "".concat(dims.displayWidth, "px"),
|
|
6400
|
+
height: "".concat(dims.displayHeight, "px"),
|
|
6401
|
+
pointerEvents: "none",
|
|
6402
|
+
overflow: "hidden",
|
|
6403
|
+
zIndex: 8
|
|
6404
|
+
},
|
|
6405
|
+
children: activeOverlays.map(function(overlay) {
|
|
6406
|
+
var scaleX = (coordinateSpace === null || coordinateSpace === void 0 ? void 0 : coordinateSpace.width) ? dims.displayWidth / coordinateSpace.width : dims.scaleX;
|
|
6407
|
+
var scaleY = (coordinateSpace === null || coordinateSpace === void 0 ? void 0 : coordinateSpace.height) ? dims.displayHeight / coordinateSpace.height : dims.scaleY;
|
|
6408
|
+
var left = overlay.x * scaleX;
|
|
6409
|
+
var top = overlay.y * scaleY;
|
|
6410
|
+
var width = overlay.width * scaleX;
|
|
6411
|
+
var height = overlay.height * scaleY;
|
|
6412
|
+
var opacity = Math.max(0, Math.min(100, overlay.opacity)) / 100;
|
|
6413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6414
|
+
style: {
|
|
6415
|
+
position: "absolute",
|
|
6416
|
+
left: "".concat(left, "px"),
|
|
6417
|
+
top: "".concat(top, "px"),
|
|
6418
|
+
width: "".concat(width, "px"),
|
|
6419
|
+
height: "".concat(height, "px"),
|
|
6420
|
+
opacity: opacity,
|
|
6421
|
+
zIndex: overlay.z_index,
|
|
6422
|
+
overflow: "hidden"
|
|
6423
|
+
},
|
|
6424
|
+
children: [
|
|
6425
|
+
overlay.type === "image" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageOverlay, {
|
|
6426
|
+
overlay: overlay
|
|
6427
|
+
}),
|
|
6428
|
+
overlay.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextOverlay, {
|
|
6429
|
+
overlay: overlay
|
|
6430
|
+
}),
|
|
6431
|
+
overlay.type === "scroller" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollerOverlay, {
|
|
6432
|
+
overlay: overlay
|
|
6433
|
+
})
|
|
6434
|
+
]
|
|
6435
|
+
}, overlay.id);
|
|
6436
|
+
})
|
|
6437
|
+
});
|
|
6438
|
+
};
|
|
6439
|
+
// src/ui/StormcloudVideoPlayer.tsx
|
|
6440
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
6061
6441
|
var CRITICAL_PROPS = [
|
|
6062
6442
|
"src",
|
|
6063
6443
|
"allowNativeHls",
|
|
@@ -6066,8 +6446,8 @@ var CRITICAL_PROPS = [
|
|
|
6066
6446
|
"driftToleranceMs"
|
|
6067
6447
|
];
|
|
6068
6448
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
6069
|
-
var StormcloudVideoPlayerComponent =
|
|
6070
|
-
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, restVideoAttrs = _object_without_properties(props, [
|
|
6449
|
+
var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props) {
|
|
6450
|
+
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, [
|
|
6071
6451
|
"src",
|
|
6072
6452
|
"autoplay",
|
|
6073
6453
|
"muted",
|
|
@@ -6094,35 +6474,38 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6094
6474
|
"licenseKey",
|
|
6095
6475
|
"minSegmentsBeforePlay",
|
|
6096
6476
|
"disableAds",
|
|
6097
|
-
"disableFiller"
|
|
6477
|
+
"disableFiller",
|
|
6478
|
+
"swirlProjectId"
|
|
6098
6479
|
]);
|
|
6099
|
-
var videoRef = (0,
|
|
6100
|
-
var playerRef = (0,
|
|
6101
|
-
var bufferingTimeoutRef = (0,
|
|
6102
|
-
var controlsTimerRef = (0,
|
|
6103
|
-
var wrapperRef = (0,
|
|
6104
|
-
var
|
|
6480
|
+
var videoRef = (0, import_react2.useRef)(null);
|
|
6481
|
+
var playerRef = (0, import_react2.useRef)(null);
|
|
6482
|
+
var bufferingTimeoutRef = (0, import_react2.useRef)(null);
|
|
6483
|
+
var controlsTimerRef = (0, import_react2.useRef)(null);
|
|
6484
|
+
var wrapperRef = (0, import_react2.useRef)(null);
|
|
6485
|
+
var _import_react2_default_useState = _sliced_to_array(import_react2.default.useState({
|
|
6105
6486
|
showAds: false,
|
|
6106
6487
|
currentIndex: 0,
|
|
6107
6488
|
totalAds: 0
|
|
6108
|
-
}), 2), adStatus =
|
|
6109
|
-
var
|
|
6110
|
-
var
|
|
6111
|
-
var
|
|
6112
|
-
var
|
|
6113
|
-
var
|
|
6114
|
-
var
|
|
6115
|
-
var
|
|
6116
|
-
var
|
|
6117
|
-
var
|
|
6118
|
-
var
|
|
6119
|
-
var
|
|
6120
|
-
var
|
|
6121
|
-
var
|
|
6122
|
-
var
|
|
6123
|
-
var
|
|
6124
|
-
var
|
|
6125
|
-
var
|
|
6489
|
+
}), 2), adStatus = _import_react2_default_useState[0], setAdStatus = _import_react2_default_useState[1];
|
|
6490
|
+
var _import_react2_default_useState1 = _sliced_to_array(import_react2.default.useState(true), 2), shouldShowNativeControls = _import_react2_default_useState1[0], setShouldShowNativeControls = _import_react2_default_useState1[1];
|
|
6491
|
+
var _import_react2_default_useState2 = _sliced_to_array(import_react2.default.useState(false), 2), isMuted = _import_react2_default_useState2[0], setIsMuted = _import_react2_default_useState2[1];
|
|
6492
|
+
var _import_react2_default_useState3 = _sliced_to_array(import_react2.default.useState(false), 2), isFullscreen = _import_react2_default_useState3[0], setIsFullscreen = _import_react2_default_useState3[1];
|
|
6493
|
+
var _import_react2_default_useState4 = _sliced_to_array(import_react2.default.useState(false), 2), isPlaying = _import_react2_default_useState4[0], setIsPlaying = _import_react2_default_useState4[1];
|
|
6494
|
+
var _import_react2_default_useState5 = _sliced_to_array(import_react2.default.useState(0), 2), currentTime = _import_react2_default_useState5[0], setCurrentTime = _import_react2_default_useState5[1];
|
|
6495
|
+
var _import_react2_default_useState6 = _sliced_to_array(import_react2.default.useState(0), 2), duration = _import_react2_default_useState6[0], setDuration = _import_react2_default_useState6[1];
|
|
6496
|
+
var _import_react2_default_useState7 = _sliced_to_array(import_react2.default.useState(1), 2), volume = _import_react2_default_useState7[0], setVolume = _import_react2_default_useState7[1];
|
|
6497
|
+
var _import_react2_default_useState8 = _sliced_to_array(import_react2.default.useState(1), 2), playbackRate = _import_react2_default_useState8[0], setPlaybackRate = _import_react2_default_useState8[1];
|
|
6498
|
+
var _import_react2_default_useState9 = _sliced_to_array(import_react2.default.useState(false), 2), showVolumeSlider = _import_react2_default_useState9[0], setShowVolumeSlider = _import_react2_default_useState9[1];
|
|
6499
|
+
var _import_react2_default_useState10 = _sliced_to_array(import_react2.default.useState(false), 2), showSpeedMenu = _import_react2_default_useState10[0], setShowSpeedMenu = _import_react2_default_useState10[1];
|
|
6500
|
+
var _import_react2_default_useState11 = _sliced_to_array(import_react2.default.useState(true), 2), isLoading = _import_react2_default_useState11[0], setIsLoading = _import_react2_default_useState11[1];
|
|
6501
|
+
var _import_react2_default_useState12 = _sliced_to_array(import_react2.default.useState(false), 2), isBuffering = _import_react2_default_useState12[0], setIsBuffering = _import_react2_default_useState12[1];
|
|
6502
|
+
var _import_react2_default_useState13 = _sliced_to_array(import_react2.default.useState(false), 2), showCenterPlay = _import_react2_default_useState13[0], setShowCenterPlay = _import_react2_default_useState13[1];
|
|
6503
|
+
var _import_react2_default_useState14 = _sliced_to_array(import_react2.default.useState(false), 2), showLicenseWarning = _import_react2_default_useState14[0], setShowLicenseWarning = _import_react2_default_useState14[1];
|
|
6504
|
+
var _import_react2_default_useState15 = _sliced_to_array(import_react2.default.useState(true), 2), controlsVisible = _import_react2_default_useState15[0], setControlsVisible = _import_react2_default_useState15[1];
|
|
6505
|
+
var _import_react2_default_useState16 = _sliced_to_array(import_react2.default.useState([]), 2), overlays = _import_react2_default_useState16[0], setOverlays = _import_react2_default_useState16[1];
|
|
6506
|
+
var _import_react2_default_useState17 = _sliced_to_array(import_react2.default.useState(null), 2), overlayCoordSpace = _import_react2_default_useState17[0], setOverlayCoordSpace = _import_react2_default_useState17[1];
|
|
6507
|
+
var _import_react2_default_useState18 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react2_default_useState18[0], setViewportWidth = _import_react2_default_useState18[1];
|
|
6508
|
+
var _import_react2_default_useState19 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react2_default_useState19[0], setIsPortrait = _import_react2_default_useState19[1];
|
|
6126
6509
|
var getResponsiveScale = function getResponsiveScale() {
|
|
6127
6510
|
if (viewportWidth < 480) return 0.7;
|
|
6128
6511
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -6130,7 +6513,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6130
6513
|
return 1;
|
|
6131
6514
|
};
|
|
6132
6515
|
var responsiveScale = getResponsiveScale();
|
|
6133
|
-
var resetControlsTimer = (0,
|
|
6516
|
+
var resetControlsTimer = (0, import_react2.useCallback)(function() {
|
|
6134
6517
|
if (controlsTimerRef.current) {
|
|
6135
6518
|
clearTimeout(controlsTimerRef.current);
|
|
6136
6519
|
}
|
|
@@ -6207,7 +6590,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6207
6590
|
};
|
|
6208
6591
|
var isHlsStream = (src === null || src === void 0 ? void 0 : src.toLowerCase().includes(".m3u8")) || (src === null || src === void 0 ? void 0 : src.toLowerCase().includes("/hls/"));
|
|
6209
6592
|
var shouldShowEnhancedControls = showCustomControls && (isHlsStream ? allowNativeHls : true);
|
|
6210
|
-
var criticalPropsKey = (0,
|
|
6593
|
+
var criticalPropsKey = (0, import_react2.useMemo)(function() {
|
|
6211
6594
|
return CRITICAL_PROPS.map(function(prop) {
|
|
6212
6595
|
return "".concat(prop, ":").concat(props[prop]);
|
|
6213
6596
|
}).join("|");
|
|
@@ -6218,7 +6601,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6218
6601
|
lowLatencyMode,
|
|
6219
6602
|
driftToleranceMs
|
|
6220
6603
|
]);
|
|
6221
|
-
(0,
|
|
6604
|
+
(0, import_react2.useEffect)(function() {
|
|
6222
6605
|
if (typeof window === "undefined") return;
|
|
6223
6606
|
var el = videoRef.current;
|
|
6224
6607
|
if (!el || !src) return;
|
|
@@ -6273,7 +6656,50 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6273
6656
|
}, [
|
|
6274
6657
|
criticalPropsKey
|
|
6275
6658
|
]);
|
|
6276
|
-
(0,
|
|
6659
|
+
(0, import_react2.useEffect)(function() {
|
|
6660
|
+
if (!swirlProjectId) {
|
|
6661
|
+
setOverlays([]);
|
|
6662
|
+
setOverlayCoordSpace(null);
|
|
6663
|
+
return;
|
|
6664
|
+
}
|
|
6665
|
+
var cancelled = false;
|
|
6666
|
+
fetchProjectOverlays(swirlProjectId).then(function(data) {
|
|
6667
|
+
if (!cancelled) setOverlays(data);
|
|
6668
|
+
}).catch(function(err) {
|
|
6669
|
+
if (!cancelled) {
|
|
6670
|
+
console.warn("[StormcloudVideoPlayer] Failed to fetch overlays:", err);
|
|
6671
|
+
}
|
|
6672
|
+
});
|
|
6673
|
+
return function() {
|
|
6674
|
+
cancelled = true;
|
|
6675
|
+
};
|
|
6676
|
+
}, [
|
|
6677
|
+
swirlProjectId
|
|
6678
|
+
]);
|
|
6679
|
+
(0, import_react2.useEffect)(function() {
|
|
6680
|
+
if (!swirlProjectId) return;
|
|
6681
|
+
var player = playerRef.current;
|
|
6682
|
+
if (!player) return;
|
|
6683
|
+
var tryResolve = function tryResolve() {
|
|
6684
|
+
var res = player.getMinHlsResolution();
|
|
6685
|
+
if (res) {
|
|
6686
|
+
setOverlayCoordSpace(res);
|
|
6687
|
+
return true;
|
|
6688
|
+
}
|
|
6689
|
+
return false;
|
|
6690
|
+
};
|
|
6691
|
+
if (tryResolve()) return;
|
|
6692
|
+
var interval = setInterval(function() {
|
|
6693
|
+
if (tryResolve()) clearInterval(interval);
|
|
6694
|
+
}, 300);
|
|
6695
|
+
return function() {
|
|
6696
|
+
return clearInterval(interval);
|
|
6697
|
+
};
|
|
6698
|
+
}, [
|
|
6699
|
+
swirlProjectId,
|
|
6700
|
+
criticalPropsKey
|
|
6701
|
+
]);
|
|
6702
|
+
(0, import_react2.useEffect)(function() {
|
|
6277
6703
|
if (!playerRef.current) return;
|
|
6278
6704
|
try {
|
|
6279
6705
|
if (autoplay !== void 0 && playerRef.current.videoElement) {
|
|
@@ -6289,7 +6715,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6289
6715
|
autoplay,
|
|
6290
6716
|
muted
|
|
6291
6717
|
]);
|
|
6292
|
-
(0,
|
|
6718
|
+
(0, import_react2.useEffect)(function() {
|
|
6293
6719
|
if (!playerRef.current) return;
|
|
6294
6720
|
var checkAdStatus = function checkAdStatus() {
|
|
6295
6721
|
if (playerRef.current) {
|
|
@@ -6319,7 +6745,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6319
6745
|
return clearInterval(interval);
|
|
6320
6746
|
};
|
|
6321
6747
|
}, []);
|
|
6322
|
-
(0,
|
|
6748
|
+
(0, import_react2.useEffect)(function() {
|
|
6323
6749
|
if (typeof window === "undefined" || !playerRef.current) return;
|
|
6324
6750
|
var handleResize = function handleResize() {
|
|
6325
6751
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6335,7 +6761,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6335
6761
|
return window.removeEventListener("resize", handleResize);
|
|
6336
6762
|
};
|
|
6337
6763
|
}, []);
|
|
6338
|
-
(0,
|
|
6764
|
+
(0, import_react2.useEffect)(function() {
|
|
6339
6765
|
if (!playerRef.current || !videoRef.current) return;
|
|
6340
6766
|
var updateStates = function updateStates() {
|
|
6341
6767
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6362,7 +6788,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6362
6788
|
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
6363
6789
|
};
|
|
6364
6790
|
}, []);
|
|
6365
|
-
(0,
|
|
6791
|
+
(0, import_react2.useEffect)(function() {
|
|
6366
6792
|
if (!videoRef.current) return;
|
|
6367
6793
|
var handleCanPlay = function handleCanPlay() {
|
|
6368
6794
|
setIsLoading(false);
|
|
@@ -6434,19 +6860,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6434
6860
|
}, [
|
|
6435
6861
|
debugAdTiming
|
|
6436
6862
|
]);
|
|
6437
|
-
(0,
|
|
6863
|
+
(0, import_react2.useEffect)(function() {
|
|
6438
6864
|
return function() {
|
|
6439
6865
|
if (controlsTimerRef.current) {
|
|
6440
6866
|
clearTimeout(controlsTimerRef.current);
|
|
6441
6867
|
}
|
|
6442
6868
|
};
|
|
6443
6869
|
}, []);
|
|
6444
|
-
var handleWrapperMouseMove = (0,
|
|
6870
|
+
var handleWrapperMouseMove = (0, import_react2.useCallback)(function() {
|
|
6445
6871
|
resetControlsTimer();
|
|
6446
6872
|
}, [
|
|
6447
6873
|
resetControlsTimer
|
|
6448
6874
|
]);
|
|
6449
|
-
var handleWrapperMouseLeave = (0,
|
|
6875
|
+
var handleWrapperMouseLeave = (0, import_react2.useCallback)(function() {
|
|
6450
6876
|
if (!showVolumeSlider && !showSpeedMenu) {
|
|
6451
6877
|
setControlsVisible(false);
|
|
6452
6878
|
}
|
|
@@ -6456,12 +6882,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6456
6882
|
]);
|
|
6457
6883
|
var progressPercent = duration > 0 ? currentTime / duration * 100 : 0;
|
|
6458
6884
|
var VolumeIcon = isMuted || volume === 0 ? import_fa.FaVolumeMute : volume < 0.5 ? import_fa.FaVolumeDown : import_fa.FaVolumeUp;
|
|
6459
|
-
return /* @__PURE__ */ (0,
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
6460
6886
|
children: [
|
|
6461
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", {
|
|
6462
6888
|
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 "
|
|
6463
6889
|
}),
|
|
6464
|
-
/* @__PURE__ */ (0,
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6465
6891
|
ref: wrapperRef,
|
|
6466
6892
|
className: "sc-wrapper ".concat(wrapperClassName || ""),
|
|
6467
6893
|
onMouseMove: handleWrapperMouseMove,
|
|
@@ -6485,10 +6911,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6485
6911
|
boxShadow: isFullscreen ? "none" : void 0
|
|
6486
6912
|
}, wrapperStyle),
|
|
6487
6913
|
children: [
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("video", _object_spread_props(_object_spread({
|
|
6489
6915
|
ref: videoRef,
|
|
6490
6916
|
className: className,
|
|
6491
6917
|
style: _object_spread({
|
|
6918
|
+
position: "relative",
|
|
6919
|
+
zIndex: 1,
|
|
6492
6920
|
display: "block",
|
|
6493
6921
|
width: "100%",
|
|
6494
6922
|
height: isFullscreen ? "100%" : "auto",
|
|
@@ -6505,7 +6933,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6505
6933
|
}, restVideoAttrs), {
|
|
6506
6934
|
children: children
|
|
6507
6935
|
})),
|
|
6508
|
-
|
|
6936
|
+
overlays.length > 0 && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
|
|
6937
|
+
overlays: overlays,
|
|
6938
|
+
currentTime: currentTime,
|
|
6939
|
+
videoRef: videoRef,
|
|
6940
|
+
coordinateSpace: overlayCoordSpace
|
|
6941
|
+
}),
|
|
6942
|
+
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaSpinner, {
|
|
6509
6943
|
className: "sc-loading-indicator",
|
|
6510
6944
|
size: 40,
|
|
6511
6945
|
color: "rgba(255, 255, 255, 0.85)",
|
|
@@ -6518,7 +6952,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6518
6952
|
filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
|
|
6519
6953
|
}
|
|
6520
6954
|
}),
|
|
6521
|
-
showLicenseWarning && /* @__PURE__ */ (0,
|
|
6955
|
+
showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6522
6956
|
style: {
|
|
6523
6957
|
position: "absolute",
|
|
6524
6958
|
top: "50%",
|
|
@@ -6537,7 +6971,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6537
6971
|
margin: "0 16px"
|
|
6538
6972
|
},
|
|
6539
6973
|
children: [
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6541
6975
|
style: {
|
|
6542
6976
|
fontSize: "18px",
|
|
6543
6977
|
fontWeight: "700",
|
|
@@ -6546,7 +6980,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6546
6980
|
},
|
|
6547
6981
|
children: "License Key Required"
|
|
6548
6982
|
}),
|
|
6549
|
-
/* @__PURE__ */ (0,
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6550
6984
|
style: {
|
|
6551
6985
|
fontSize: "13px",
|
|
6552
6986
|
lineHeight: "1.6",
|
|
@@ -6554,13 +6988,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6554
6988
|
},
|
|
6555
6989
|
children: [
|
|
6556
6990
|
"Please provide a valid license key to use the Stormcloud Video Player.",
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("br", {}),
|
|
6558
6992
|
"Contact your administrator for licensing information."
|
|
6559
6993
|
]
|
|
6560
6994
|
})
|
|
6561
6995
|
]
|
|
6562
6996
|
}),
|
|
6563
|
-
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0,
|
|
6997
|
+
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6564
6998
|
onClick: handleCenterPlayClick,
|
|
6565
6999
|
style: {
|
|
6566
7000
|
position: "absolute",
|
|
@@ -6595,7 +7029,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6595
7029
|
el.style.transform = "translate(-50%, -50%) scale(1)";
|
|
6596
7030
|
},
|
|
6597
7031
|
title: "Play",
|
|
6598
|
-
children: /* @__PURE__ */ (0,
|
|
7032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6599
7033
|
size: Math.max(22, 28 * responsiveScale),
|
|
6600
7034
|
color: "white",
|
|
6601
7035
|
style: {
|
|
@@ -6604,7 +7038,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6604
7038
|
}
|
|
6605
7039
|
})
|
|
6606
7040
|
}),
|
|
6607
|
-
adStatus.showAds && /* @__PURE__ */ (0,
|
|
7041
|
+
adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6608
7042
|
style: {
|
|
6609
7043
|
position: "absolute",
|
|
6610
7044
|
top: "".concat(12 * responsiveScale, "px"),
|
|
@@ -6616,7 +7050,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6616
7050
|
animation: "sc-fade-in 0.3s ease"
|
|
6617
7051
|
},
|
|
6618
7052
|
children: [
|
|
6619
|
-
/* @__PURE__ */ (0,
|
|
7053
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6620
7054
|
style: {
|
|
6621
7055
|
background: "rgba(234, 179, 8, 0.9)",
|
|
6622
7056
|
backdropFilter: "blur(12px)",
|
|
@@ -6631,7 +7065,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6631
7065
|
},
|
|
6632
7066
|
children: "Ad"
|
|
6633
7067
|
}),
|
|
6634
|
-
adStatus.currentIndex > 0 && /* @__PURE__ */ (0,
|
|
7068
|
+
adStatus.currentIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6635
7069
|
style: {
|
|
6636
7070
|
background: "rgba(0, 0, 0, 0.5)",
|
|
6637
7071
|
backdropFilter: "blur(12px)",
|
|
@@ -6650,7 +7084,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6650
7084
|
})
|
|
6651
7085
|
]
|
|
6652
7086
|
}),
|
|
6653
|
-
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0,
|
|
7087
|
+
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6654
7088
|
className: "sc-controls-bar",
|
|
6655
7089
|
style: {
|
|
6656
7090
|
position: "absolute",
|
|
@@ -6665,7 +7099,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6665
7099
|
pointerEvents: controlsVisible || adStatus.showAds ? "auto" : "none"
|
|
6666
7100
|
},
|
|
6667
7101
|
children: [
|
|
6668
|
-
/* @__PURE__ */ (0,
|
|
7102
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6669
7103
|
className: "sc-progress-track",
|
|
6670
7104
|
style: {
|
|
6671
7105
|
width: "100%",
|
|
@@ -6685,7 +7119,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6685
7119
|
e.currentTarget.style.height = "3px";
|
|
6686
7120
|
},
|
|
6687
7121
|
children: [
|
|
6688
|
-
/* @__PURE__ */ (0,
|
|
7122
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6689
7123
|
style: {
|
|
6690
7124
|
position: "absolute",
|
|
6691
7125
|
top: 0,
|
|
@@ -6697,7 +7131,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6697
7131
|
transition: "width 0.15s linear"
|
|
6698
7132
|
}
|
|
6699
7133
|
}),
|
|
6700
|
-
/* @__PURE__ */ (0,
|
|
7134
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6701
7135
|
className: "sc-progress-thumb",
|
|
6702
7136
|
style: {
|
|
6703
7137
|
position: "absolute",
|
|
@@ -6714,7 +7148,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6714
7148
|
})
|
|
6715
7149
|
]
|
|
6716
7150
|
}),
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
7151
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6718
7152
|
style: {
|
|
6719
7153
|
display: "flex",
|
|
6720
7154
|
alignItems: "center",
|
|
@@ -6723,14 +7157,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6723
7157
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6724
7158
|
},
|
|
6725
7159
|
children: [
|
|
6726
|
-
/* @__PURE__ */ (0,
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6727
7161
|
style: {
|
|
6728
7162
|
display: "flex",
|
|
6729
7163
|
alignItems: "center",
|
|
6730
7164
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6731
7165
|
},
|
|
6732
7166
|
children: [
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
7167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6734
7168
|
className: "sc-ctrl-btn",
|
|
6735
7169
|
onClick: handlePlayPause,
|
|
6736
7170
|
style: {
|
|
@@ -6740,16 +7174,16 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6740
7174
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6741
7175
|
},
|
|
6742
7176
|
title: isPlaying ? "Pause" : "Play",
|
|
6743
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
7177
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPause, {
|
|
6744
7178
|
size: Math.max(14, 18 * responsiveScale)
|
|
6745
|
-
}) : /* @__PURE__ */ (0,
|
|
7179
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6746
7180
|
size: Math.max(14, 18 * responsiveScale),
|
|
6747
7181
|
style: {
|
|
6748
7182
|
marginLeft: "2px"
|
|
6749
7183
|
}
|
|
6750
7184
|
})
|
|
6751
7185
|
}),
|
|
6752
|
-
/* @__PURE__ */ (0,
|
|
7186
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6753
7187
|
style: {
|
|
6754
7188
|
display: "flex",
|
|
6755
7189
|
alignItems: "center"
|
|
@@ -6761,7 +7195,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6761
7195
|
return setShowVolumeSlider(false);
|
|
6762
7196
|
},
|
|
6763
7197
|
children: [
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
7198
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6765
7199
|
className: "sc-ctrl-btn",
|
|
6766
7200
|
onClick: function onClick() {
|
|
6767
7201
|
if (playerRef.current) {
|
|
@@ -6777,11 +7211,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6777
7211
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6778
7212
|
},
|
|
6779
7213
|
title: isMuted ? "Unmute" : "Mute",
|
|
6780
|
-
children: /* @__PURE__ */ (0,
|
|
7214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
6781
7215
|
size: Math.max(14, 18 * responsiveScale)
|
|
6782
7216
|
})
|
|
6783
7217
|
}),
|
|
6784
|
-
/* @__PURE__ */ (0,
|
|
7218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6785
7219
|
style: {
|
|
6786
7220
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
6787
7221
|
overflow: "hidden",
|
|
@@ -6791,7 +7225,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6791
7225
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
6792
7226
|
paddingRight: showVolumeSlider ? "4px" : "0"
|
|
6793
7227
|
},
|
|
6794
|
-
children: /* @__PURE__ */ (0,
|
|
7228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6795
7229
|
style: {
|
|
6796
7230
|
position: "relative",
|
|
6797
7231
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -6821,7 +7255,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6821
7255
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
6822
7256
|
},
|
|
6823
7257
|
children: [
|
|
6824
|
-
/* @__PURE__ */ (0,
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6825
7259
|
style: {
|
|
6826
7260
|
position: "absolute",
|
|
6827
7261
|
inset: 0,
|
|
@@ -6829,7 +7263,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6829
7263
|
borderRadius: "1.5px"
|
|
6830
7264
|
}
|
|
6831
7265
|
}),
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6833
7267
|
style: {
|
|
6834
7268
|
position: "absolute",
|
|
6835
7269
|
top: 0,
|
|
@@ -6841,7 +7275,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6841
7275
|
transition: "width 0.1s ease-out"
|
|
6842
7276
|
}
|
|
6843
7277
|
}),
|
|
6844
|
-
/* @__PURE__ */ (0,
|
|
7278
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6845
7279
|
style: {
|
|
6846
7280
|
position: "absolute",
|
|
6847
7281
|
top: "50%",
|
|
@@ -6860,7 +7294,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6860
7294
|
})
|
|
6861
7295
|
]
|
|
6862
7296
|
}),
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
7297
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6864
7298
|
style: {
|
|
6865
7299
|
fontSize: "".concat(13 * responsiveScale, "px"),
|
|
6866
7300
|
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
@@ -6873,7 +7307,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6873
7307
|
children: [
|
|
6874
7308
|
formatTime(currentTime),
|
|
6875
7309
|
" ",
|
|
6876
|
-
/* @__PURE__ */ (0,
|
|
7310
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
6877
7311
|
style: {
|
|
6878
7312
|
color: "rgba(255,255,255,0.5)"
|
|
6879
7313
|
},
|
|
@@ -6885,20 +7319,20 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6885
7319
|
})
|
|
6886
7320
|
]
|
|
6887
7321
|
}),
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6889
7323
|
style: {
|
|
6890
7324
|
display: "flex",
|
|
6891
7325
|
alignItems: "center",
|
|
6892
7326
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6893
7327
|
},
|
|
6894
7328
|
children: [
|
|
6895
|
-
/* @__PURE__ */ (0,
|
|
7329
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6896
7330
|
style: {
|
|
6897
7331
|
position: "relative",
|
|
6898
7332
|
display: viewportWidth < 600 ? "none" : "block"
|
|
6899
7333
|
},
|
|
6900
7334
|
children: [
|
|
6901
|
-
/* @__PURE__ */ (0,
|
|
7335
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
6902
7336
|
className: "sc-ctrl-btn",
|
|
6903
7337
|
onClick: function onClick() {
|
|
6904
7338
|
setShowSpeedMenu(!showSpeedMenu);
|
|
@@ -6918,7 +7352,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6918
7352
|
"x"
|
|
6919
7353
|
]
|
|
6920
7354
|
}),
|
|
6921
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
7355
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6922
7356
|
style: {
|
|
6923
7357
|
position: "absolute",
|
|
6924
7358
|
bottom: "100%",
|
|
@@ -6944,7 +7378,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6944
7378
|
1.75,
|
|
6945
7379
|
2
|
|
6946
7380
|
].map(function(speed) {
|
|
6947
|
-
return /* @__PURE__ */ (0,
|
|
7381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
6948
7382
|
onClick: function onClick() {
|
|
6949
7383
|
return handlePlaybackRateChange(speed);
|
|
6950
7384
|
},
|
|
@@ -6983,7 +7417,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6983
7417
|
})
|
|
6984
7418
|
]
|
|
6985
7419
|
}),
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6987
7421
|
className: "sc-ctrl-btn",
|
|
6988
7422
|
onClick: function onClick() {
|
|
6989
7423
|
if (onFullscreenToggle) {
|
|
@@ -7004,9 +7438,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7004
7438
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7005
7439
|
},
|
|
7006
7440
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7007
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7441
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7008
7442
|
size: Math.max(14, 18 * responsiveScale)
|
|
7009
|
-
}) : /* @__PURE__ */ (0,
|
|
7443
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7010
7444
|
size: Math.max(14, 18 * responsiveScale)
|
|
7011
7445
|
})
|
|
7012
7446
|
})
|
|
@@ -7015,7 +7449,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7015
7449
|
]
|
|
7016
7450
|
})
|
|
7017
7451
|
]
|
|
7018
|
-
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0,
|
|
7452
|
+
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7019
7453
|
className: "sc-controls-bar",
|
|
7020
7454
|
style: {
|
|
7021
7455
|
position: "absolute",
|
|
@@ -7030,7 +7464,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7030
7464
|
pointerEvents: controlsVisible ? "auto" : "none"
|
|
7031
7465
|
},
|
|
7032
7466
|
children: [
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
7467
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7034
7468
|
style: {
|
|
7035
7469
|
display: "flex",
|
|
7036
7470
|
alignItems: "center",
|
|
@@ -7045,7 +7479,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7045
7479
|
return setShowVolumeSlider(false);
|
|
7046
7480
|
},
|
|
7047
7481
|
children: [
|
|
7048
|
-
/* @__PURE__ */ (0,
|
|
7482
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7049
7483
|
className: "sc-ctrl-btn",
|
|
7050
7484
|
onClick: function onClick() {
|
|
7051
7485
|
if (playerRef.current) playerRef.current.toggleMute();
|
|
@@ -7059,11 +7493,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7059
7493
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7060
7494
|
},
|
|
7061
7495
|
title: isMuted ? "Unmute" : "Mute",
|
|
7062
|
-
children: /* @__PURE__ */ (0,
|
|
7496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
7063
7497
|
size: Math.max(14, 18 * responsiveScale)
|
|
7064
7498
|
})
|
|
7065
7499
|
}),
|
|
7066
|
-
/* @__PURE__ */ (0,
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7067
7501
|
style: {
|
|
7068
7502
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
7069
7503
|
overflow: "hidden",
|
|
@@ -7073,7 +7507,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7073
7507
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
7074
7508
|
paddingRight: showVolumeSlider ? "6px" : "0"
|
|
7075
7509
|
},
|
|
7076
|
-
children: /* @__PURE__ */ (0,
|
|
7510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7077
7511
|
style: {
|
|
7078
7512
|
position: "relative",
|
|
7079
7513
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -7103,7 +7537,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7103
7537
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
7104
7538
|
},
|
|
7105
7539
|
children: [
|
|
7106
|
-
/* @__PURE__ */ (0,
|
|
7540
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7107
7541
|
style: {
|
|
7108
7542
|
position: "absolute",
|
|
7109
7543
|
inset: 0,
|
|
@@ -7111,7 +7545,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7111
7545
|
borderRadius: "1.5px"
|
|
7112
7546
|
}
|
|
7113
7547
|
}),
|
|
7114
|
-
/* @__PURE__ */ (0,
|
|
7548
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7115
7549
|
style: {
|
|
7116
7550
|
position: "absolute",
|
|
7117
7551
|
top: 0,
|
|
@@ -7123,7 +7557,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7123
7557
|
transition: "width 0.1s ease-out"
|
|
7124
7558
|
}
|
|
7125
7559
|
}),
|
|
7126
|
-
/* @__PURE__ */ (0,
|
|
7560
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7127
7561
|
style: {
|
|
7128
7562
|
position: "absolute",
|
|
7129
7563
|
top: "50%",
|
|
@@ -7142,7 +7576,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7142
7576
|
})
|
|
7143
7577
|
]
|
|
7144
7578
|
}),
|
|
7145
|
-
/* @__PURE__ */ (0,
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7146
7580
|
className: "sc-ctrl-btn",
|
|
7147
7581
|
onClick: function onClick() {
|
|
7148
7582
|
if (onFullscreenToggle) {
|
|
@@ -7164,15 +7598,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7164
7598
|
background: "rgba(0, 0, 0, 0.6)"
|
|
7165
7599
|
},
|
|
7166
7600
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7167
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7601
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7168
7602
|
size: Math.max(14, 18 * responsiveScale)
|
|
7169
|
-
}) : /* @__PURE__ */ (0,
|
|
7603
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7170
7604
|
size: Math.max(14, 18 * responsiveScale)
|
|
7171
7605
|
})
|
|
7172
7606
|
})
|
|
7173
7607
|
]
|
|
7174
7608
|
}),
|
|
7175
|
-
onControlClick && /* @__PURE__ */ (0,
|
|
7609
|
+
onControlClick && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7176
7610
|
onClick: onControlClick,
|
|
7177
7611
|
style: {
|
|
7178
7612
|
position: "absolute",
|
|
@@ -7223,7 +7657,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7223
7657
|
"playsInline",
|
|
7224
7658
|
"preload",
|
|
7225
7659
|
"poster",
|
|
7226
|
-
"children"
|
|
7660
|
+
"children",
|
|
7661
|
+
"swirlProjectId"
|
|
7227
7662
|
];
|
|
7228
7663
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
7229
7664
|
try {
|