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
package/lib/index.cjs
CHANGED
|
@@ -473,6 +473,9 @@ __export(index_exports, {
|
|
|
473
473
|
detectBrowser: function detectBrowser1() {
|
|
474
474
|
return detectBrowser;
|
|
475
475
|
},
|
|
476
|
+
fetchProjectOverlays: function fetchProjectOverlays1() {
|
|
477
|
+
return fetchProjectOverlays;
|
|
478
|
+
},
|
|
476
479
|
getBrowserConfigOverrides: function getBrowserConfigOverrides1() {
|
|
477
480
|
return getBrowserConfigOverrides;
|
|
478
481
|
},
|
|
@@ -488,6 +491,9 @@ __export(index_exports, {
|
|
|
488
491
|
isMediaStream: function isMediaStream1() {
|
|
489
492
|
return isMediaStream;
|
|
490
493
|
},
|
|
494
|
+
isOverlayActive: function isOverlayActive1() {
|
|
495
|
+
return isOverlayActive;
|
|
496
|
+
},
|
|
491
497
|
lazy: function lazy1() {
|
|
492
498
|
return lazy;
|
|
493
499
|
},
|
|
@@ -509,6 +515,9 @@ __export(index_exports, {
|
|
|
509
515
|
randomString: function randomString1() {
|
|
510
516
|
return randomString;
|
|
511
517
|
},
|
|
518
|
+
resolveImageUrl: function resolveImageUrl1() {
|
|
519
|
+
return resolveImageUrl;
|
|
520
|
+
},
|
|
512
521
|
sendHeartbeat: function sendHeartbeat1() {
|
|
513
522
|
return sendHeartbeat;
|
|
514
523
|
},
|
|
@@ -523,11 +532,14 @@ __export(index_exports, {
|
|
|
523
532
|
},
|
|
524
533
|
supportsWebKitPresentationMode: function supportsWebKitPresentationMode1() {
|
|
525
534
|
return supportsWebKitPresentationMode;
|
|
535
|
+
},
|
|
536
|
+
timeStringToSeconds: function timeStringToSeconds1() {
|
|
537
|
+
return timeStringToSeconds;
|
|
526
538
|
}
|
|
527
539
|
});
|
|
528
540
|
module.exports = __toCommonJS(index_exports);
|
|
529
541
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
530
|
-
var
|
|
542
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
531
543
|
// src/player/StormcloudVideoPlayer.ts
|
|
532
544
|
var import_hls2 = __toESM(require("hls.js"), 1);
|
|
533
545
|
// src/sdk/vastParser.ts
|
|
@@ -6189,6 +6201,46 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6189
6201
|
return this.isLiveStream;
|
|
6190
6202
|
}
|
|
6191
6203
|
},
|
|
6204
|
+
{
|
|
6205
|
+
key: "getMinHlsResolution",
|
|
6206
|
+
value: function getMinHlsResolution() {
|
|
6207
|
+
var _this_hls;
|
|
6208
|
+
var levels = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : _this_hls.levels;
|
|
6209
|
+
if (!levels || levels.length === 0) return null;
|
|
6210
|
+
var min = null;
|
|
6211
|
+
var minPixels = Infinity;
|
|
6212
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6213
|
+
try {
|
|
6214
|
+
for(var _iterator = levels[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6215
|
+
var level = _step.value;
|
|
6216
|
+
if (level.width && level.height) {
|
|
6217
|
+
var pixels = level.width * level.height;
|
|
6218
|
+
if (pixels < minPixels) {
|
|
6219
|
+
minPixels = pixels;
|
|
6220
|
+
min = {
|
|
6221
|
+
width: level.width,
|
|
6222
|
+
height: level.height
|
|
6223
|
+
};
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6227
|
+
} catch (err) {
|
|
6228
|
+
_didIteratorError = true;
|
|
6229
|
+
_iteratorError = err;
|
|
6230
|
+
} finally{
|
|
6231
|
+
try {
|
|
6232
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6233
|
+
_iterator.return();
|
|
6234
|
+
}
|
|
6235
|
+
} finally{
|
|
6236
|
+
if (_didIteratorError) {
|
|
6237
|
+
throw _iteratorError;
|
|
6238
|
+
}
|
|
6239
|
+
}
|
|
6240
|
+
}
|
|
6241
|
+
return min;
|
|
6242
|
+
}
|
|
6243
|
+
},
|
|
6192
6244
|
{
|
|
6193
6245
|
key: "videoElement",
|
|
6194
6246
|
get: function get() {
|
|
@@ -6251,7 +6303,322 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6251
6303
|
}();
|
|
6252
6304
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
6253
6305
|
var import_fa = require("react-icons/fa");
|
|
6306
|
+
// src/ui/OverlayRenderer.tsx
|
|
6307
|
+
var import_react = require("react");
|
|
6308
|
+
// src/utils/overlays.ts
|
|
6309
|
+
var OVERLAY_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
6310
|
+
function timeStringToSeconds(timeStr) {
|
|
6311
|
+
if (!timeStr) return 0;
|
|
6312
|
+
var parts = timeStr.split(":");
|
|
6313
|
+
if (parts.length >= 3) {
|
|
6314
|
+
var _parts_, _parts_1, _parts_2;
|
|
6315
|
+
var hours = parseInt((_parts_ = parts[0]) !== null && _parts_ !== void 0 ? _parts_ : "0", 10) || 0;
|
|
6316
|
+
var minutes = parseInt((_parts_1 = parts[1]) !== null && _parts_1 !== void 0 ? _parts_1 : "0", 10) || 0;
|
|
6317
|
+
var secStr = (_parts_2 = parts[2]) !== null && _parts_2 !== void 0 ? _parts_2 : "0";
|
|
6318
|
+
var dotIdx = secStr.indexOf(".");
|
|
6319
|
+
var seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;
|
|
6320
|
+
var msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : "";
|
|
6321
|
+
var ms = msFrag ? parseInt(msFrag.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
6322
|
+
return hours * 3600 + minutes * 60 + seconds + ms / 1e3;
|
|
6323
|
+
}
|
|
6324
|
+
if (parts.length === 2) {
|
|
6325
|
+
var _parts_3, _parts_4;
|
|
6326
|
+
var minutes1 = parseInt((_parts_3 = parts[0]) !== null && _parts_3 !== void 0 ? _parts_3 : "0", 10) || 0;
|
|
6327
|
+
var secStr1 = (_parts_4 = parts[1]) !== null && _parts_4 !== void 0 ? _parts_4 : "0";
|
|
6328
|
+
var dotIdx1 = secStr1.indexOf(".");
|
|
6329
|
+
var seconds1 = parseInt(dotIdx1 >= 0 ? secStr1.substring(0, dotIdx1) : secStr1, 10) || 0;
|
|
6330
|
+
var msFrag1 = dotIdx1 >= 0 ? secStr1.substring(dotIdx1 + 1) : "";
|
|
6331
|
+
var ms1 = msFrag1 ? parseInt(msFrag1.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
6332
|
+
return minutes1 * 60 + seconds1 + ms1 / 1e3;
|
|
6333
|
+
}
|
|
6334
|
+
var num = parseFloat(timeStr);
|
|
6335
|
+
return isFinite(num) ? Math.max(0, num) : 0;
|
|
6336
|
+
}
|
|
6337
|
+
function isOverlayActive(overlay, currentTime) {
|
|
6338
|
+
if (!overlay.visible) return false;
|
|
6339
|
+
var startSec = timeStringToSeconds(overlay.start_time);
|
|
6340
|
+
var durationSec = timeStringToSeconds(overlay.duration);
|
|
6341
|
+
if (durationSec <= 0) return false;
|
|
6342
|
+
return currentTime >= startSec && currentTime < startSec + durationSec;
|
|
6343
|
+
}
|
|
6344
|
+
function fetchProjectOverlays(_0) {
|
|
6345
|
+
return _async_to_generator(function(projectId) {
|
|
6346
|
+
var apiBaseUrl, response, data;
|
|
6347
|
+
var _arguments = arguments;
|
|
6348
|
+
return _ts_generator(this, function(_state) {
|
|
6349
|
+
switch(_state.label){
|
|
6350
|
+
case 0:
|
|
6351
|
+
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : OVERLAY_API_BASE;
|
|
6352
|
+
return [
|
|
6353
|
+
4,
|
|
6354
|
+
fetch("".concat(apiBaseUrl, "/adstorm/swirl/projects/").concat(projectId, "/overlays"))
|
|
6355
|
+
];
|
|
6356
|
+
case 1:
|
|
6357
|
+
response = _state.sent();
|
|
6358
|
+
if (!response.ok) {
|
|
6359
|
+
throw new Error("Failed to fetch overlays: ".concat(response.status, " ").concat(response.statusText));
|
|
6360
|
+
}
|
|
6361
|
+
return [
|
|
6362
|
+
4,
|
|
6363
|
+
response.json()
|
|
6364
|
+
];
|
|
6365
|
+
case 2:
|
|
6366
|
+
data = _state.sent();
|
|
6367
|
+
return [
|
|
6368
|
+
2,
|
|
6369
|
+
Array.isArray(data) ? data : []
|
|
6370
|
+
];
|
|
6371
|
+
}
|
|
6372
|
+
});
|
|
6373
|
+
}).apply(this, arguments);
|
|
6374
|
+
}
|
|
6375
|
+
function resolveImageUrl(imageUrl) {
|
|
6376
|
+
var apiBaseUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : OVERLAY_API_BASE;
|
|
6377
|
+
if (!imageUrl) return "";
|
|
6378
|
+
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
6379
|
+
return imageUrl;
|
|
6380
|
+
}
|
|
6381
|
+
if (imageUrl.startsWith("/")) {
|
|
6382
|
+
try {
|
|
6383
|
+
var url = new URL(apiBaseUrl);
|
|
6384
|
+
return "".concat(url.origin).concat(imageUrl);
|
|
6385
|
+
} catch (unused) {
|
|
6386
|
+
return imageUrl;
|
|
6387
|
+
}
|
|
6388
|
+
}
|
|
6389
|
+
return "".concat(apiBaseUrl, "/").concat(imageUrl);
|
|
6390
|
+
}
|
|
6391
|
+
// src/ui/OverlayRenderer.tsx
|
|
6254
6392
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
6393
|
+
function computeVideoDimensions(video) {
|
|
6394
|
+
var nativeWidth = video.videoWidth;
|
|
6395
|
+
var nativeHeight = video.videoHeight;
|
|
6396
|
+
if (!nativeWidth || !nativeHeight) return null;
|
|
6397
|
+
var displayWidth = video.offsetWidth;
|
|
6398
|
+
var displayHeight = video.offsetHeight;
|
|
6399
|
+
if (!displayWidth || !displayHeight) return null;
|
|
6400
|
+
var videoAspect = nativeWidth / nativeHeight;
|
|
6401
|
+
var displayAspect = displayWidth / displayHeight;
|
|
6402
|
+
var renderWidth;
|
|
6403
|
+
var renderHeight;
|
|
6404
|
+
var offsetX;
|
|
6405
|
+
var offsetY;
|
|
6406
|
+
if (videoAspect > displayAspect) {
|
|
6407
|
+
renderWidth = displayWidth;
|
|
6408
|
+
renderHeight = displayWidth / videoAspect;
|
|
6409
|
+
offsetX = 0;
|
|
6410
|
+
offsetY = (displayHeight - renderHeight) / 2;
|
|
6411
|
+
} else {
|
|
6412
|
+
renderHeight = displayHeight;
|
|
6413
|
+
renderWidth = displayHeight * videoAspect;
|
|
6414
|
+
offsetX = (displayWidth - renderWidth) / 2;
|
|
6415
|
+
offsetY = 0;
|
|
6416
|
+
}
|
|
6417
|
+
return {
|
|
6418
|
+
nativeWidth: nativeWidth,
|
|
6419
|
+
nativeHeight: nativeHeight,
|
|
6420
|
+
displayWidth: renderWidth,
|
|
6421
|
+
displayHeight: renderHeight,
|
|
6422
|
+
offsetX: offsetX,
|
|
6423
|
+
offsetY: offsetY,
|
|
6424
|
+
scaleX: renderWidth / nativeWidth,
|
|
6425
|
+
scaleY: renderHeight / nativeHeight
|
|
6426
|
+
};
|
|
6427
|
+
}
|
|
6428
|
+
function ImageOverlay(param) {
|
|
6429
|
+
var overlay = param.overlay;
|
|
6430
|
+
var src = resolveImageUrl(overlay.image_url || "");
|
|
6431
|
+
if (!src) return null;
|
|
6432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
6433
|
+
src: src,
|
|
6434
|
+
alt: overlay.name,
|
|
6435
|
+
draggable: false,
|
|
6436
|
+
style: {
|
|
6437
|
+
width: "100%",
|
|
6438
|
+
height: "100%",
|
|
6439
|
+
objectFit: "contain",
|
|
6440
|
+
display: "block",
|
|
6441
|
+
pointerEvents: "none",
|
|
6442
|
+
userSelect: "none"
|
|
6443
|
+
}
|
|
6444
|
+
});
|
|
6445
|
+
}
|
|
6446
|
+
function TextOverlay(param) {
|
|
6447
|
+
var overlay = param.overlay;
|
|
6448
|
+
var text = overlay.content || "";
|
|
6449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6450
|
+
style: {
|
|
6451
|
+
width: "100%",
|
|
6452
|
+
height: "100%",
|
|
6453
|
+
display: "flex",
|
|
6454
|
+
alignItems: "center",
|
|
6455
|
+
justifyContent: "center",
|
|
6456
|
+
color: "#ffffff",
|
|
6457
|
+
fontSize: "clamp(10px, 1.4vw, 20px)",
|
|
6458
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
6459
|
+
fontWeight: 600,
|
|
6460
|
+
textAlign: "center",
|
|
6461
|
+
padding: "4px 8px",
|
|
6462
|
+
boxSizing: "border-box",
|
|
6463
|
+
wordBreak: "break-word",
|
|
6464
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.7)",
|
|
6465
|
+
pointerEvents: "none",
|
|
6466
|
+
userSelect: "none",
|
|
6467
|
+
lineHeight: 1.3
|
|
6468
|
+
},
|
|
6469
|
+
children: text
|
|
6470
|
+
});
|
|
6471
|
+
}
|
|
6472
|
+
function ScrollerOverlay(param) {
|
|
6473
|
+
var overlay = param.overlay;
|
|
6474
|
+
var _ref, _ref1, _ref2, _ref3, _ref4;
|
|
6475
|
+
var cfg = overlay.scroller_config;
|
|
6476
|
+
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) || "";
|
|
6477
|
+
var scrollSpeed = (_ref = cfg === null || cfg === void 0 ? void 0 : cfg.scroll_speed) !== null && _ref !== void 0 ? _ref : 50;
|
|
6478
|
+
var direction = (_ref1 = cfg === null || cfg === void 0 ? void 0 : cfg.direction) !== null && _ref1 !== void 0 ? _ref1 : "left";
|
|
6479
|
+
var fontSize = (cfg === null || cfg === void 0 ? void 0 : cfg.font_size) ? "".concat(cfg.font_size, "px") : "clamp(10px, 1.2vw, 18px)";
|
|
6480
|
+
var fontFamily = (cfg === null || cfg === void 0 ? void 0 : cfg.font_family) || "Roboto, 'Segoe UI', Arial, sans-serif";
|
|
6481
|
+
var fontWeight = (cfg === null || cfg === void 0 ? void 0 : cfg.font_weight) || "600";
|
|
6482
|
+
var textColor = (cfg === null || cfg === void 0 ? void 0 : cfg.text_color) || "#ffffff";
|
|
6483
|
+
var bgColor = (cfg === null || cfg === void 0 ? void 0 : cfg.background_color) || "transparent";
|
|
6484
|
+
var bgOpacity = (cfg === null || cfg === void 0 ? void 0 : cfg.background_opacity) !== void 0 ? cfg.background_opacity / 100 : 0;
|
|
6485
|
+
var borderColor = (cfg === null || cfg === void 0 ? void 0 : cfg.border_color) || "transparent";
|
|
6486
|
+
var borderWidth = (_ref2 = cfg === null || cfg === void 0 ? void 0 : cfg.border_width) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
6487
|
+
var borderRadius = (_ref3 = cfg === null || cfg === void 0 ? void 0 : cfg.border_radius) !== null && _ref3 !== void 0 ? _ref3 : 0;
|
|
6488
|
+
var padding = (_ref4 = cfg === null || cfg === void 0 ? void 0 : cfg.padding) !== null && _ref4 !== void 0 ? _ref4 : 4;
|
|
6489
|
+
var isVertical = direction === "up" || direction === "down";
|
|
6490
|
+
var isReverse = direction === "right" || direction === "down";
|
|
6491
|
+
var durationSec = Math.max(3, 120 - scrollSpeed);
|
|
6492
|
+
var animId = "sc-scroller-".concat(overlay.id);
|
|
6493
|
+
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 }");
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
6495
|
+
children: [
|
|
6496
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
6497
|
+
children: keyframes
|
|
6498
|
+
}),
|
|
6499
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6500
|
+
style: {
|
|
6501
|
+
width: "100%",
|
|
6502
|
+
height: "100%",
|
|
6503
|
+
overflow: "hidden",
|
|
6504
|
+
display: "flex",
|
|
6505
|
+
alignItems: "center",
|
|
6506
|
+
backgroundColor: bgOpacity > 0 ? "rgba(".concat(hexToRgb(bgColor), ", ").concat(bgOpacity, ")") : void 0,
|
|
6507
|
+
border: borderWidth > 0 ? "".concat(borderWidth, "px solid ").concat(borderColor) : void 0,
|
|
6508
|
+
borderRadius: borderRadius > 0 ? "".concat(borderRadius, "px") : void 0,
|
|
6509
|
+
padding: "".concat(padding, "px"),
|
|
6510
|
+
boxSizing: "border-box",
|
|
6511
|
+
pointerEvents: "none"
|
|
6512
|
+
},
|
|
6513
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6514
|
+
style: {
|
|
6515
|
+
whiteSpace: "nowrap",
|
|
6516
|
+
fontSize: fontSize,
|
|
6517
|
+
fontFamily: fontFamily,
|
|
6518
|
+
fontWeight: fontWeight,
|
|
6519
|
+
color: textColor,
|
|
6520
|
+
animation: "".concat(animId, " ").concat(durationSec, "s linear infinite"),
|
|
6521
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.5)",
|
|
6522
|
+
userSelect: "none"
|
|
6523
|
+
},
|
|
6524
|
+
children: text
|
|
6525
|
+
})
|
|
6526
|
+
})
|
|
6527
|
+
]
|
|
6528
|
+
});
|
|
6529
|
+
}
|
|
6530
|
+
function hexToRgb(hex) {
|
|
6531
|
+
if (!hex || !hex.startsWith("#")) return "0,0,0";
|
|
6532
|
+
var clean = hex.slice(1);
|
|
6533
|
+
var num = parseInt(clean.length === 3 ? clean.replace(/./g, "$&$&") : clean, 16);
|
|
6534
|
+
return "".concat(num >> 16 & 255, ",").concat(num >> 8 & 255, ",").concat(num & 255);
|
|
6535
|
+
}
|
|
6536
|
+
var OverlayRenderer = function OverlayRenderer(param) {
|
|
6537
|
+
var overlays = param.overlays, currentTime = param.currentTime, videoRef = param.videoRef, coordinateSpace = param.coordinateSpace;
|
|
6538
|
+
var _ref = _sliced_to_array((0, import_react.useState)(null), 2), dims = _ref[0], setDims = _ref[1];
|
|
6539
|
+
var rafRef = (0, import_react.useRef)(null);
|
|
6540
|
+
var updateDims = (0, import_react.useCallback)(function() {
|
|
6541
|
+
var video = videoRef.current;
|
|
6542
|
+
if (video) {
|
|
6543
|
+
var computed = computeVideoDimensions(video);
|
|
6544
|
+
setDims(function(prev) {
|
|
6545
|
+
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) {
|
|
6546
|
+
return prev;
|
|
6547
|
+
}
|
|
6548
|
+
return computed;
|
|
6549
|
+
});
|
|
6550
|
+
}
|
|
6551
|
+
}, [
|
|
6552
|
+
videoRef
|
|
6553
|
+
]);
|
|
6554
|
+
(0, import_react.useEffect)(function() {
|
|
6555
|
+
updateDims();
|
|
6556
|
+
var interval = setInterval(updateDims, 500);
|
|
6557
|
+
var handleResize = function handleResize() {
|
|
6558
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
6559
|
+
rafRef.current = requestAnimationFrame(updateDims);
|
|
6560
|
+
};
|
|
6561
|
+
window.addEventListener("resize", handleResize);
|
|
6562
|
+
return function() {
|
|
6563
|
+
clearInterval(interval);
|
|
6564
|
+
window.removeEventListener("resize", handleResize);
|
|
6565
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
6566
|
+
};
|
|
6567
|
+
}, [
|
|
6568
|
+
updateDims
|
|
6569
|
+
]);
|
|
6570
|
+
var activeOverlays = overlays.filter(function(o) {
|
|
6571
|
+
return isOverlayActive(o, currentTime);
|
|
6572
|
+
});
|
|
6573
|
+
if (!dims || activeOverlays.length === 0) return null;
|
|
6574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
6575
|
+
"aria-hidden": "true",
|
|
6576
|
+
style: {
|
|
6577
|
+
position: "absolute",
|
|
6578
|
+
left: "".concat(dims.offsetX, "px"),
|
|
6579
|
+
top: "".concat(dims.offsetY, "px"),
|
|
6580
|
+
width: "".concat(dims.displayWidth, "px"),
|
|
6581
|
+
height: "".concat(dims.displayHeight, "px"),
|
|
6582
|
+
pointerEvents: "none",
|
|
6583
|
+
overflow: "hidden",
|
|
6584
|
+
zIndex: 8
|
|
6585
|
+
},
|
|
6586
|
+
children: activeOverlays.map(function(overlay) {
|
|
6587
|
+
var scaleX = (coordinateSpace === null || coordinateSpace === void 0 ? void 0 : coordinateSpace.width) ? dims.displayWidth / coordinateSpace.width : dims.scaleX;
|
|
6588
|
+
var scaleY = (coordinateSpace === null || coordinateSpace === void 0 ? void 0 : coordinateSpace.height) ? dims.displayHeight / coordinateSpace.height : dims.scaleY;
|
|
6589
|
+
var left = overlay.x * scaleX;
|
|
6590
|
+
var top = overlay.y * scaleY;
|
|
6591
|
+
var width = overlay.width * scaleX;
|
|
6592
|
+
var height = overlay.height * scaleY;
|
|
6593
|
+
var opacity = Math.max(0, Math.min(100, overlay.opacity)) / 100;
|
|
6594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6595
|
+
style: {
|
|
6596
|
+
position: "absolute",
|
|
6597
|
+
left: "".concat(left, "px"),
|
|
6598
|
+
top: "".concat(top, "px"),
|
|
6599
|
+
width: "".concat(width, "px"),
|
|
6600
|
+
height: "".concat(height, "px"),
|
|
6601
|
+
opacity: opacity,
|
|
6602
|
+
zIndex: overlay.z_index,
|
|
6603
|
+
overflow: "hidden"
|
|
6604
|
+
},
|
|
6605
|
+
children: [
|
|
6606
|
+
overlay.type === "image" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageOverlay, {
|
|
6607
|
+
overlay: overlay
|
|
6608
|
+
}),
|
|
6609
|
+
overlay.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextOverlay, {
|
|
6610
|
+
overlay: overlay
|
|
6611
|
+
}),
|
|
6612
|
+
overlay.type === "scroller" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollerOverlay, {
|
|
6613
|
+
overlay: overlay
|
|
6614
|
+
})
|
|
6615
|
+
]
|
|
6616
|
+
}, overlay.id);
|
|
6617
|
+
})
|
|
6618
|
+
});
|
|
6619
|
+
};
|
|
6620
|
+
// src/ui/StormcloudVideoPlayer.tsx
|
|
6621
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
6255
6622
|
var CRITICAL_PROPS = [
|
|
6256
6623
|
"src",
|
|
6257
6624
|
"allowNativeHls",
|
|
@@ -6260,8 +6627,8 @@ var CRITICAL_PROPS = [
|
|
|
6260
6627
|
"driftToleranceMs"
|
|
6261
6628
|
];
|
|
6262
6629
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
6263
|
-
var StormcloudVideoPlayerComponent =
|
|
6264
|
-
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, [
|
|
6630
|
+
var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props) {
|
|
6631
|
+
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, [
|
|
6265
6632
|
"src",
|
|
6266
6633
|
"autoplay",
|
|
6267
6634
|
"muted",
|
|
@@ -6288,35 +6655,38 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6288
6655
|
"licenseKey",
|
|
6289
6656
|
"minSegmentsBeforePlay",
|
|
6290
6657
|
"disableAds",
|
|
6291
|
-
"disableFiller"
|
|
6658
|
+
"disableFiller",
|
|
6659
|
+
"swirlProjectId"
|
|
6292
6660
|
]);
|
|
6293
|
-
var videoRef = (0,
|
|
6294
|
-
var playerRef = (0,
|
|
6295
|
-
var bufferingTimeoutRef = (0,
|
|
6296
|
-
var controlsTimerRef = (0,
|
|
6297
|
-
var wrapperRef = (0,
|
|
6298
|
-
var
|
|
6661
|
+
var videoRef = (0, import_react2.useRef)(null);
|
|
6662
|
+
var playerRef = (0, import_react2.useRef)(null);
|
|
6663
|
+
var bufferingTimeoutRef = (0, import_react2.useRef)(null);
|
|
6664
|
+
var controlsTimerRef = (0, import_react2.useRef)(null);
|
|
6665
|
+
var wrapperRef = (0, import_react2.useRef)(null);
|
|
6666
|
+
var _import_react2_default_useState = _sliced_to_array(import_react2.default.useState({
|
|
6299
6667
|
showAds: false,
|
|
6300
6668
|
currentIndex: 0,
|
|
6301
6669
|
totalAds: 0
|
|
6302
|
-
}), 2), adStatus =
|
|
6303
|
-
var
|
|
6304
|
-
var
|
|
6305
|
-
var
|
|
6306
|
-
var
|
|
6307
|
-
var
|
|
6308
|
-
var
|
|
6309
|
-
var
|
|
6310
|
-
var
|
|
6311
|
-
var
|
|
6312
|
-
var
|
|
6313
|
-
var
|
|
6314
|
-
var
|
|
6315
|
-
var
|
|
6316
|
-
var
|
|
6317
|
-
var
|
|
6318
|
-
var
|
|
6319
|
-
var
|
|
6670
|
+
}), 2), adStatus = _import_react2_default_useState[0], setAdStatus = _import_react2_default_useState[1];
|
|
6671
|
+
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];
|
|
6672
|
+
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];
|
|
6673
|
+
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];
|
|
6674
|
+
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];
|
|
6675
|
+
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];
|
|
6676
|
+
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];
|
|
6677
|
+
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];
|
|
6678
|
+
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];
|
|
6679
|
+
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];
|
|
6680
|
+
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];
|
|
6681
|
+
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];
|
|
6682
|
+
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];
|
|
6683
|
+
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];
|
|
6684
|
+
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];
|
|
6685
|
+
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];
|
|
6686
|
+
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];
|
|
6687
|
+
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];
|
|
6688
|
+
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];
|
|
6689
|
+
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];
|
|
6320
6690
|
var getResponsiveScale = function getResponsiveScale() {
|
|
6321
6691
|
if (viewportWidth < 480) return 0.7;
|
|
6322
6692
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -6324,7 +6694,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6324
6694
|
return 1;
|
|
6325
6695
|
};
|
|
6326
6696
|
var responsiveScale = getResponsiveScale();
|
|
6327
|
-
var resetControlsTimer = (0,
|
|
6697
|
+
var resetControlsTimer = (0, import_react2.useCallback)(function() {
|
|
6328
6698
|
if (controlsTimerRef.current) {
|
|
6329
6699
|
clearTimeout(controlsTimerRef.current);
|
|
6330
6700
|
}
|
|
@@ -6401,7 +6771,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6401
6771
|
};
|
|
6402
6772
|
var isHlsStream = (src === null || src === void 0 ? void 0 : src.toLowerCase().includes(".m3u8")) || (src === null || src === void 0 ? void 0 : src.toLowerCase().includes("/hls/"));
|
|
6403
6773
|
var shouldShowEnhancedControls = showCustomControls && (isHlsStream ? allowNativeHls : true);
|
|
6404
|
-
var criticalPropsKey = (0,
|
|
6774
|
+
var criticalPropsKey = (0, import_react2.useMemo)(function() {
|
|
6405
6775
|
return CRITICAL_PROPS.map(function(prop) {
|
|
6406
6776
|
return "".concat(prop, ":").concat(props[prop]);
|
|
6407
6777
|
}).join("|");
|
|
@@ -6412,7 +6782,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6412
6782
|
lowLatencyMode,
|
|
6413
6783
|
driftToleranceMs
|
|
6414
6784
|
]);
|
|
6415
|
-
(0,
|
|
6785
|
+
(0, import_react2.useEffect)(function() {
|
|
6416
6786
|
if (typeof window === "undefined") return;
|
|
6417
6787
|
var el = videoRef.current;
|
|
6418
6788
|
if (!el || !src) return;
|
|
@@ -6467,7 +6837,50 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6467
6837
|
}, [
|
|
6468
6838
|
criticalPropsKey
|
|
6469
6839
|
]);
|
|
6470
|
-
(0,
|
|
6840
|
+
(0, import_react2.useEffect)(function() {
|
|
6841
|
+
if (!swirlProjectId) {
|
|
6842
|
+
setOverlays([]);
|
|
6843
|
+
setOverlayCoordSpace(null);
|
|
6844
|
+
return;
|
|
6845
|
+
}
|
|
6846
|
+
var cancelled = false;
|
|
6847
|
+
fetchProjectOverlays(swirlProjectId).then(function(data) {
|
|
6848
|
+
if (!cancelled) setOverlays(data);
|
|
6849
|
+
}).catch(function(err) {
|
|
6850
|
+
if (!cancelled) {
|
|
6851
|
+
console.warn("[StormcloudVideoPlayer] Failed to fetch overlays:", err);
|
|
6852
|
+
}
|
|
6853
|
+
});
|
|
6854
|
+
return function() {
|
|
6855
|
+
cancelled = true;
|
|
6856
|
+
};
|
|
6857
|
+
}, [
|
|
6858
|
+
swirlProjectId
|
|
6859
|
+
]);
|
|
6860
|
+
(0, import_react2.useEffect)(function() {
|
|
6861
|
+
if (!swirlProjectId) return;
|
|
6862
|
+
var player = playerRef.current;
|
|
6863
|
+
if (!player) return;
|
|
6864
|
+
var tryResolve = function tryResolve() {
|
|
6865
|
+
var res = player.getMinHlsResolution();
|
|
6866
|
+
if (res) {
|
|
6867
|
+
setOverlayCoordSpace(res);
|
|
6868
|
+
return true;
|
|
6869
|
+
}
|
|
6870
|
+
return false;
|
|
6871
|
+
};
|
|
6872
|
+
if (tryResolve()) return;
|
|
6873
|
+
var interval = setInterval(function() {
|
|
6874
|
+
if (tryResolve()) clearInterval(interval);
|
|
6875
|
+
}, 300);
|
|
6876
|
+
return function() {
|
|
6877
|
+
return clearInterval(interval);
|
|
6878
|
+
};
|
|
6879
|
+
}, [
|
|
6880
|
+
swirlProjectId,
|
|
6881
|
+
criticalPropsKey
|
|
6882
|
+
]);
|
|
6883
|
+
(0, import_react2.useEffect)(function() {
|
|
6471
6884
|
if (!playerRef.current) return;
|
|
6472
6885
|
try {
|
|
6473
6886
|
if (autoplay !== void 0 && playerRef.current.videoElement) {
|
|
@@ -6483,7 +6896,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6483
6896
|
autoplay,
|
|
6484
6897
|
muted
|
|
6485
6898
|
]);
|
|
6486
|
-
(0,
|
|
6899
|
+
(0, import_react2.useEffect)(function() {
|
|
6487
6900
|
if (!playerRef.current) return;
|
|
6488
6901
|
var checkAdStatus = function checkAdStatus() {
|
|
6489
6902
|
if (playerRef.current) {
|
|
@@ -6513,7 +6926,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6513
6926
|
return clearInterval(interval);
|
|
6514
6927
|
};
|
|
6515
6928
|
}, []);
|
|
6516
|
-
(0,
|
|
6929
|
+
(0, import_react2.useEffect)(function() {
|
|
6517
6930
|
if (typeof window === "undefined" || !playerRef.current) return;
|
|
6518
6931
|
var handleResize = function handleResize() {
|
|
6519
6932
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6529,7 +6942,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6529
6942
|
return window.removeEventListener("resize", handleResize);
|
|
6530
6943
|
};
|
|
6531
6944
|
}, []);
|
|
6532
|
-
(0,
|
|
6945
|
+
(0, import_react2.useEffect)(function() {
|
|
6533
6946
|
if (!playerRef.current || !videoRef.current) return;
|
|
6534
6947
|
var updateStates = function updateStates() {
|
|
6535
6948
|
if (playerRef.current && videoRef.current) {
|
|
@@ -6556,7 +6969,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6556
6969
|
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
6557
6970
|
};
|
|
6558
6971
|
}, []);
|
|
6559
|
-
(0,
|
|
6972
|
+
(0, import_react2.useEffect)(function() {
|
|
6560
6973
|
if (!videoRef.current) return;
|
|
6561
6974
|
var handleCanPlay = function handleCanPlay() {
|
|
6562
6975
|
setIsLoading(false);
|
|
@@ -6628,19 +7041,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6628
7041
|
}, [
|
|
6629
7042
|
debugAdTiming
|
|
6630
7043
|
]);
|
|
6631
|
-
(0,
|
|
7044
|
+
(0, import_react2.useEffect)(function() {
|
|
6632
7045
|
return function() {
|
|
6633
7046
|
if (controlsTimerRef.current) {
|
|
6634
7047
|
clearTimeout(controlsTimerRef.current);
|
|
6635
7048
|
}
|
|
6636
7049
|
};
|
|
6637
7050
|
}, []);
|
|
6638
|
-
var handleWrapperMouseMove = (0,
|
|
7051
|
+
var handleWrapperMouseMove = (0, import_react2.useCallback)(function() {
|
|
6639
7052
|
resetControlsTimer();
|
|
6640
7053
|
}, [
|
|
6641
7054
|
resetControlsTimer
|
|
6642
7055
|
]);
|
|
6643
|
-
var handleWrapperMouseLeave = (0,
|
|
7056
|
+
var handleWrapperMouseLeave = (0, import_react2.useCallback)(function() {
|
|
6644
7057
|
if (!showVolumeSlider && !showSpeedMenu) {
|
|
6645
7058
|
setControlsVisible(false);
|
|
6646
7059
|
}
|
|
@@ -6650,12 +7063,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6650
7063
|
]);
|
|
6651
7064
|
var progressPercent = duration > 0 ? currentTime / duration * 100 : 0;
|
|
6652
7065
|
var VolumeIcon = isMuted || volume === 0 ? import_fa.FaVolumeMute : volume < 0.5 ? import_fa.FaVolumeDown : import_fa.FaVolumeUp;
|
|
6653
|
-
return /* @__PURE__ */ (0,
|
|
7066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
6654
7067
|
children: [
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", {
|
|
6656
7069
|
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 "
|
|
6657
7070
|
}),
|
|
6658
|
-
/* @__PURE__ */ (0,
|
|
7071
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6659
7072
|
ref: wrapperRef,
|
|
6660
7073
|
className: "sc-wrapper ".concat(wrapperClassName || ""),
|
|
6661
7074
|
onMouseMove: handleWrapperMouseMove,
|
|
@@ -6679,10 +7092,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6679
7092
|
boxShadow: isFullscreen ? "none" : void 0
|
|
6680
7093
|
}, wrapperStyle),
|
|
6681
7094
|
children: [
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
7095
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("video", _object_spread_props(_object_spread({
|
|
6683
7096
|
ref: videoRef,
|
|
6684
7097
|
className: className,
|
|
6685
7098
|
style: _object_spread({
|
|
7099
|
+
position: "relative",
|
|
7100
|
+
zIndex: 1,
|
|
6686
7101
|
display: "block",
|
|
6687
7102
|
width: "100%",
|
|
6688
7103
|
height: isFullscreen ? "100%" : "auto",
|
|
@@ -6699,7 +7114,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6699
7114
|
}, restVideoAttrs), {
|
|
6700
7115
|
children: children
|
|
6701
7116
|
})),
|
|
6702
|
-
|
|
7117
|
+
overlays.length > 0 && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayRenderer, {
|
|
7118
|
+
overlays: overlays,
|
|
7119
|
+
currentTime: currentTime,
|
|
7120
|
+
videoRef: videoRef,
|
|
7121
|
+
coordinateSpace: overlayCoordSpace
|
|
7122
|
+
}),
|
|
7123
|
+
(isLoading || isBuffering) && !hideLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaSpinner, {
|
|
6703
7124
|
className: "sc-loading-indicator",
|
|
6704
7125
|
size: 40,
|
|
6705
7126
|
color: "rgba(255, 255, 255, 0.85)",
|
|
@@ -6712,7 +7133,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6712
7133
|
filter: "drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6))"
|
|
6713
7134
|
}
|
|
6714
7135
|
}),
|
|
6715
|
-
showLicenseWarning && /* @__PURE__ */ (0,
|
|
7136
|
+
showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6716
7137
|
style: {
|
|
6717
7138
|
position: "absolute",
|
|
6718
7139
|
top: "50%",
|
|
@@ -6731,7 +7152,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6731
7152
|
margin: "0 16px"
|
|
6732
7153
|
},
|
|
6733
7154
|
children: [
|
|
6734
|
-
/* @__PURE__ */ (0,
|
|
7155
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6735
7156
|
style: {
|
|
6736
7157
|
fontSize: "18px",
|
|
6737
7158
|
fontWeight: "700",
|
|
@@ -6740,7 +7161,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6740
7161
|
},
|
|
6741
7162
|
children: "License Key Required"
|
|
6742
7163
|
}),
|
|
6743
|
-
/* @__PURE__ */ (0,
|
|
7164
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6744
7165
|
style: {
|
|
6745
7166
|
fontSize: "13px",
|
|
6746
7167
|
lineHeight: "1.6",
|
|
@@ -6748,13 +7169,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6748
7169
|
},
|
|
6749
7170
|
children: [
|
|
6750
7171
|
"Please provide a valid license key to use the Stormcloud Video Player.",
|
|
6751
|
-
/* @__PURE__ */ (0,
|
|
7172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("br", {}),
|
|
6752
7173
|
"Contact your administrator for licensing information."
|
|
6753
7174
|
]
|
|
6754
7175
|
})
|
|
6755
7176
|
]
|
|
6756
7177
|
}),
|
|
6757
|
-
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0,
|
|
7178
|
+
showCenterPlay && !isLoading && !isBuffering && !showLicenseWarning && !adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6758
7179
|
onClick: handleCenterPlayClick,
|
|
6759
7180
|
style: {
|
|
6760
7181
|
position: "absolute",
|
|
@@ -6789,7 +7210,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6789
7210
|
el.style.transform = "translate(-50%, -50%) scale(1)";
|
|
6790
7211
|
},
|
|
6791
7212
|
title: "Play",
|
|
6792
|
-
children: /* @__PURE__ */ (0,
|
|
7213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6793
7214
|
size: Math.max(22, 28 * responsiveScale),
|
|
6794
7215
|
color: "white",
|
|
6795
7216
|
style: {
|
|
@@ -6798,7 +7219,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6798
7219
|
}
|
|
6799
7220
|
})
|
|
6800
7221
|
}),
|
|
6801
|
-
adStatus.showAds && /* @__PURE__ */ (0,
|
|
7222
|
+
adStatus.showAds && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6802
7223
|
style: {
|
|
6803
7224
|
position: "absolute",
|
|
6804
7225
|
top: "".concat(12 * responsiveScale, "px"),
|
|
@@ -6810,7 +7231,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6810
7231
|
animation: "sc-fade-in 0.3s ease"
|
|
6811
7232
|
},
|
|
6812
7233
|
children: [
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
7234
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6814
7235
|
style: {
|
|
6815
7236
|
background: "rgba(234, 179, 8, 0.9)",
|
|
6816
7237
|
backdropFilter: "blur(12px)",
|
|
@@ -6825,7 +7246,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6825
7246
|
},
|
|
6826
7247
|
children: "Ad"
|
|
6827
7248
|
}),
|
|
6828
|
-
adStatus.currentIndex > 0 && /* @__PURE__ */ (0,
|
|
7249
|
+
adStatus.currentIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6829
7250
|
style: {
|
|
6830
7251
|
background: "rgba(0, 0, 0, 0.5)",
|
|
6831
7252
|
backdropFilter: "blur(12px)",
|
|
@@ -6844,7 +7265,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6844
7265
|
})
|
|
6845
7266
|
]
|
|
6846
7267
|
}),
|
|
6847
|
-
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0,
|
|
7268
|
+
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6848
7269
|
className: "sc-controls-bar",
|
|
6849
7270
|
style: {
|
|
6850
7271
|
position: "absolute",
|
|
@@ -6859,7 +7280,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6859
7280
|
pointerEvents: controlsVisible || adStatus.showAds ? "auto" : "none"
|
|
6860
7281
|
},
|
|
6861
7282
|
children: [
|
|
6862
|
-
/* @__PURE__ */ (0,
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6863
7284
|
className: "sc-progress-track",
|
|
6864
7285
|
style: {
|
|
6865
7286
|
width: "100%",
|
|
@@ -6879,7 +7300,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6879
7300
|
e.currentTarget.style.height = "3px";
|
|
6880
7301
|
},
|
|
6881
7302
|
children: [
|
|
6882
|
-
/* @__PURE__ */ (0,
|
|
7303
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6883
7304
|
style: {
|
|
6884
7305
|
position: "absolute",
|
|
6885
7306
|
top: 0,
|
|
@@ -6891,7 +7312,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6891
7312
|
transition: "width 0.15s linear"
|
|
6892
7313
|
}
|
|
6893
7314
|
}),
|
|
6894
|
-
/* @__PURE__ */ (0,
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6895
7316
|
className: "sc-progress-thumb",
|
|
6896
7317
|
style: {
|
|
6897
7318
|
position: "absolute",
|
|
@@ -6908,7 +7329,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6908
7329
|
})
|
|
6909
7330
|
]
|
|
6910
7331
|
}),
|
|
6911
|
-
/* @__PURE__ */ (0,
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6912
7333
|
style: {
|
|
6913
7334
|
display: "flex",
|
|
6914
7335
|
alignItems: "center",
|
|
@@ -6917,14 +7338,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6917
7338
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6918
7339
|
},
|
|
6919
7340
|
children: [
|
|
6920
|
-
/* @__PURE__ */ (0,
|
|
7341
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6921
7342
|
style: {
|
|
6922
7343
|
display: "flex",
|
|
6923
7344
|
alignItems: "center",
|
|
6924
7345
|
gap: "".concat(8 * responsiveScale, "px")
|
|
6925
7346
|
},
|
|
6926
7347
|
children: [
|
|
6927
|
-
/* @__PURE__ */ (0,
|
|
7348
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6928
7349
|
className: "sc-ctrl-btn",
|
|
6929
7350
|
onClick: handlePlayPause,
|
|
6930
7351
|
style: {
|
|
@@ -6934,16 +7355,16 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6934
7355
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6935
7356
|
},
|
|
6936
7357
|
title: isPlaying ? "Pause" : "Play",
|
|
6937
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
7358
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPause, {
|
|
6938
7359
|
size: Math.max(14, 18 * responsiveScale)
|
|
6939
|
-
}) : /* @__PURE__ */ (0,
|
|
7360
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaPlay, {
|
|
6940
7361
|
size: Math.max(14, 18 * responsiveScale),
|
|
6941
7362
|
style: {
|
|
6942
7363
|
marginLeft: "2px"
|
|
6943
7364
|
}
|
|
6944
7365
|
})
|
|
6945
7366
|
}),
|
|
6946
|
-
/* @__PURE__ */ (0,
|
|
7367
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6947
7368
|
style: {
|
|
6948
7369
|
display: "flex",
|
|
6949
7370
|
alignItems: "center"
|
|
@@ -6955,7 +7376,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6955
7376
|
return setShowVolumeSlider(false);
|
|
6956
7377
|
},
|
|
6957
7378
|
children: [
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
6959
7380
|
className: "sc-ctrl-btn",
|
|
6960
7381
|
onClick: function onClick() {
|
|
6961
7382
|
if (playerRef.current) {
|
|
@@ -6971,11 +7392,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6971
7392
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
6972
7393
|
},
|
|
6973
7394
|
title: isMuted ? "Unmute" : "Mute",
|
|
6974
|
-
children: /* @__PURE__ */ (0,
|
|
7395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
6975
7396
|
size: Math.max(14, 18 * responsiveScale)
|
|
6976
7397
|
})
|
|
6977
7398
|
}),
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
6979
7400
|
style: {
|
|
6980
7401
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
6981
7402
|
overflow: "hidden",
|
|
@@ -6985,7 +7406,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
6985
7406
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
6986
7407
|
paddingRight: showVolumeSlider ? "4px" : "0"
|
|
6987
7408
|
},
|
|
6988
|
-
children: /* @__PURE__ */ (0,
|
|
7409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
6989
7410
|
style: {
|
|
6990
7411
|
position: "relative",
|
|
6991
7412
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -7015,7 +7436,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7015
7436
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
7016
7437
|
},
|
|
7017
7438
|
children: [
|
|
7018
|
-
/* @__PURE__ */ (0,
|
|
7439
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7019
7440
|
style: {
|
|
7020
7441
|
position: "absolute",
|
|
7021
7442
|
inset: 0,
|
|
@@ -7023,7 +7444,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7023
7444
|
borderRadius: "1.5px"
|
|
7024
7445
|
}
|
|
7025
7446
|
}),
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7447
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7027
7448
|
style: {
|
|
7028
7449
|
position: "absolute",
|
|
7029
7450
|
top: 0,
|
|
@@ -7035,7 +7456,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7035
7456
|
transition: "width 0.1s ease-out"
|
|
7036
7457
|
}
|
|
7037
7458
|
}),
|
|
7038
|
-
/* @__PURE__ */ (0,
|
|
7459
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7039
7460
|
style: {
|
|
7040
7461
|
position: "absolute",
|
|
7041
7462
|
top: "50%",
|
|
@@ -7054,7 +7475,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7054
7475
|
})
|
|
7055
7476
|
]
|
|
7056
7477
|
}),
|
|
7057
|
-
/* @__PURE__ */ (0,
|
|
7478
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7058
7479
|
style: {
|
|
7059
7480
|
fontSize: "".concat(13 * responsiveScale, "px"),
|
|
7060
7481
|
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
@@ -7067,7 +7488,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7067
7488
|
children: [
|
|
7068
7489
|
formatTime(currentTime),
|
|
7069
7490
|
" ",
|
|
7070
|
-
/* @__PURE__ */ (0,
|
|
7491
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
7071
7492
|
style: {
|
|
7072
7493
|
color: "rgba(255,255,255,0.5)"
|
|
7073
7494
|
},
|
|
@@ -7079,20 +7500,20 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7079
7500
|
})
|
|
7080
7501
|
]
|
|
7081
7502
|
}),
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7503
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7083
7504
|
style: {
|
|
7084
7505
|
display: "flex",
|
|
7085
7506
|
alignItems: "center",
|
|
7086
7507
|
gap: "".concat(8 * responsiveScale, "px")
|
|
7087
7508
|
},
|
|
7088
7509
|
children: [
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7510
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7090
7511
|
style: {
|
|
7091
7512
|
position: "relative",
|
|
7092
7513
|
display: viewportWidth < 600 ? "none" : "block"
|
|
7093
7514
|
},
|
|
7094
7515
|
children: [
|
|
7095
|
-
/* @__PURE__ */ (0,
|
|
7516
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
7096
7517
|
className: "sc-ctrl-btn",
|
|
7097
7518
|
onClick: function onClick() {
|
|
7098
7519
|
setShowSpeedMenu(!showSpeedMenu);
|
|
@@ -7112,7 +7533,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7112
7533
|
"x"
|
|
7113
7534
|
]
|
|
7114
7535
|
}),
|
|
7115
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
7536
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7116
7537
|
style: {
|
|
7117
7538
|
position: "absolute",
|
|
7118
7539
|
bottom: "100%",
|
|
@@ -7138,7 +7559,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7138
7559
|
1.75,
|
|
7139
7560
|
2
|
|
7140
7561
|
].map(function(speed) {
|
|
7141
|
-
return /* @__PURE__ */ (0,
|
|
7562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
7142
7563
|
onClick: function onClick() {
|
|
7143
7564
|
return handlePlaybackRateChange(speed);
|
|
7144
7565
|
},
|
|
@@ -7177,7 +7598,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7177
7598
|
})
|
|
7178
7599
|
]
|
|
7179
7600
|
}),
|
|
7180
|
-
/* @__PURE__ */ (0,
|
|
7601
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7181
7602
|
className: "sc-ctrl-btn",
|
|
7182
7603
|
onClick: function onClick() {
|
|
7183
7604
|
if (onFullscreenToggle) {
|
|
@@ -7198,9 +7619,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7198
7619
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7199
7620
|
},
|
|
7200
7621
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7201
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7622
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7202
7623
|
size: Math.max(14, 18 * responsiveScale)
|
|
7203
|
-
}) : /* @__PURE__ */ (0,
|
|
7624
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7204
7625
|
size: Math.max(14, 18 * responsiveScale)
|
|
7205
7626
|
})
|
|
7206
7627
|
})
|
|
@@ -7209,7 +7630,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7209
7630
|
]
|
|
7210
7631
|
})
|
|
7211
7632
|
]
|
|
7212
|
-
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0,
|
|
7633
|
+
}) : showCustomControls && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7213
7634
|
className: "sc-controls-bar",
|
|
7214
7635
|
style: {
|
|
7215
7636
|
position: "absolute",
|
|
@@ -7224,7 +7645,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7224
7645
|
pointerEvents: controlsVisible ? "auto" : "none"
|
|
7225
7646
|
},
|
|
7226
7647
|
children: [
|
|
7227
|
-
/* @__PURE__ */ (0,
|
|
7648
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7228
7649
|
style: {
|
|
7229
7650
|
display: "flex",
|
|
7230
7651
|
alignItems: "center",
|
|
@@ -7239,7 +7660,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7239
7660
|
return setShowVolumeSlider(false);
|
|
7240
7661
|
},
|
|
7241
7662
|
children: [
|
|
7242
|
-
/* @__PURE__ */ (0,
|
|
7663
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7243
7664
|
className: "sc-ctrl-btn",
|
|
7244
7665
|
onClick: function onClick() {
|
|
7245
7666
|
if (playerRef.current) playerRef.current.toggleMute();
|
|
@@ -7253,11 +7674,11 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7253
7674
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
7254
7675
|
},
|
|
7255
7676
|
title: isMuted ? "Unmute" : "Mute",
|
|
7256
|
-
children: /* @__PURE__ */ (0,
|
|
7677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VolumeIcon, {
|
|
7257
7678
|
size: Math.max(14, 18 * responsiveScale)
|
|
7258
7679
|
})
|
|
7259
7680
|
}),
|
|
7260
|
-
/* @__PURE__ */ (0,
|
|
7681
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7261
7682
|
style: {
|
|
7262
7683
|
width: showVolumeSlider ? "".concat(62 * responsiveScale, "px") : "0px",
|
|
7263
7684
|
overflow: "hidden",
|
|
@@ -7267,7 +7688,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7267
7688
|
paddingLeft: showVolumeSlider ? "2px" : "0",
|
|
7268
7689
|
paddingRight: showVolumeSlider ? "6px" : "0"
|
|
7269
7690
|
},
|
|
7270
|
-
children: /* @__PURE__ */ (0,
|
|
7691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7271
7692
|
style: {
|
|
7272
7693
|
position: "relative",
|
|
7273
7694
|
width: "".concat(56 * responsiveScale, "px"),
|
|
@@ -7297,7 +7718,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7297
7718
|
handleVolumeChange(Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)));
|
|
7298
7719
|
},
|
|
7299
7720
|
children: [
|
|
7300
|
-
/* @__PURE__ */ (0,
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7301
7722
|
style: {
|
|
7302
7723
|
position: "absolute",
|
|
7303
7724
|
inset: 0,
|
|
@@ -7305,7 +7726,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7305
7726
|
borderRadius: "1.5px"
|
|
7306
7727
|
}
|
|
7307
7728
|
}),
|
|
7308
|
-
/* @__PURE__ */ (0,
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7309
7730
|
style: {
|
|
7310
7731
|
position: "absolute",
|
|
7311
7732
|
top: 0,
|
|
@@ -7317,7 +7738,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7317
7738
|
transition: "width 0.1s ease-out"
|
|
7318
7739
|
}
|
|
7319
7740
|
}),
|
|
7320
|
-
/* @__PURE__ */ (0,
|
|
7741
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7321
7742
|
style: {
|
|
7322
7743
|
position: "absolute",
|
|
7323
7744
|
top: "50%",
|
|
@@ -7336,7 +7757,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7336
7757
|
})
|
|
7337
7758
|
]
|
|
7338
7759
|
}),
|
|
7339
|
-
/* @__PURE__ */ (0,
|
|
7760
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7340
7761
|
className: "sc-ctrl-btn",
|
|
7341
7762
|
onClick: function onClick() {
|
|
7342
7763
|
if (onFullscreenToggle) {
|
|
@@ -7358,15 +7779,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7358
7779
|
background: "rgba(0, 0, 0, 0.6)"
|
|
7359
7780
|
},
|
|
7360
7781
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
7361
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
7782
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCompress, {
|
|
7362
7783
|
size: Math.max(14, 18 * responsiveScale)
|
|
7363
|
-
}) : /* @__PURE__ */ (0,
|
|
7784
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaExpand, {
|
|
7364
7785
|
size: Math.max(14, 18 * responsiveScale)
|
|
7365
7786
|
})
|
|
7366
7787
|
})
|
|
7367
7788
|
]
|
|
7368
7789
|
}),
|
|
7369
|
-
onControlClick && /* @__PURE__ */ (0,
|
|
7790
|
+
onControlClick && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7370
7791
|
onClick: onControlClick,
|
|
7371
7792
|
style: {
|
|
7372
7793
|
position: "absolute",
|
|
@@ -7417,7 +7838,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7417
7838
|
"playsInline",
|
|
7418
7839
|
"preload",
|
|
7419
7840
|
"poster",
|
|
7420
|
-
"children"
|
|
7841
|
+
"children",
|
|
7842
|
+
"swirlProjectId"
|
|
7421
7843
|
];
|
|
7422
7844
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
7423
7845
|
try {
|
|
@@ -7472,7 +7894,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7472
7894
|
return true;
|
|
7473
7895
|
});
|
|
7474
7896
|
// src/StormcloudPlayer.tsx
|
|
7475
|
-
var
|
|
7897
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
7476
7898
|
// src/props.ts
|
|
7477
7899
|
var noop = function noop() {};
|
|
7478
7900
|
var defaultProps = {
|
|
@@ -7520,8 +7942,8 @@ var defaultProps = {
|
|
|
7520
7942
|
onControlClick: noop
|
|
7521
7943
|
};
|
|
7522
7944
|
// src/utils.ts
|
|
7523
|
-
var
|
|
7524
|
-
var lazy =
|
|
7945
|
+
var import_react3 = require("react");
|
|
7946
|
+
var lazy = import_react3.lazy;
|
|
7525
7947
|
var omit = function omit(object, keys) {
|
|
7526
7948
|
var result = _object_spread({}, object);
|
|
7527
7949
|
keys.forEach(function(key) {
|
|
@@ -7637,9 +8059,9 @@ var canPlay = {
|
|
|
7637
8059
|
}
|
|
7638
8060
|
};
|
|
7639
8061
|
// src/players/HlsPlayer.tsx
|
|
7640
|
-
var
|
|
7641
|
-
var HlsPlayer = /*#__PURE__*/ function(
|
|
7642
|
-
_inherits(HlsPlayer,
|
|
8062
|
+
var import_react4 = require("react");
|
|
8063
|
+
var HlsPlayer = /*#__PURE__*/ function(_import_react4_Component) {
|
|
8064
|
+
_inherits(HlsPlayer, _import_react4_Component);
|
|
7643
8065
|
function HlsPlayer() {
|
|
7644
8066
|
_class_call_check(this, HlsPlayer);
|
|
7645
8067
|
var _this;
|
|
@@ -7840,13 +8262,13 @@ var HlsPlayer = /*#__PURE__*/ function(_import_react3_Component) {
|
|
|
7840
8262
|
}
|
|
7841
8263
|
]);
|
|
7842
8264
|
return HlsPlayer;
|
|
7843
|
-
}(
|
|
8265
|
+
}(import_react4.Component);
|
|
7844
8266
|
HlsPlayer.displayName = "HlsPlayer";
|
|
7845
8267
|
HlsPlayer.canPlay = canPlay.hls;
|
|
7846
8268
|
// src/players/FilePlayer.tsx
|
|
7847
|
-
var
|
|
7848
|
-
var FilePlayer = /*#__PURE__*/ function(
|
|
7849
|
-
_inherits(FilePlayer,
|
|
8269
|
+
var import_react5 = require("react");
|
|
8270
|
+
var FilePlayer = /*#__PURE__*/ function(_import_react5_Component) {
|
|
8271
|
+
_inherits(FilePlayer, _import_react5_Component);
|
|
7850
8272
|
function FilePlayer() {
|
|
7851
8273
|
_class_call_check(this, FilePlayer);
|
|
7852
8274
|
var _this;
|
|
@@ -8120,7 +8542,7 @@ var FilePlayer = /*#__PURE__*/ function(_import_react4_Component) {
|
|
|
8120
8542
|
}
|
|
8121
8543
|
]);
|
|
8122
8544
|
return FilePlayer;
|
|
8123
|
-
}(
|
|
8545
|
+
}(import_react5.Component);
|
|
8124
8546
|
FilePlayer.displayName = "FilePlayer";
|
|
8125
8547
|
FilePlayer.canPlay = canPlay.file;
|
|
8126
8548
|
// src/players/index.ts
|
|
@@ -8151,10 +8573,10 @@ var players = [
|
|
|
8151
8573
|
];
|
|
8152
8574
|
var players_default = players;
|
|
8153
8575
|
// src/Player.tsx
|
|
8154
|
-
var
|
|
8576
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
8155
8577
|
var SEEK_ON_PLAY_EXPIRY = 5e3;
|
|
8156
|
-
var Player = /*#__PURE__*/ function(
|
|
8157
|
-
_inherits(Player,
|
|
8578
|
+
var Player = /*#__PURE__*/ function(_import_react6_Component) {
|
|
8579
|
+
_inherits(Player, _import_react6_Component);
|
|
8158
8580
|
function Player() {
|
|
8159
8581
|
_class_call_check(this, Player);
|
|
8160
8582
|
var _this;
|
|
@@ -8399,7 +8821,7 @@ var Player = /*#__PURE__*/ function(_import_react5_Component) {
|
|
|
8399
8821
|
if (!Player2) {
|
|
8400
8822
|
return null;
|
|
8401
8823
|
}
|
|
8402
|
-
return
|
|
8824
|
+
return import_react6.default.createElement(Player2, _object_spread_props(_object_spread({}, this.props), {
|
|
8403
8825
|
onMount: this.handlePlayerMount,
|
|
8404
8826
|
onReady: this.handleReady,
|
|
8405
8827
|
onPlay: this.handlePlay,
|
|
@@ -8412,13 +8834,13 @@ var Player = /*#__PURE__*/ function(_import_react5_Component) {
|
|
|
8412
8834
|
}
|
|
8413
8835
|
]);
|
|
8414
8836
|
return Player;
|
|
8415
|
-
}(
|
|
8837
|
+
}(import_react6.Component);
|
|
8416
8838
|
Player.displayName = "Player";
|
|
8417
8839
|
Player.defaultProps = defaultProps;
|
|
8418
8840
|
// src/StormcloudPlayer.tsx
|
|
8419
8841
|
var IS_BROWSER2 = typeof window !== "undefined" && window.document;
|
|
8420
8842
|
var IS_GLOBAL2 = typeof globalThis !== "undefined" && globalThis.window && globalThis.window.document;
|
|
8421
|
-
var UniversalSuspense = IS_BROWSER2 || IS_GLOBAL2 ?
|
|
8843
|
+
var UniversalSuspense = IS_BROWSER2 || IS_GLOBAL2 ? import_react7.Suspense : function() {
|
|
8422
8844
|
return null;
|
|
8423
8845
|
};
|
|
8424
8846
|
var SUPPORTED_PROPS = [
|
|
@@ -8467,8 +8889,8 @@ var SUPPORTED_PROPS = [
|
|
|
8467
8889
|
var customPlayers = [];
|
|
8468
8890
|
var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallback) {
|
|
8469
8891
|
var _a;
|
|
8470
|
-
return _a = /*#__PURE__*/ function(
|
|
8471
|
-
_inherits(_a,
|
|
8892
|
+
return _a = /*#__PURE__*/ function(_import_react7_Component) {
|
|
8893
|
+
_inherits(_a, _import_react7_Component);
|
|
8472
8894
|
function _a() {
|
|
8473
8895
|
_class_call_check(this, _a);
|
|
8474
8896
|
var _this;
|
|
@@ -8545,7 +8967,7 @@ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallbac
|
|
|
8545
8967
|
if (!src) return null;
|
|
8546
8968
|
var activePlayer = _this.getActivePlayer(src);
|
|
8547
8969
|
if (!activePlayer) return null;
|
|
8548
|
-
return
|
|
8970
|
+
return import_react7.default.createElement(Player, _object_spread_props(_object_spread({}, _this.props), {
|
|
8549
8971
|
key: activePlayer.key,
|
|
8550
8972
|
ref: _this.references.player,
|
|
8551
8973
|
activePlayer: activePlayer.lazyPlayer || activePlayer,
|
|
@@ -8561,20 +8983,20 @@ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallbac
|
|
|
8561
8983
|
var _this_props = this.props, src = _this_props.src, style = _this_props.style, width = _this_props.width, height = _this_props.height, fallbackElement = _this_props.fallback, Wrapper = _this_props.wrapper;
|
|
8562
8984
|
var attributes = this.getAttributes(src);
|
|
8563
8985
|
var wrapperRef = typeof Wrapper === "string" ? this.references.wrapper : void 0;
|
|
8564
|
-
return
|
|
8986
|
+
return import_react7.default.createElement(Wrapper, _object_spread({
|
|
8565
8987
|
ref: wrapperRef,
|
|
8566
8988
|
style: _object_spread_props(_object_spread({}, style), {
|
|
8567
8989
|
width: width,
|
|
8568
8990
|
height: height
|
|
8569
8991
|
})
|
|
8570
|
-
}, attributes),
|
|
8992
|
+
}, attributes), import_react7.default.createElement(UniversalSuspense, {
|
|
8571
8993
|
fallback: fallbackElement
|
|
8572
8994
|
}, this.renderActivePlayer(src)));
|
|
8573
8995
|
}
|
|
8574
8996
|
}
|
|
8575
8997
|
]);
|
|
8576
8998
|
return _a;
|
|
8577
|
-
}(
|
|
8999
|
+
}(import_react7.Component), _a.displayName = "StormcloudPlayer", _a.defaultProps = _object_spread_props(_object_spread({}, defaultProps), {
|
|
8578
9000
|
fallback: null,
|
|
8579
9001
|
wrapper: "div"
|
|
8580
9002
|
}), _a.addCustomPlayer = function(player) {
|
|
@@ -8649,11 +9071,13 @@ var StormcloudPlayer_default = StormcloudPlayer;
|
|
|
8649
9071
|
createVastAdLayer: createVastAdLayer,
|
|
8650
9072
|
createVastManager: createVastManager,
|
|
8651
9073
|
detectBrowser: detectBrowser,
|
|
9074
|
+
fetchProjectOverlays: fetchProjectOverlays,
|
|
8652
9075
|
getBrowserConfigOverrides: getBrowserConfigOverrides,
|
|
8653
9076
|
getBrowserID: getBrowserID,
|
|
8654
9077
|
getClientInfo: getClientInfo,
|
|
8655
9078
|
initializePolyfills: initializePolyfills,
|
|
8656
9079
|
isMediaStream: isMediaStream,
|
|
9080
|
+
isOverlayActive: isOverlayActive,
|
|
8657
9081
|
lazy: lazy,
|
|
8658
9082
|
logBrowserInfo: logBrowserInfo,
|
|
8659
9083
|
merge: merge,
|
|
@@ -8661,10 +9085,12 @@ var StormcloudPlayer_default = StormcloudPlayer;
|
|
|
8661
9085
|
parseQuery: parseQuery,
|
|
8662
9086
|
players: players,
|
|
8663
9087
|
randomString: randomString,
|
|
9088
|
+
resolveImageUrl: resolveImageUrl,
|
|
8664
9089
|
sendHeartbeat: sendHeartbeat,
|
|
8665
9090
|
sendInitialTracking: sendInitialTracking,
|
|
8666
9091
|
supportsFeature: supportsFeature,
|
|
8667
9092
|
supportsModernJS: supportsModernJS,
|
|
8668
|
-
supportsWebKitPresentationMode: supportsWebKitPresentationMode
|
|
9093
|
+
supportsWebKitPresentationMode: supportsWebKitPresentationMode,
|
|
9094
|
+
timeStringToSeconds: timeStringToSeconds
|
|
8669
9095
|
});
|
|
8670
9096
|
//# sourceMappingURL=index.cjs.map
|