stormcloud-video-player 0.7.0 → 0.7.2
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 +862 -20
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3 -2
- package/lib/index.d.ts +3 -2
- package/lib/index.js +863 -21
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +798 -1
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +862 -20
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +3 -2
- package/package.json +1 -1
|
@@ -49,9 +49,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
49
49
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
50
50
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
51
51
|
}
|
|
52
|
+
var __create = Object.create;
|
|
52
53
|
var __defProp = Object.defineProperty;
|
|
53
54
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
54
55
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
56
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
55
57
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
56
58
|
var __export = function __export(target, all) {
|
|
57
59
|
for(var name in all)__defProp(target, name, {
|
|
@@ -90,6 +92,16 @@ var __copyProps = function __copyProps(to, from, except, desc) {
|
|
|
90
92
|
}
|
|
91
93
|
return to;
|
|
92
94
|
};
|
|
95
|
+
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
96
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
97
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
98
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
99
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
100
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
101
|
+
value: mod,
|
|
102
|
+
enumerable: true
|
|
103
|
+
}) : target, mod);
|
|
104
|
+
};
|
|
93
105
|
var __toCommonJS = function __toCommonJS(mod) {
|
|
94
106
|
return __copyProps(__defProp({}, "__esModule", {
|
|
95
107
|
value: true
|
|
@@ -103,7 +115,7 @@ __export(OverlayRenderer_exports, {
|
|
|
103
115
|
}
|
|
104
116
|
});
|
|
105
117
|
module.exports = __toCommonJS(OverlayRenderer_exports);
|
|
106
|
-
var import_react = require("react");
|
|
118
|
+
var import_react = __toESM(require("react"), 1);
|
|
107
119
|
// src/utils/overlays.ts
|
|
108
120
|
var OVERLAY_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
109
121
|
function timeStringToSeconds(timeStr) {
|
|
@@ -295,6 +307,751 @@ function ScrollerOverlay(param) {
|
|
|
295
307
|
]
|
|
296
308
|
});
|
|
297
309
|
}
|
|
310
|
+
function parseConfig(content) {
|
|
311
|
+
if (!content) return null;
|
|
312
|
+
try {
|
|
313
|
+
return JSON.parse(content);
|
|
314
|
+
} catch (unused) {
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function ScoreBugOverlay(param) {
|
|
319
|
+
var overlay = param.overlay, size = param.size;
|
|
320
|
+
var cfg = parseConfig(overlay.content);
|
|
321
|
+
if (!cfg) return null;
|
|
322
|
+
var f = Math.max(6, size.w * 0.058);
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
324
|
+
style: {
|
|
325
|
+
width: "100%",
|
|
326
|
+
height: "100%",
|
|
327
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
328
|
+
display: "flex",
|
|
329
|
+
flexDirection: "column",
|
|
330
|
+
background: cfg.backgroundColor,
|
|
331
|
+
color: cfg.textColor,
|
|
332
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
333
|
+
overflow: "hidden",
|
|
334
|
+
pointerEvents: "none",
|
|
335
|
+
userSelect: "none",
|
|
336
|
+
fontSize: "".concat(f, "px")
|
|
337
|
+
},
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
340
|
+
style: {
|
|
341
|
+
flex: 1,
|
|
342
|
+
display: "flex",
|
|
343
|
+
alignItems: "center",
|
|
344
|
+
padding: "0 ".concat(f * 0.8, "px"),
|
|
345
|
+
gap: f * 0.4
|
|
346
|
+
},
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
349
|
+
style: {
|
|
350
|
+
flex: 1,
|
|
351
|
+
textAlign: "center"
|
|
352
|
+
},
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
355
|
+
style: {
|
|
356
|
+
fontSize: "1em",
|
|
357
|
+
fontWeight: 700
|
|
358
|
+
},
|
|
359
|
+
children: cfg.homeTeam
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
362
|
+
style: {
|
|
363
|
+
fontSize: "1.8em",
|
|
364
|
+
fontWeight: 900,
|
|
365
|
+
lineHeight: 1
|
|
366
|
+
},
|
|
367
|
+
children: cfg.homeScore
|
|
368
|
+
})
|
|
369
|
+
]
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
372
|
+
style: {
|
|
373
|
+
fontSize: "0.8em",
|
|
374
|
+
textAlign: "center",
|
|
375
|
+
opacity: 0.7,
|
|
376
|
+
padding: "0 ".concat(f * 0.4, "px")
|
|
377
|
+
},
|
|
378
|
+
children: [
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
380
|
+
children: cfg.period
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
383
|
+
children: cfg.clock
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
}),
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
388
|
+
style: {
|
|
389
|
+
flex: 1,
|
|
390
|
+
textAlign: "center"
|
|
391
|
+
},
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
394
|
+
style: {
|
|
395
|
+
fontSize: "1em",
|
|
396
|
+
fontWeight: 700
|
|
397
|
+
},
|
|
398
|
+
children: cfg.awayTeam
|
|
399
|
+
}),
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
401
|
+
style: {
|
|
402
|
+
fontSize: "1.8em",
|
|
403
|
+
fontWeight: 900,
|
|
404
|
+
lineHeight: 1
|
|
405
|
+
},
|
|
406
|
+
children: cfg.awayScore
|
|
407
|
+
})
|
|
408
|
+
]
|
|
409
|
+
})
|
|
410
|
+
]
|
|
411
|
+
}),
|
|
412
|
+
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
413
|
+
style: {
|
|
414
|
+
fontSize: "0.7em",
|
|
415
|
+
textAlign: "center",
|
|
416
|
+
opacity: 0.5,
|
|
417
|
+
padding: "".concat(f * 0.2, "px 0"),
|
|
418
|
+
borderTop: "1px solid ".concat(cfg.accentColor, "40")
|
|
419
|
+
},
|
|
420
|
+
children: cfg.sponsorText
|
|
421
|
+
})
|
|
422
|
+
]
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
function LowerThirdOverlay(param) {
|
|
426
|
+
var overlay = param.overlay, size = param.size;
|
|
427
|
+
var cfg = parseConfig(overlay.content);
|
|
428
|
+
if (!cfg) return null;
|
|
429
|
+
var f = Math.max(6, size.w * 0.055);
|
|
430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
431
|
+
style: {
|
|
432
|
+
width: "100%",
|
|
433
|
+
height: "100%",
|
|
434
|
+
borderRadius: Math.max(2, size.w * 0.02),
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexDirection: "column",
|
|
437
|
+
justifyContent: "flex-end",
|
|
438
|
+
background: cfg.backgroundColor,
|
|
439
|
+
color: cfg.textColor,
|
|
440
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
441
|
+
overflow: "hidden",
|
|
442
|
+
pointerEvents: "none",
|
|
443
|
+
userSelect: "none",
|
|
444
|
+
fontSize: "".concat(f, "px")
|
|
445
|
+
},
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
448
|
+
style: {
|
|
449
|
+
width: "100%",
|
|
450
|
+
height: Math.max(2, size.h * 0.06),
|
|
451
|
+
backgroundColor: cfg.accentColor
|
|
452
|
+
}
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
455
|
+
style: {
|
|
456
|
+
flex: 1,
|
|
457
|
+
display: "flex",
|
|
458
|
+
flexDirection: "column",
|
|
459
|
+
justifyContent: "center",
|
|
460
|
+
padding: "".concat(f * 0.5, "px ").concat(f * 1.2, "px")
|
|
461
|
+
},
|
|
462
|
+
children: [
|
|
463
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
464
|
+
style: {
|
|
465
|
+
fontSize: "1.4em",
|
|
466
|
+
fontWeight: 700,
|
|
467
|
+
lineHeight: 1.2,
|
|
468
|
+
textShadow: "0 1px 4px rgba(0,0,0,0.5)"
|
|
469
|
+
},
|
|
470
|
+
children: cfg.headline
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
473
|
+
style: {
|
|
474
|
+
fontSize: "1em",
|
|
475
|
+
opacity: 0.7,
|
|
476
|
+
marginTop: f * 0.2
|
|
477
|
+
},
|
|
478
|
+
children: cfg.subtitle
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
}),
|
|
482
|
+
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
483
|
+
style: {
|
|
484
|
+
fontSize: "0.7em",
|
|
485
|
+
opacity: 0.4,
|
|
486
|
+
padding: "0 ".concat(f * 1.2, "px ").concat(f * 0.4, "px")
|
|
487
|
+
},
|
|
488
|
+
children: cfg.sponsorText
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function QrCodeOverlay(param) {
|
|
494
|
+
var overlay = param.overlay, size = param.size;
|
|
495
|
+
var cfg = parseConfig(overlay.content);
|
|
496
|
+
if (!cfg) return null;
|
|
497
|
+
var qrSide = Math.max(32, Math.min(size.w, size.h) * 0.55);
|
|
498
|
+
var qrUrl = "https://api.qrserver.com/v1/create-qr-code/?size=".concat(Math.round(qrSide * 2), "x").concat(Math.round(qrSide * 2), "&data=").concat(encodeURIComponent(cfg.url || "https://example.com"));
|
|
499
|
+
var f = Math.max(6, size.w * 0.06);
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
501
|
+
style: {
|
|
502
|
+
width: "100%",
|
|
503
|
+
height: "100%",
|
|
504
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
505
|
+
display: "flex",
|
|
506
|
+
flexDirection: "column",
|
|
507
|
+
alignItems: "center",
|
|
508
|
+
justifyContent: "center",
|
|
509
|
+
gap: f * 0.4,
|
|
510
|
+
background: cfg.backgroundColor,
|
|
511
|
+
color: cfg.textColor,
|
|
512
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
513
|
+
padding: f * 0.6,
|
|
514
|
+
boxSizing: "border-box",
|
|
515
|
+
pointerEvents: "none",
|
|
516
|
+
userSelect: "none",
|
|
517
|
+
overflow: "hidden"
|
|
518
|
+
},
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
521
|
+
style: {
|
|
522
|
+
flexShrink: 0,
|
|
523
|
+
background: "#fff",
|
|
524
|
+
borderRadius: Math.max(2, qrSide * 0.06),
|
|
525
|
+
padding: Math.max(2, qrSide * 0.06),
|
|
526
|
+
lineHeight: 0
|
|
527
|
+
},
|
|
528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
529
|
+
src: qrUrl,
|
|
530
|
+
alt: "QR Code",
|
|
531
|
+
style: {
|
|
532
|
+
width: "".concat(qrSide, "px"),
|
|
533
|
+
height: "".concat(qrSide, "px"),
|
|
534
|
+
display: "block"
|
|
535
|
+
}
|
|
536
|
+
})
|
|
537
|
+
}),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
539
|
+
style: {
|
|
540
|
+
fontSize: "".concat(f * 1.1, "px"),
|
|
541
|
+
fontWeight: 700,
|
|
542
|
+
textAlign: "center",
|
|
543
|
+
color: cfg.accentColor,
|
|
544
|
+
overflow: "hidden",
|
|
545
|
+
textOverflow: "ellipsis",
|
|
546
|
+
whiteSpace: "nowrap",
|
|
547
|
+
width: "100%"
|
|
548
|
+
},
|
|
549
|
+
children: cfg.ctaText
|
|
550
|
+
}),
|
|
551
|
+
cfg.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
552
|
+
style: {
|
|
553
|
+
fontSize: "".concat(f * 0.75, "px"),
|
|
554
|
+
opacity: 0.6,
|
|
555
|
+
textAlign: "center",
|
|
556
|
+
overflow: "hidden",
|
|
557
|
+
textOverflow: "ellipsis",
|
|
558
|
+
whiteSpace: "nowrap",
|
|
559
|
+
width: "100%"
|
|
560
|
+
},
|
|
561
|
+
children: cfg.description
|
|
562
|
+
})
|
|
563
|
+
]
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function ComingUpNextOverlay(param) {
|
|
567
|
+
var overlay = param.overlay, size = param.size;
|
|
568
|
+
var cfg = parseConfig(overlay.content);
|
|
569
|
+
if (!cfg) return null;
|
|
570
|
+
var f = Math.max(6, size.w * 0.05);
|
|
571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
572
|
+
style: {
|
|
573
|
+
width: "100%",
|
|
574
|
+
height: "100%",
|
|
575
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
576
|
+
display: "flex",
|
|
577
|
+
background: cfg.backgroundColor,
|
|
578
|
+
color: cfg.textColor,
|
|
579
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
580
|
+
overflow: "hidden",
|
|
581
|
+
pointerEvents: "none",
|
|
582
|
+
userSelect: "none",
|
|
583
|
+
fontSize: "".concat(f, "px")
|
|
584
|
+
},
|
|
585
|
+
children: [
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
587
|
+
style: {
|
|
588
|
+
width: Math.max(2, size.w * 0.015),
|
|
589
|
+
flexShrink: 0,
|
|
590
|
+
backgroundColor: cfg.accentColor
|
|
591
|
+
}
|
|
592
|
+
}),
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
594
|
+
style: {
|
|
595
|
+
flex: 1,
|
|
596
|
+
display: "flex",
|
|
597
|
+
flexDirection: "column",
|
|
598
|
+
justifyContent: "center",
|
|
599
|
+
padding: "".concat(f * 0.6, "px ").concat(f * 1, "px"),
|
|
600
|
+
minWidth: 0
|
|
601
|
+
},
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
604
|
+
style: {
|
|
605
|
+
fontSize: "0.8em",
|
|
606
|
+
fontWeight: 600,
|
|
607
|
+
textTransform: "uppercase",
|
|
608
|
+
letterSpacing: "0.05em",
|
|
609
|
+
color: cfg.accentColor
|
|
610
|
+
},
|
|
611
|
+
children: "Coming Up Next"
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
614
|
+
style: {
|
|
615
|
+
fontSize: "1.5em",
|
|
616
|
+
fontWeight: 700,
|
|
617
|
+
lineHeight: 1.2,
|
|
618
|
+
marginTop: f * 0.2,
|
|
619
|
+
overflow: "hidden",
|
|
620
|
+
textOverflow: "ellipsis",
|
|
621
|
+
whiteSpace: "nowrap"
|
|
622
|
+
},
|
|
623
|
+
children: cfg.title
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
626
|
+
style: {
|
|
627
|
+
fontSize: "0.9em",
|
|
628
|
+
opacity: 0.6,
|
|
629
|
+
overflow: "hidden",
|
|
630
|
+
textOverflow: "ellipsis",
|
|
631
|
+
whiteSpace: "nowrap"
|
|
632
|
+
},
|
|
633
|
+
children: cfg.subtitle
|
|
634
|
+
}),
|
|
635
|
+
cfg.scheduledTime && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
636
|
+
style: {
|
|
637
|
+
fontSize: "1em",
|
|
638
|
+
fontWeight: 600,
|
|
639
|
+
marginTop: f * 0.4,
|
|
640
|
+
color: cfg.accentColor
|
|
641
|
+
},
|
|
642
|
+
children: cfg.scheduledTime
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
})
|
|
646
|
+
]
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function ContextualTriggerOverlay(param) {
|
|
650
|
+
var overlay = param.overlay, size = param.size;
|
|
651
|
+
var cfg = parseConfig(overlay.content);
|
|
652
|
+
if (!cfg) return null;
|
|
653
|
+
var icons = {
|
|
654
|
+
alert: "\u26A0\uFE0F",
|
|
655
|
+
celebration: "\uD83C\uDF89",
|
|
656
|
+
info: "\u2139\uFE0F",
|
|
657
|
+
warning: "\uD83D\uDD14"
|
|
658
|
+
};
|
|
659
|
+
var f = Math.max(6, size.w * 0.05);
|
|
660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
661
|
+
style: {
|
|
662
|
+
width: "100%",
|
|
663
|
+
height: "100%",
|
|
664
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
665
|
+
display: "flex",
|
|
666
|
+
alignItems: "center",
|
|
667
|
+
gap: f * 0.8,
|
|
668
|
+
padding: "0 ".concat(f * 1.2, "px"),
|
|
669
|
+
background: cfg.backgroundColor,
|
|
670
|
+
color: cfg.textColor,
|
|
671
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
672
|
+
borderLeft: "".concat(Math.max(2, size.w * 0.02), "px solid ").concat(cfg.accentColor),
|
|
673
|
+
boxSizing: "border-box",
|
|
674
|
+
pointerEvents: "none",
|
|
675
|
+
userSelect: "none",
|
|
676
|
+
fontSize: "".concat(f, "px")
|
|
677
|
+
},
|
|
678
|
+
children: [
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
680
|
+
style: {
|
|
681
|
+
fontSize: "2em",
|
|
682
|
+
flexShrink: 0
|
|
683
|
+
},
|
|
684
|
+
children: icons[cfg.iconType] || "\u26A1"
|
|
685
|
+
}),
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
687
|
+
style: {
|
|
688
|
+
flex: 1,
|
|
689
|
+
minWidth: 0
|
|
690
|
+
},
|
|
691
|
+
children: [
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
693
|
+
style: {
|
|
694
|
+
fontSize: "1.3em",
|
|
695
|
+
fontWeight: 700,
|
|
696
|
+
overflow: "hidden",
|
|
697
|
+
textOverflow: "ellipsis",
|
|
698
|
+
whiteSpace: "nowrap"
|
|
699
|
+
},
|
|
700
|
+
children: cfg.headline
|
|
701
|
+
}),
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
703
|
+
style: {
|
|
704
|
+
fontSize: "0.9em",
|
|
705
|
+
opacity: 0.7,
|
|
706
|
+
overflow: "hidden",
|
|
707
|
+
textOverflow: "ellipsis",
|
|
708
|
+
whiteSpace: "nowrap"
|
|
709
|
+
},
|
|
710
|
+
children: cfg.message
|
|
711
|
+
})
|
|
712
|
+
]
|
|
713
|
+
})
|
|
714
|
+
]
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function OddsBettingOverlay(param) {
|
|
718
|
+
var overlay = param.overlay, size = param.size;
|
|
719
|
+
var cfg = parseConfig(overlay.content);
|
|
720
|
+
if (!cfg) return null;
|
|
721
|
+
var f = Math.max(6, size.w * 0.052);
|
|
722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
723
|
+
style: {
|
|
724
|
+
width: "100%",
|
|
725
|
+
height: "100%",
|
|
726
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
727
|
+
display: "flex",
|
|
728
|
+
flexDirection: "column",
|
|
729
|
+
padding: f * 0.8,
|
|
730
|
+
background: cfg.backgroundColor,
|
|
731
|
+
color: cfg.textColor,
|
|
732
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
733
|
+
boxSizing: "border-box",
|
|
734
|
+
pointerEvents: "none",
|
|
735
|
+
userSelect: "none",
|
|
736
|
+
fontSize: "".concat(f, "px")
|
|
737
|
+
},
|
|
738
|
+
children: [
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
740
|
+
style: {
|
|
741
|
+
fontSize: "0.9em",
|
|
742
|
+
fontWeight: 700,
|
|
743
|
+
textTransform: "uppercase",
|
|
744
|
+
letterSpacing: "0.05em",
|
|
745
|
+
color: cfg.accentColor,
|
|
746
|
+
marginBottom: f * 0.4
|
|
747
|
+
},
|
|
748
|
+
children: cfg.eventTitle
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
751
|
+
style: {
|
|
752
|
+
flex: 1,
|
|
753
|
+
display: "flex",
|
|
754
|
+
flexDirection: "column",
|
|
755
|
+
gap: f * 0.2,
|
|
756
|
+
justifyContent: "center"
|
|
757
|
+
},
|
|
758
|
+
children: (cfg.options || []).slice(0, 5).map(function(opt, i) {
|
|
759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
760
|
+
style: {
|
|
761
|
+
display: "flex",
|
|
762
|
+
justifyContent: "space-between",
|
|
763
|
+
alignItems: "center",
|
|
764
|
+
padding: "".concat(f * 0.2, "px ").concat(f * 0.6, "px"),
|
|
765
|
+
borderRadius: Math.max(2, f * 0.3),
|
|
766
|
+
background: "".concat(cfg.accentColor, "15"),
|
|
767
|
+
fontSize: "1em"
|
|
768
|
+
},
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
771
|
+
style: {
|
|
772
|
+
overflow: "hidden",
|
|
773
|
+
textOverflow: "ellipsis",
|
|
774
|
+
whiteSpace: "nowrap",
|
|
775
|
+
flex: 1
|
|
776
|
+
},
|
|
777
|
+
children: opt.label
|
|
778
|
+
}),
|
|
779
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
780
|
+
style: {
|
|
781
|
+
fontWeight: 700,
|
|
782
|
+
marginLeft: f * 0.8,
|
|
783
|
+
flexShrink: 0,
|
|
784
|
+
color: cfg.accentColor
|
|
785
|
+
},
|
|
786
|
+
children: opt.odds
|
|
787
|
+
})
|
|
788
|
+
]
|
|
789
|
+
}, i);
|
|
790
|
+
})
|
|
791
|
+
}),
|
|
792
|
+
cfg.sponsorText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
793
|
+
style: {
|
|
794
|
+
fontSize: "0.7em",
|
|
795
|
+
opacity: 0.4,
|
|
796
|
+
textAlign: "center",
|
|
797
|
+
marginTop: f * 0.4
|
|
798
|
+
},
|
|
799
|
+
children: cfg.sponsorText
|
|
800
|
+
})
|
|
801
|
+
]
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
function BreakingNewsOverlay(param) {
|
|
805
|
+
var overlay = param.overlay, size = param.size;
|
|
806
|
+
var cfg = parseConfig(overlay.content);
|
|
807
|
+
if (!cfg) return null;
|
|
808
|
+
var urgencyColors = {
|
|
809
|
+
breaking: "#dc2626",
|
|
810
|
+
urgent: "#ea580c",
|
|
811
|
+
normal: "#2563eb"
|
|
812
|
+
};
|
|
813
|
+
var labelBg = urgencyColors[cfg.urgency] || urgencyColors.normal;
|
|
814
|
+
var label = cfg.urgency === "breaking" ? "BREAKING" : cfg.urgency === "urgent" ? "URGENT" : "NEWS";
|
|
815
|
+
var f = Math.max(6, size.w * 0.05);
|
|
816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
817
|
+
style: {
|
|
818
|
+
width: "100%",
|
|
819
|
+
height: "100%",
|
|
820
|
+
borderRadius: Math.max(2, size.w * 0.02),
|
|
821
|
+
display: "flex",
|
|
822
|
+
alignItems: "center",
|
|
823
|
+
background: cfg.backgroundColor,
|
|
824
|
+
color: cfg.textColor,
|
|
825
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
826
|
+
overflow: "hidden",
|
|
827
|
+
pointerEvents: "none",
|
|
828
|
+
userSelect: "none",
|
|
829
|
+
fontSize: "".concat(f, "px")
|
|
830
|
+
},
|
|
831
|
+
children: [
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
833
|
+
style: {
|
|
834
|
+
padding: "0 ".concat(f * 0.8, "px"),
|
|
835
|
+
height: "100%",
|
|
836
|
+
display: "flex",
|
|
837
|
+
alignItems: "center",
|
|
838
|
+
background: labelBg,
|
|
839
|
+
color: "#fff",
|
|
840
|
+
fontSize: "1em",
|
|
841
|
+
fontWeight: 900,
|
|
842
|
+
textTransform: "uppercase",
|
|
843
|
+
letterSpacing: "0.05em",
|
|
844
|
+
flexShrink: 0
|
|
845
|
+
},
|
|
846
|
+
children: label
|
|
847
|
+
}),
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
849
|
+
style: {
|
|
850
|
+
flex: 1,
|
|
851
|
+
padding: "0 ".concat(f * 1, "px"),
|
|
852
|
+
minWidth: 0
|
|
853
|
+
},
|
|
854
|
+
children: [
|
|
855
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
856
|
+
style: {
|
|
857
|
+
fontSize: "1.3em",
|
|
858
|
+
fontWeight: 700,
|
|
859
|
+
overflow: "hidden",
|
|
860
|
+
textOverflow: "ellipsis",
|
|
861
|
+
whiteSpace: "nowrap"
|
|
862
|
+
},
|
|
863
|
+
children: cfg.headline
|
|
864
|
+
}),
|
|
865
|
+
cfg.body && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
866
|
+
style: {
|
|
867
|
+
fontSize: "0.9em",
|
|
868
|
+
opacity: 0.7,
|
|
869
|
+
overflow: "hidden",
|
|
870
|
+
textOverflow: "ellipsis",
|
|
871
|
+
whiteSpace: "nowrap"
|
|
872
|
+
},
|
|
873
|
+
children: cfg.body
|
|
874
|
+
})
|
|
875
|
+
]
|
|
876
|
+
})
|
|
877
|
+
]
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
function CountdownOverlay(param) {
|
|
881
|
+
var overlay = param.overlay, size = param.size;
|
|
882
|
+
var cfg = parseConfig(overlay.content);
|
|
883
|
+
var _ref = _sliced_to_array((0, import_react.useState)({
|
|
884
|
+
d: 0,
|
|
885
|
+
h: 0,
|
|
886
|
+
m: 0,
|
|
887
|
+
s: 0
|
|
888
|
+
}), 2), remaining = _ref[0], setRemaining = _ref[1];
|
|
889
|
+
(0, import_react.useEffect)(function() {
|
|
890
|
+
if (!cfg) return;
|
|
891
|
+
var update = function update() {
|
|
892
|
+
var target = new Date(cfg.targetTime).getTime();
|
|
893
|
+
var now = Date.now();
|
|
894
|
+
var diff = Math.max(0, target - now);
|
|
895
|
+
setRemaining({
|
|
896
|
+
d: Math.floor(diff / 864e5),
|
|
897
|
+
h: Math.floor(diff % 864e5 / 36e5),
|
|
898
|
+
m: Math.floor(diff % 36e5 / 6e4),
|
|
899
|
+
s: Math.floor(diff % 6e4 / 1e3)
|
|
900
|
+
});
|
|
901
|
+
};
|
|
902
|
+
update();
|
|
903
|
+
var id = setInterval(update, 1e3);
|
|
904
|
+
return function() {
|
|
905
|
+
return clearInterval(id);
|
|
906
|
+
};
|
|
907
|
+
}, [
|
|
908
|
+
cfg === null || cfg === void 0 ? void 0 : cfg.targetTime
|
|
909
|
+
]);
|
|
910
|
+
if (!cfg) return null;
|
|
911
|
+
var f = Math.max(6, size.w * 0.055);
|
|
912
|
+
var pad = function pad(n) {
|
|
913
|
+
return String(n).padStart(2, "0");
|
|
914
|
+
};
|
|
915
|
+
var units = [
|
|
916
|
+
{
|
|
917
|
+
show: cfg.showDays,
|
|
918
|
+
value: pad(remaining.d),
|
|
919
|
+
label: "DAYS"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
show: cfg.showHours,
|
|
923
|
+
value: pad(remaining.h),
|
|
924
|
+
label: "HRS"
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
show: cfg.showMinutes,
|
|
928
|
+
value: pad(remaining.m),
|
|
929
|
+
label: "MIN"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
show: cfg.showSeconds,
|
|
933
|
+
value: pad(remaining.s),
|
|
934
|
+
label: "SEC"
|
|
935
|
+
}
|
|
936
|
+
];
|
|
937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
938
|
+
style: {
|
|
939
|
+
width: "100%",
|
|
940
|
+
height: "100%",
|
|
941
|
+
borderRadius: Math.max(2, size.w * 0.035),
|
|
942
|
+
display: "flex",
|
|
943
|
+
flexDirection: "column",
|
|
944
|
+
alignItems: "center",
|
|
945
|
+
justifyContent: "center",
|
|
946
|
+
padding: f * 0.8,
|
|
947
|
+
background: cfg.backgroundColor,
|
|
948
|
+
color: cfg.textColor,
|
|
949
|
+
fontFamily: "Roboto, 'Segoe UI', Arial, sans-serif",
|
|
950
|
+
boxSizing: "border-box",
|
|
951
|
+
pointerEvents: "none",
|
|
952
|
+
userSelect: "none",
|
|
953
|
+
fontSize: "".concat(f, "px")
|
|
954
|
+
},
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
957
|
+
style: {
|
|
958
|
+
fontSize: "0.8em",
|
|
959
|
+
fontWeight: 600,
|
|
960
|
+
textTransform: "uppercase",
|
|
961
|
+
letterSpacing: "0.05em",
|
|
962
|
+
color: cfg.accentColor,
|
|
963
|
+
marginBottom: f * 0.4
|
|
964
|
+
},
|
|
965
|
+
children: cfg.eventName
|
|
966
|
+
}),
|
|
967
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
968
|
+
style: {
|
|
969
|
+
display: "flex",
|
|
970
|
+
gap: f * 0.6,
|
|
971
|
+
alignItems: "center"
|
|
972
|
+
},
|
|
973
|
+
children: units.filter(function(u) {
|
|
974
|
+
return u.show;
|
|
975
|
+
}).map(function(u, i, arr) {
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, {
|
|
977
|
+
children: [
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
979
|
+
style: {
|
|
980
|
+
textAlign: "center"
|
|
981
|
+
},
|
|
982
|
+
children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
984
|
+
style: {
|
|
985
|
+
fontSize: "2em",
|
|
986
|
+
fontWeight: 900,
|
|
987
|
+
lineHeight: 1,
|
|
988
|
+
borderRadius: Math.max(2, f * 0.4),
|
|
989
|
+
padding: "".concat(f * 0.2, "px ").concat(f * 0.4, "px"),
|
|
990
|
+
background: "".concat(cfg.accentColor, "20")
|
|
991
|
+
},
|
|
992
|
+
children: u.value
|
|
993
|
+
}),
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
995
|
+
style: {
|
|
996
|
+
fontSize: "0.5em",
|
|
997
|
+
opacity: 0.5,
|
|
998
|
+
marginTop: f * 0.2
|
|
999
|
+
},
|
|
1000
|
+
children: u.label
|
|
1001
|
+
})
|
|
1002
|
+
]
|
|
1003
|
+
}),
|
|
1004
|
+
i < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1005
|
+
style: {
|
|
1006
|
+
fontSize: "1.8em",
|
|
1007
|
+
fontWeight: 700,
|
|
1008
|
+
opacity: 0.3
|
|
1009
|
+
},
|
|
1010
|
+
children: ":"
|
|
1011
|
+
})
|
|
1012
|
+
]
|
|
1013
|
+
}, u.label);
|
|
1014
|
+
})
|
|
1015
|
+
}),
|
|
1016
|
+
cfg.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1017
|
+
style: {
|
|
1018
|
+
fontSize: "0.8em",
|
|
1019
|
+
opacity: 0.6,
|
|
1020
|
+
marginTop: f * 0.4,
|
|
1021
|
+
textAlign: "center"
|
|
1022
|
+
},
|
|
1023
|
+
children: cfg.message
|
|
1024
|
+
})
|
|
1025
|
+
]
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
function ShapeOverlay(param) {
|
|
1029
|
+
var overlay = param.overlay, size = param.size;
|
|
1030
|
+
var f = Math.max(6, size.w * 0.05);
|
|
1031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1032
|
+
style: {
|
|
1033
|
+
width: "100%",
|
|
1034
|
+
height: "100%",
|
|
1035
|
+
borderRadius: Math.max(2, size.w * 0.03),
|
|
1036
|
+
background: "rgba(99, 102, 241, 0.2)",
|
|
1037
|
+
border: "2px solid rgba(99, 102, 241, 0.4)",
|
|
1038
|
+
display: "flex",
|
|
1039
|
+
alignItems: "center",
|
|
1040
|
+
justifyContent: "center",
|
|
1041
|
+
pointerEvents: "none",
|
|
1042
|
+
userSelect: "none"
|
|
1043
|
+
},
|
|
1044
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1045
|
+
style: {
|
|
1046
|
+
fontSize: "".concat(f, "px"),
|
|
1047
|
+
fontWeight: 500,
|
|
1048
|
+
color: "rgba(163, 163, 163, 0.8)",
|
|
1049
|
+
textTransform: "uppercase"
|
|
1050
|
+
},
|
|
1051
|
+
children: overlay.name
|
|
1052
|
+
})
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
298
1055
|
function hexToRgb(hex) {
|
|
299
1056
|
if (!hex || !hex.startsWith("#")) return "0,0,0";
|
|
300
1057
|
var clean = hex.slice(1);
|
|
@@ -359,6 +1116,10 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
359
1116
|
var width = overlay.width * scaleX;
|
|
360
1117
|
var height = overlay.height * scaleY;
|
|
361
1118
|
var opacity = Math.max(0, Math.min(100, overlay.opacity)) / 100;
|
|
1119
|
+
var sz = {
|
|
1120
|
+
w: width,
|
|
1121
|
+
h: height
|
|
1122
|
+
};
|
|
362
1123
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
363
1124
|
style: {
|
|
364
1125
|
position: "absolute",
|
|
@@ -379,6 +1140,42 @@ var OverlayRenderer = function OverlayRenderer(param) {
|
|
|
379
1140
|
}),
|
|
380
1141
|
overlay.type === "scroller" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollerOverlay, {
|
|
381
1142
|
overlay: overlay
|
|
1143
|
+
}),
|
|
1144
|
+
overlay.type === "shape" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShapeOverlay, {
|
|
1145
|
+
overlay: overlay,
|
|
1146
|
+
size: sz
|
|
1147
|
+
}),
|
|
1148
|
+
overlay.type === "score_bug" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScoreBugOverlay, {
|
|
1149
|
+
overlay: overlay,
|
|
1150
|
+
size: sz
|
|
1151
|
+
}),
|
|
1152
|
+
overlay.type === "lower_third" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LowerThirdOverlay, {
|
|
1153
|
+
overlay: overlay,
|
|
1154
|
+
size: sz
|
|
1155
|
+
}),
|
|
1156
|
+
overlay.type === "qr_code" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCodeOverlay, {
|
|
1157
|
+
overlay: overlay,
|
|
1158
|
+
size: sz
|
|
1159
|
+
}),
|
|
1160
|
+
overlay.type === "coming_up_next" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComingUpNextOverlay, {
|
|
1161
|
+
overlay: overlay,
|
|
1162
|
+
size: sz
|
|
1163
|
+
}),
|
|
1164
|
+
overlay.type === "contextual_trigger" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContextualTriggerOverlay, {
|
|
1165
|
+
overlay: overlay,
|
|
1166
|
+
size: sz
|
|
1167
|
+
}),
|
|
1168
|
+
overlay.type === "odds_betting" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OddsBettingOverlay, {
|
|
1169
|
+
overlay: overlay,
|
|
1170
|
+
size: sz
|
|
1171
|
+
}),
|
|
1172
|
+
overlay.type === "breaking_news" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreakingNewsOverlay, {
|
|
1173
|
+
overlay: overlay,
|
|
1174
|
+
size: sz
|
|
1175
|
+
}),
|
|
1176
|
+
overlay.type === "countdown" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CountdownOverlay, {
|
|
1177
|
+
overlay: overlay,
|
|
1178
|
+
size: sz
|
|
382
1179
|
})
|
|
383
1180
|
]
|
|
384
1181
|
}, overlay.id);
|