stormcloud-video-player 0.6.6 → 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 +544 -118
- 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 +510 -100
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +40 -0
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +4 -0
- package/lib/players/HlsPlayer.cjs +40 -0
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +40 -0
- package/lib/players/index.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 +504 -94
- 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
|
|
@@ -6020,6 +6020,46 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6020
6020
|
return this.isLiveStream;
|
|
6021
6021
|
}
|
|
6022
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
|
+
},
|
|
6023
6063
|
{
|
|
6024
6064
|
key: "videoElement",
|
|
6025
6065
|
get: function get() {
|
|
@@ -6082,7 +6122,322 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6082
6122
|
}();
|
|
6083
6123
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
6084
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
|
|
6085
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");
|
|
6086
6441
|
var CRITICAL_PROPS = [
|
|
6087
6442
|
"src",
|
|
6088
6443
|
"allowNativeHls",
|
|
@@ -6091,8 +6446,8 @@ var CRITICAL_PROPS = [
|
|
|
6091
6446
|
"driftToleranceMs"
|
|
6092
6447
|
];
|
|
6093
6448
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
6094
|
-
var StormcloudVideoPlayerComponent =
|
|
6095
|
-
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, [
|
|
6096
6451
|
"src",
|
|
6097
6452
|
"autoplay",
|
|
6098
6453
|
"muted",
|
|
@@ -6119,35 +6474,38 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6119
6474
|
"licenseKey",
|
|
6120
6475
|
"minSegmentsBeforePlay",
|
|
6121
6476
|
"disableAds",
|
|
6122
|
-
"disableFiller"
|
|
6477
|
+
"disableFiller",
|
|
6478
|
+
"swirlProjectId"
|
|
6123
6479
|
]);
|
|
6124
|
-
var videoRef = (0,
|
|
6125
|
-
var playerRef = (0,
|
|
6126
|
-
var bufferingTimeoutRef = (0,
|
|
6127
|
-
var controlsTimerRef = (0,
|
|
6128
|
-
var wrapperRef = (0,
|
|
6129
|
-
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({
|
|
6130
6486
|
showAds: false,
|
|
6131
6487
|
currentIndex: 0,
|
|
6132
6488
|
totalAds: 0
|
|
6133
|
-
}), 2), adStatus =
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6136
|
-
var
|
|
6137
|
-
var
|
|
6138
|
-
var
|
|
6139
|
-
var
|
|
6140
|
-
var
|
|
6141
|
-
var
|
|
6142
|
-
var
|
|
6143
|
-
var
|
|
6144
|
-
var
|
|
6145
|
-
var
|
|
6146
|
-
var
|
|
6147
|
-
var
|
|
6148
|
-
var
|
|
6149
|
-
var
|
|
6150
|
-
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];
|
|
6151
6509
|
var getResponsiveScale = function getResponsiveScale() {
|
|
6152
6510
|
if (viewportWidth < 480) return 0.7;
|
|
6153
6511
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -6155,7 +6513,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6155
6513
|
return 1;
|
|
6156
6514
|
};
|
|
6157
6515
|
var responsiveScale = getResponsiveScale();
|
|
6158
|
-
var resetControlsTimer = (0,
|
|
6516
|
+
var resetControlsTimer = (0, import_react2.useCallback)(function() {
|
|
6159
6517
|
if (controlsTimerRef.current) {
|
|
6160
6518
|
clearTimeout(controlsTimerRef.current);
|
|
6161
6519
|
}
|
|
@@ -6232,7 +6590,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6232
6590
|
};
|
|
6233
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/"));
|
|
6234
6592
|
var shouldShowEnhancedControls = showCustomControls && (isHlsStream ? allowNativeHls : true);
|
|
6235
|
-
var criticalPropsKey = (0,
|
|
6593
|
+
var criticalPropsKey = (0, import_react2.useMemo)(function() {
|
|
6236
6594
|
return CRITICAL_PROPS.map(function(prop) {
|
|
6237
6595
|
return "".concat(prop, ":").concat(props[prop]);
|
|
6238
6596
|
}).join("|");
|
|
@@ -6243,7 +6601,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6243
6601
|
lowLatencyMode,
|
|
6244
6602
|
driftToleranceMs
|
|
6245
6603
|
]);
|
|
6246
|
-
(0,
|
|
6604
|
+
(0, import_react2.useEffect)(function() {
|
|
6247
6605
|
if (typeof window === "undefined") return;
|
|
6248
6606
|
var el = videoRef.current;
|
|
6249
6607
|
if (!el || !src) return;
|
|
@@ -6298,7 +6656,50 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6298
6656
|
}, [
|
|
6299
6657
|
criticalPropsKey
|
|
6300
6658
|
]);
|
|
6301
|
-
(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() {
|
|
6302
6703
|
if (!playerRef.current) return;
|
|
6303
6704
|
try {
|
|
6304
6705
|
if (autoplay !== void 0 && playerRef.current.videoElement) {
|
|
@@ -6314,7 +6715,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6314
6715
|
autoplay,
|
|
6315
6716
|
muted
|
|
6316
6717
|
]);
|
|
6317
|
-
(0,
|
|
6718
|
+
(0, import_react2.useEffect)(function() {
|
|
6318
6719
|
if (!playerRef.current) return;
|
|
6319
6720
|
var checkAdStatus = function checkAdStatus() {
|
|
6320
6721
|
if (playerRef.current) {
|
|
@@ -6344,7 +6745,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6344
6745
|
return clearInterval(interval);
|
|
6345
6746
|
};
|
|
6346
6747
|
}, []);
|
|
6347
|
-
(0,
|
|
6748
|
+
(0, import_react2.useEffect)(function() {
|
|
6348
6749
|
if (typeof window === "undefined" || !playerRef.current) return;
|
|
6349
6750
|
var handleResize = function handleResize() {
|
|
6350
6751
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6360,7 +6761,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6360
6761
|
return window.removeEventListener("resize", handleResize);
|
|
6361
6762
|
};
|
|
6362
6763
|
}, []);
|
|
6363
|
-
(0,
|
|
6764
|
+
(0, import_react2.useEffect)(function() {
|
|
6364
6765
|
if (!playerRef.current || !videoRef.current) return;
|
|
6365
6766
|
var updateStates = function updateStates() {
|
|
6366
6767
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6387,7 +6788,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6387
6788
|
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
6388
6789
|
};
|
|
6389
6790
|
}, []);
|
|
6390
|
-
(0,
|
|
6791
|
+
(0, import_react2.useEffect)(function() {
|
|
6391
6792
|
if (!videoRef.current) return;
|
|
6392
6793
|
var handleCanPlay = function handleCanPlay() {
|
|
6393
6794
|
setIsLoading(false);
|
|
@@ -6459,19 +6860,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6459
6860
|
}, [
|
|
6460
6861
|
debugAdTiming
|
|
6461
6862
|
]);
|
|
6462
|
-
(0,
|
|
6863
|
+
(0, import_react2.useEffect)(function() {
|
|
6463
6864
|
return function() {
|
|
6464
6865
|
if (controlsTimerRef.current) {
|
|
6465
6866
|
clearTimeout(controlsTimerRef.current);
|
|
6466
6867
|
}
|
|
6467
6868
|
};
|
|
6468
6869
|
}, []);
|
|
6469
|
-
var handleWrapperMouseMove = (0,
|
|
6870
|
+
var handleWrapperMouseMove = (0, import_react2.useCallback)(function() {
|
|
6470
6871
|
resetControlsTimer();
|
|
6471
6872
|
}, [
|
|
6472
6873
|
resetControlsTimer
|
|
6473
6874
|
]);
|
|
6474
|
-
var handleWrapperMouseLeave = (0,
|
|
6875
|
+
var handleWrapperMouseLeave = (0, import_react2.useCallback)(function() {
|
|
6475
6876
|
if (!showVolumeSlider && !showSpeedMenu) {
|
|
6476
6877
|
setControlsVisible(false);
|
|
6477
6878
|
}
|
|
@@ -6481,12 +6882,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6481
6882
|
]);
|
|
6482
6883
|
var progressPercent = duration > 0 ? currentTime / duration * 100 : 0;
|
|
6483
6884
|
var VolumeIcon = isMuted || volume === 0 ? import_fa.FaVolumeMute : volume < 0.5 ? import_fa.FaVolumeDown : import_fa.FaVolumeUp;
|
|
6484
|
-
return /* @__PURE__ */ (0,
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
6485
6886
|
children: [
|
|
6486
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", {
|
|
6487
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 "
|
|
6488
6889
|
}),
|
|
6489
|
-
/* @__PURE__ */ (0,
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6490
6891
|
ref: wrapperRef,
|
|
6491
6892
|
className: "sc-wrapper ".concat(wrapperClassName || ""),
|
|
6492
6893
|
onMouseMove: handleWrapperMouseMove,
|
|
@@ -6510,10 +6911,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6510
6911
|
boxShadow: isFullscreen ? "none" : void 0
|
|
6511
6912
|
}, wrapperStyle),
|
|
6512
6913
|
children: [
|
|
6513
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("video", _object_spread_props(_object_spread({
|
|
6514
6915
|
ref: videoRef,
|
|
6515
6916
|
className: className,
|
|
6516
6917
|
style: _object_spread({
|
|
6918
|
+
position: "relative",
|
|
6919
|
+
zIndex: 1,
|
|
6517
6920
|
display: "block",
|
|
6518
6921
|
width: "100%",
|
|
6519
6922
|
height: isFullscreen ? "100%" : "auto",
|
|
@@ -6530,7 +6933,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6530
6933
|
}, restVideoAttrs), {
|
|
6531
6934
|
children: children
|
|
6532
6935
|
})),
|
|
6533
|
-
|
|
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, {
|
|
6534
6943
|
className: "sc-loading-indicator",
|
|
6535
6944
|
size: 40,
|
|
6536
6945
|
color: "rgba(255, 255, 255, 0.85)",
|
|
@@ -6543,7 +6952,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6543
6952
|
filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
|
|
6544
6953
|
}
|
|
6545
6954
|
}),
|
|
6546
|
-
showLicenseWarning && /* @__PURE__ */ (0,
|
|
6955
|
+
showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6547
6956
|
style: {
|
|
6548
6957
|
position: "absolute",
|
|
6549
6958
|
top: "50%",
|
|
@@ -6562,7 +6971,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6562
6971
|
margin: "0 16px"
|
|
6563
6972
|
},
|
|
6564
6973
|
children: [
|
|
6565
|
-
/* @__PURE__ */ (0,
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6566
6975
|
style: {
|
|
6567
6976
|
fontSize: "18px",
|
|
6568
6977
|
fontWeight: "700",
|
|
@@ -6571,7 +6980,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6571
6980
|
},
|
|
6572
6981
|
children: "License Key Required"
|
|
6573
6982
|
}),
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6575
6984
|
style: {
|
|
6576
6985
|
fontSize: "13px",
|
|
6577
6986
|
lineHeight: "1.6",
|
|
@@ -6579,13 +6988,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6579
6988
|
},
|
|
6580
6989
|
children: [
|
|
6581
6990
|
"Please provide a valid license key to use the Stormcloud Video Player.",
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("br", {}),
|
|
6583
6992
|
"Contact your administrator for licensing information."
|
|
6584
6993
|
]
|
|
6585
6994
|
})
|
|
6586
6995
|
]
|
|
6587
6996
|
}),
|
|
6588
|
-
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0,
|
|
6997
|
+
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6589
6998
|
onClick: handleCenterPlayClick,
|
|
6590
6999
|
style: {
|
|
6591
7000
|
position: "absolute",
|
|
@@ -6620,7 +7029,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6620
7029
|
el.style.transform = "translate(-50%, -50%) scale(1)";
|
|
6621
7030
|
},
|
|
6622
7031
|
title: "Play",
|
|
6623
|
-
children: /* @__PURE__ */ (0,
|
|
7032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6624
7033
|
size: Math.max(22, 28 * responsiveScale),
|
|
6625
7034
|
color: "white",
|
|
6626
7035
|
style: {
|
|
@@ -6629,7 +7038,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6629
7038
|
}
|
|
6630
7039
|
})
|
|
6631
7040
|
}),
|
|
6632
|
-
adStatus.showAds && /* @__PURE__ */ (0,
|
|
7041
|
+
adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6633
7042
|
style: {
|
|
6634
7043
|
position: "absolute",
|
|
6635
7044
|
top: "".concat(12 * responsiveScale, "px"),
|
|
@@ -6641,7 +7050,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6641
7050
|
animation: "sc-fade-in 0.3s ease"
|
|
6642
7051
|
},
|
|
6643
7052
|
children: [
|
|
6644
|
-
/* @__PURE__ */ (0,
|
|
7053
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6645
7054
|
style: {
|
|
6646
7055
|
background: "rgba(234, 179, 8, 0.9)",
|
|
6647
7056
|
backdropFilter: "blur(12px)",
|
|
@@ -6656,7 +7065,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6656
7065
|
},
|
|
6657
7066
|
children: "Ad"
|
|
6658
7067
|
}),
|
|
6659
|
-
adStatus.currentIndex > 0 && /* @__PURE__ */ (0,
|
|
7068
|
+
adStatus.currentIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6660
7069
|
style: {
|
|
6661
7070
|
background: "rgba(0, 0, 0, 0.5)",
|
|
6662
7071
|
backdropFilter: "blur(12px)",
|
|
@@ -6675,7 +7084,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6675
7084
|
})
|
|
6676
7085
|
]
|
|
6677
7086
|
}),
|
|
6678
|
-
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0,
|
|
7087
|
+
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6679
7088
|
className: "sc-controls-bar",
|
|
6680
7089
|
style: {
|
|
6681
7090
|
position: "absolute",
|
|
@@ -6690,7 +7099,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6690
7099
|
pointerEvents: controlsVisible || adStatus.showAds ? "auto" : "none"
|
|
6691
7100
|
},
|
|
6692
7101
|
children: [
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
7102
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6694
7103
|
className: "sc-progress-track",
|
|
6695
7104
|
style: {
|
|
6696
7105
|
width: "100%",
|
|
@@ -6710,7 +7119,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6710
7119
|
e.currentTarget.style.height = "3px";
|
|
6711
7120
|
},
|
|
6712
7121
|
children: [
|
|
6713
|
-
/* @__PURE__ */ (0,
|
|
7122
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6714
7123
|
style: {
|
|
6715
7124
|
position: "absolute",
|
|
6716
7125
|
top: 0,
|
|
@@ -6722,7 +7131,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6722
7131
|
transition: "width 0.15s linear"
|
|
6723
7132
|
}
|
|
6724
7133
|
}),
|
|
6725
|
-
/* @__PURE__ */ (0,
|
|
7134
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6726
7135
|
className: "sc-progress-thumb",
|
|
6727
7136
|
style: {
|
|
6728
7137
|
position: "absolute",
|
|
@@ -6739,7 +7148,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6739
7148
|
})
|
|
6740
7149
|
]
|
|
6741
7150
|
}),
|
|
6742
|
-
/* @__PURE__ */ (0,
|
|
7151
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6743
7152
|
style: {
|
|
6744
7153
|
display: "flex",
|
|
6745
7154
|
alignItems: "center",
|
|
@@ -6748,14 +7157,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6748
7157
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6749
7158
|
},
|
|
6750
7159
|
children: [
|
|
6751
|
-
/* @__PURE__ */ (0,
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6752
7161
|
style: {
|
|
6753
7162
|
display: "flex",
|
|
6754
7163
|
alignItems: "center",
|
|
6755
7164
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6756
7165
|
},
|
|
6757
7166
|
children: [
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
7167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6759
7168
|
className: "sc-ctrl-btn",
|
|
6760
7169
|
onClick: handlePlayPause,
|
|
6761
7170
|
style: {
|
|
@@ -6765,16 +7174,16 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6765
7174
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6766
7175
|
},
|
|
6767
7176
|
title: isPlaying ? "Pause" : "Play",
|
|
6768
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
7177
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPause, {
|
|
6769
7178
|
size: Math.max(14, 18 * responsiveScale)
|
|
6770
|
-
}) : /* @__PURE__ */ (0,
|
|
7179
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6771
7180
|
size: Math.max(14, 18 * responsiveScale),
|
|
6772
7181
|
style: {
|
|
6773
7182
|
marginLeft: "2px"
|
|
6774
7183
|
}
|
|
6775
7184
|
})
|
|
6776
7185
|
}),
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
7186
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6778
7187
|
style: {
|
|
6779
7188
|
display: "flex",
|
|
6780
7189
|
alignItems: "center"
|
|
@@ -6786,7 +7195,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6786
7195
|
return setShowVolumeSlider(false);
|
|
6787
7196
|
},
|
|
6788
7197
|
children: [
|
|
6789
|
-
/* @__PURE__ */ (0,
|
|
7198
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6790
7199
|
className: "sc-ctrl-btn",
|
|
6791
7200
|
onClick: function onClick() {
|
|
6792
7201
|
if (playerRef.current) {
|
|
@@ -6802,11 +7211,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6802
7211
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6803
7212
|
},
|
|
6804
7213
|
title: isMuted ? "Unmute" : "Mute",
|
|
6805
|
-
children: /* @__PURE__ */ (0,
|
|
7214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
6806
7215
|
size: Math.max(14, 18 * responsiveScale)
|
|
6807
7216
|
})
|
|
6808
7217
|
}),
|
|
6809
|
-
/* @__PURE__ */ (0,
|
|
7218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6810
7219
|
style: {
|
|
6811
7220
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
6812
7221
|
overflow: "hidden",
|
|
@@ -6816,7 +7225,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6816
7225
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
6817
7226
|
paddingRight: showVolumeSlider ? "4px" : "0"
|
|
6818
7227
|
},
|
|
6819
|
-
children: /* @__PURE__ */ (0,
|
|
7228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6820
7229
|
style: {
|
|
6821
7230
|
position: "relative",
|
|
6822
7231
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -6846,7 +7255,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6846
7255
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
6847
7256
|
},
|
|
6848
7257
|
children: [
|
|
6849
|
-
/* @__PURE__ */ (0,
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6850
7259
|
style: {
|
|
6851
7260
|
position: "absolute",
|
|
6852
7261
|
inset: 0,
|
|
@@ -6854,7 +7263,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6854
7263
|
borderRadius: "1.5px"
|
|
6855
7264
|
}
|
|
6856
7265
|
}),
|
|
6857
|
-
/* @__PURE__ */ (0,
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6858
7267
|
style: {
|
|
6859
7268
|
position: "absolute",
|
|
6860
7269
|
top: 0,
|
|
@@ -6866,7 +7275,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6866
7275
|
transition: "width 0.1s ease-out"
|
|
6867
7276
|
}
|
|
6868
7277
|
}),
|
|
6869
|
-
/* @__PURE__ */ (0,
|
|
7278
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6870
7279
|
style: {
|
|
6871
7280
|
position: "absolute",
|
|
6872
7281
|
top: "50%",
|
|
@@ -6885,7 +7294,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6885
7294
|
})
|
|
6886
7295
|
]
|
|
6887
7296
|
}),
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
7297
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6889
7298
|
style: {
|
|
6890
7299
|
fontSize: "".concat(13 * responsiveScale, "px"),
|
|
6891
7300
|
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
@@ -6898,7 +7307,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6898
7307
|
children: [
|
|
6899
7308
|
formatTime(currentTime),
|
|
6900
7309
|
" ",
|
|
6901
|
-
/* @__PURE__ */ (0,
|
|
7310
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
6902
7311
|
style: {
|
|
6903
7312
|
color: "rgba(255,255,255,0.5)"
|
|
6904
7313
|
},
|
|
@@ -6910,20 +7319,20 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6910
7319
|
})
|
|
6911
7320
|
]
|
|
6912
7321
|
}),
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6914
7323
|
style: {
|
|
6915
7324
|
display: "flex",
|
|
6916
7325
|
alignItems: "center",
|
|
6917
7326
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6918
7327
|
},
|
|
6919
7328
|
children: [
|
|
6920
|
-
/* @__PURE__ */ (0,
|
|
7329
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6921
7330
|
style: {
|
|
6922
7331
|
position: "relative",
|
|
6923
7332
|
display: viewportWidth < 600 ? "none" : "block"
|
|
6924
7333
|
},
|
|
6925
7334
|
children: [
|
|
6926
|
-
/* @__PURE__ */ (0,
|
|
7335
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
6927
7336
|
className: "sc-ctrl-btn",
|
|
6928
7337
|
onClick: function onClick() {
|
|
6929
7338
|
setShowSpeedMenu(!showSpeedMenu);
|
|
@@ -6943,7 +7352,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6943
7352
|
"x"
|
|
6944
7353
|
]
|
|
6945
7354
|
}),
|
|
6946
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
7355
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6947
7356
|
style: {
|
|
6948
7357
|
position: "absolute",
|
|
6949
7358
|
bottom: "100%",
|
|
@@ -6969,7 +7378,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6969
7378
|
1.75,
|
|
6970
7379
|
2
|
|
6971
7380
|
].map(function(speed) {
|
|
6972
|
-
return /* @__PURE__ */ (0,
|
|
7381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
6973
7382
|
onClick: function onClick() {
|
|
6974
7383
|
return handlePlaybackRateChange(speed);
|
|
6975
7384
|
},
|
|
@@ -7008,7 +7417,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7008
7417
|
})
|
|
7009
7418
|
]
|
|
7010
7419
|
}),
|
|
7011
|
-
/* @__PURE__ */ (0,
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7012
7421
|
className: "sc-ctrl-btn",
|
|
7013
7422
|
onClick: function onClick() {
|
|
7014
7423
|
if (onFullscreenToggle) {
|
|
@@ -7029,9 +7438,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7029
7438
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7030
7439
|
},
|
|
7031
7440
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7032
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7441
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7033
7442
|
size: Math.max(14, 18 * responsiveScale)
|
|
7034
|
-
}) : /* @__PURE__ */ (0,
|
|
7443
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7035
7444
|
size: Math.max(14, 18 * responsiveScale)
|
|
7036
7445
|
})
|
|
7037
7446
|
})
|
|
@@ -7040,7 +7449,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7040
7449
|
]
|
|
7041
7450
|
})
|
|
7042
7451
|
]
|
|
7043
|
-
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0,
|
|
7452
|
+
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7044
7453
|
className: "sc-controls-bar",
|
|
7045
7454
|
style: {
|
|
7046
7455
|
position: "absolute",
|
|
@@ -7055,7 +7464,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7055
7464
|
pointerEvents: controlsVisible ? "auto" : "none"
|
|
7056
7465
|
},
|
|
7057
7466
|
children: [
|
|
7058
|
-
/* @__PURE__ */ (0,
|
|
7467
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7059
7468
|
style: {
|
|
7060
7469
|
display: "flex",
|
|
7061
7470
|
alignItems: "center",
|
|
@@ -7070,7 +7479,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7070
7479
|
return setShowVolumeSlider(false);
|
|
7071
7480
|
},
|
|
7072
7481
|
children: [
|
|
7073
|
-
/* @__PURE__ */ (0,
|
|
7482
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7074
7483
|
className: "sc-ctrl-btn",
|
|
7075
7484
|
onClick: function onClick() {
|
|
7076
7485
|
if (playerRef.current) playerRef.current.toggleMute();
|
|
@@ -7084,11 +7493,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7084
7493
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7085
7494
|
},
|
|
7086
7495
|
title: isMuted ? "Unmute" : "Mute",
|
|
7087
|
-
children: /* @__PURE__ */ (0,
|
|
7496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
7088
7497
|
size: Math.max(14, 18 * responsiveScale)
|
|
7089
7498
|
})
|
|
7090
7499
|
}),
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7092
7501
|
style: {
|
|
7093
7502
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
7094
7503
|
overflow: "hidden",
|
|
@@ -7098,7 +7507,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7098
7507
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
7099
7508
|
paddingRight: showVolumeSlider ? "6px" : "0"
|
|
7100
7509
|
},
|
|
7101
|
-
children: /* @__PURE__ */ (0,
|
|
7510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7102
7511
|
style: {
|
|
7103
7512
|
position: "relative",
|
|
7104
7513
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -7128,7 +7537,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7128
7537
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
7129
7538
|
},
|
|
7130
7539
|
children: [
|
|
7131
|
-
/* @__PURE__ */ (0,
|
|
7540
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7132
7541
|
style: {
|
|
7133
7542
|
position: "absolute",
|
|
7134
7543
|
inset: 0,
|
|
@@ -7136,7 +7545,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7136
7545
|
borderRadius: "1.5px"
|
|
7137
7546
|
}
|
|
7138
7547
|
}),
|
|
7139
|
-
/* @__PURE__ */ (0,
|
|
7548
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7140
7549
|
style: {
|
|
7141
7550
|
position: "absolute",
|
|
7142
7551
|
top: 0,
|
|
@@ -7148,7 +7557,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7148
7557
|
transition: "width 0.1s ease-out"
|
|
7149
7558
|
}
|
|
7150
7559
|
}),
|
|
7151
|
-
/* @__PURE__ */ (0,
|
|
7560
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7152
7561
|
style: {
|
|
7153
7562
|
position: "absolute",
|
|
7154
7563
|
top: "50%",
|
|
@@ -7167,7 +7576,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7167
7576
|
})
|
|
7168
7577
|
]
|
|
7169
7578
|
}),
|
|
7170
|
-
/* @__PURE__ */ (0,
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7171
7580
|
className: "sc-ctrl-btn",
|
|
7172
7581
|
onClick: function onClick() {
|
|
7173
7582
|
if (onFullscreenToggle) {
|
|
@@ -7189,15 +7598,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7189
7598
|
background: "rgba(0, 0, 0, 0.6)"
|
|
7190
7599
|
},
|
|
7191
7600
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7192
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7601
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7193
7602
|
size: Math.max(14, 18 * responsiveScale)
|
|
7194
|
-
}) : /* @__PURE__ */ (0,
|
|
7603
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7195
7604
|
size: Math.max(14, 18 * responsiveScale)
|
|
7196
7605
|
})
|
|
7197
7606
|
})
|
|
7198
7607
|
]
|
|
7199
7608
|
}),
|
|
7200
|
-
onControlClick && /* @__PURE__ */ (0,
|
|
7609
|
+
onControlClick && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7201
7610
|
onClick: onControlClick,
|
|
7202
7611
|
style: {
|
|
7203
7612
|
position: "absolute",
|
|
@@ -7248,7 +7657,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7248
7657
|
"playsInline",
|
|
7249
7658
|
"preload",
|
|
7250
7659
|
"poster",
|
|
7251
|
-
"children"
|
|
7660
|
+
"children",
|
|
7661
|
+
"swirlProjectId"
|
|
7252
7662
|
];
|
|
7253
7663
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
7254
7664
|
try {
|