@mottosports/motto-video-player 1.0.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/README.md +233 -0
- package/dist/index.d.mts +499 -0
- package/dist/index.d.ts +499 -0
- package/dist/index.js +2631 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2590 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +73 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2631 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
CreativeWork: () => CreativeWork,
|
|
35
|
+
Event: () => Event,
|
|
36
|
+
Player: () => Player,
|
|
37
|
+
QueryProvider: () => QueryProvider,
|
|
38
|
+
Video: () => Video,
|
|
39
|
+
queryClient: () => queryClient
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
|
+
|
|
43
|
+
// #style-inject:#style-inject
|
|
44
|
+
function styleInject(css, { insertAt } = {}) {
|
|
45
|
+
if (!css || typeof document === "undefined") return;
|
|
46
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
47
|
+
const style = document.createElement("style");
|
|
48
|
+
style.type = "text/css";
|
|
49
|
+
if (insertAt === "top") {
|
|
50
|
+
if (head.firstChild) {
|
|
51
|
+
head.insertBefore(style, head.firstChild);
|
|
52
|
+
} else {
|
|
53
|
+
head.appendChild(style);
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
head.appendChild(style);
|
|
57
|
+
}
|
|
58
|
+
if (style.styleSheet) {
|
|
59
|
+
style.styleSheet.cssText = css;
|
|
60
|
+
} else {
|
|
61
|
+
style.appendChild(document.createTextNode(css));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/index.css
|
|
66
|
+
styleInject('/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-red-600: oklch(57.7% 0.245 27.325);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --text-5xl: 3rem;\n --text-5xl--line-height: 1;\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-wide: 0.025em;\n --tracking-widest: 0.1em;\n --radius-md: 0.375rem;\n --radius-2xl: 1rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --aspect-video: 16 / 9;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-auto {\n pointer-events: auto;\n }\n .pointer-events-none {\n pointer-events: none;\n }\n .visible {\n visibility: visible;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .static {\n position: static;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-4 {\n top: calc(var(--spacing) * 4);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-4 {\n right: calc(var(--spacing) * 4);\n }\n .bottom-0 {\n bottom: calc(var(--spacing) * 0);\n }\n .bottom-4 {\n bottom: calc(var(--spacing) * 4);\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-4 {\n left: calc(var(--spacing) * 4);\n }\n .z-10 {\n z-index: 10;\n }\n .z-50 {\n z-index: 50;\n }\n .container {\n width: 100%;\n @media (width >= 40rem) {\n max-width: 40rem;\n }\n @media (width >= 48rem) {\n max-width: 48rem;\n }\n @media (width >= 64rem) {\n max-width: 64rem;\n }\n @media (width >= 80rem) {\n max-width: 80rem;\n }\n @media (width >= 96rem) {\n max-width: 96rem;\n }\n }\n .m-6 {\n margin: calc(var(--spacing) * 6);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-3 {\n margin-top: calc(var(--spacing) * 3);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6);\n }\n .flex {\n display: flex;\n }\n .grid {\n display: grid;\n }\n .hidden {\n display: none;\n }\n .aspect-video {\n aspect-ratio: var(--aspect-video);\n }\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-24 {\n height: calc(var(--spacing) * 24);\n }\n .h-full {\n height: 100%;\n }\n .w-2 {\n width: calc(var(--spacing) * 2);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-full {\n width: 100%;\n }\n .animate-pulse {\n animation: var(--animate-pulse);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .auto-cols-max {\n grid-auto-columns: max-content;\n }\n .grid-flow-col {\n grid-auto-flow: column;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-stretch {\n justify-content: stretch;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .border-b-2 {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 2px;\n }\n .border-white {\n border-color: var(--color-white);\n }\n .bg-\\[\\#151515\\] {\n background-color: #151515;\n }\n .bg-black {\n background-color: var(--color-black);\n }\n .bg-red-600 {\n background-color: var(--color-red-600);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-gradient-to-t {\n --tw-gradient-position: to top in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black\\/70 {\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\n }\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .bg-cover {\n background-size: cover;\n }\n .bg-center {\n background-position: center;\n }\n .bg-no-repeat {\n background-repeat: no-repeat;\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .font-mono {\n font-family: var(--font-mono);\n }\n .text-2xl {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n .text-5xl {\n font-size: var(--text-5xl);\n line-height: var(--tw-leading, var(--text-5xl--line-height));\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .tracking-wide {\n --tw-tracking: var(--tracking-wide);\n letter-spacing: var(--tracking-wide);\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest);\n letter-spacing: var(--tracking-widest);\n }\n .text-white {\n color: var(--color-white);\n }\n .uppercase {\n text-transform: uppercase;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .filter {\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n }\n .md\\:rounded-2xl {\n @media (width >= 48rem) {\n border-radius: var(--radius-2xl);\n }\n }\n .md\\:rounded-2xl\\! {\n @media (width >= 48rem) {\n border-radius: var(--radius-2xl) !important;\n }\n }\n .md\\:text-base {\n @media (width >= 48rem) {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .md\\:text-xl {\n @media (width >= 48rem) {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n }\n}\n@layer components {\n .motto-video-container {\n position: relative;\n width: 100%;\n min-height: 300px;\n }\n @supports (aspect-ratio: 16/9) {\n .motto-video-container {\n min-height: auto;\n }\n }\n .motto-video-responsive {\n position: absolute;\n top: calc(var(--spacing) * 0);\n left: calc(var(--spacing) * 0);\n height: 100%;\n width: 100%;\n }\n .motto-skip-button {\n position: absolute;\n top: calc(1/2 * 100%);\n z-index: 10;\n display: flex;\n height: calc(var(--spacing) * 16);\n width: calc(var(--spacing) * 16);\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n cursor: pointer;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 70%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\n }\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n color: var(--color-white);\n opacity: 80%;\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n &:hover {\n @media (hover: hover) {\n --tw-scale-x: 110%;\n --tw-scale-y: 110%;\n --tw-scale-z: 110%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n }\n &:hover {\n @media (hover: hover) {\n opacity: 100%;\n }\n }\n &:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n }\n .motto-skip-button-back {\n left: calc(var(--spacing) * 5);\n }\n .motto-skip-button-forward {\n right: calc(var(--spacing) * 5);\n }\n .motto-mobile-controls-overlay {\n position: absolute;\n inset: calc(var(--spacing) * 0);\n z-index: 20;\n display: flex;\n align-items: center;\n justify-content: center;\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 300ms;\n transition-duration: 300ms;\n pointer-events: none;\n }\n .motto-mobile-controls-group {\n display: flex;\n align-items: center;\n gap: calc(var(--spacing) * 8);\n opacity: 100%;\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: none;\n }\n .motto-mobile-play-button {\n display: flex;\n height: calc(var(--spacing) * 14);\n width: calc(var(--spacing) * 14);\n cursor: pointer;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 30%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\n }\n color: var(--color-white);\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: auto;\n }\n .motto-mobile-play-button:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n .motto-mobile-play-button svg {\n height: calc(var(--spacing) * 7);\n width: calc(var(--spacing) * 7);\n }\n .motto-mobile-skip-button {\n display: flex;\n height: calc(var(--spacing) * 10);\n width: calc(var(--spacing) * 10);\n cursor: pointer;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 30%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\n }\n color: var(--color-white);\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: auto;\n }\n .motto-mobile-skip-button:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n .motto-mobile-skip-button svg {\n height: calc(var(--spacing) * 6);\n width: calc(var(--spacing) * 6);\n }\n}\n@media (min-width: 768px) {\n .motto-mobile-controls-overlay {\n display: none !important;\n }\n}\n@media (max-width: 767px) {\n .shaka-controls-container .motto-native-skip-button,\n .shaka-controls-container .motto-skip-back-button,\n .shaka-controls-container .motto-skip-forward-button,\n .shaka-controls-container .shaka-button[title*="Skip back"],\n .shaka-controls-container .shaka-button[title*="Skip forward"],\n .shaka-controls-container .shaka-button[aria-label*="Skip back"],\n .shaka-controls-container .shaka-button[aria-label*="Skip forward"],\n .shaka-controls-container button[title*="Skip back"],\n .shaka-controls-container button[title*="Skip forward"],\n .shaka-controls-container button[aria-label*="Skip back"],\n .shaka-controls-container button[aria-label*="Skip forward"],\n .motto-native-skip-button:not(.motto-mobile-skip-button),\n .motto-skip-back-button:not(.motto-mobile-skip-button),\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\n .shaka-button[title*="Skip back"]:not(.motto-mobile-skip-button),\n .shaka-button[title*="Skip forward"]:not(.motto-mobile-skip-button),\n .shaka-button[aria-label*="Skip back"]:not(.motto-mobile-skip-button),\n .shaka-button[aria-label*="Skip forward"]:not(.motto-mobile-skip-button),\n button[title*="Skip back"]:not(.motto-mobile-skip-button),\n button[title*="Skip forward"]:not(.motto-mobile-skip-button),\n button[aria-label*="Skip back"]:not(.motto-mobile-skip-button),\n button[aria-label*="Skip forward"]:not(.motto-mobile-skip-button) {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n width: 0 !important;\n height: 0 !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n .shaka-controls-container {\n z-index: 90 !important;\n height: 100px !important;\n bottom: 0 !important;\n top: unset !important;\n }\n .motto-mobile-skip-button {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important;\n }\n}\n.shaka-seek-bar-container {\n height: 6px !important;\n width: 100% !important;\n margin: 8px 0 !important;\n border-radius: 4px !important;\n position: relative !important;\n border-top: none !important;\n border-bottom: none !important;\n box-shadow: none !important;\n}\n.shaka-seek-bar {\n height: 6px !important;\n width: 100% !important;\n -webkit-appearance: none !important;\n appearance: none !important;\n background: transparent !important;\n cursor: pointer !important;\n border: none !important;\n outline: none !important;\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n border-radius: 4px !important;\n}\n.shaka-seek-bar::-webkit-slider-runnable-track {\n height: 6px !important;\n background: transparent !important;\n border-radius: 4px !important;\n border: none !important;\n}\n.shaka-seek-bar::-moz-range-track {\n height: 6px !important;\n background: transparent !important;\n border-radius: 4px !important;\n border: none !important;\n}\n.shaka-seek-bar::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 16px !important;\n height: 16px !important;\n border-radius: 50% !important;\n background: #ffffff !important;\n cursor: pointer !important;\n border: 2px solid #ffffff !important;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\n margin-top: -4px !important;\n}\n.shaka-seek-bar::-moz-range-thumb {\n width: 16px !important;\n height: 16px !important;\n border-radius: 50% !important;\n background: #ffffff !important;\n cursor: pointer !important;\n border: 2px solid #ffffff !important;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\n margin-top: -4px !important;\n}\n.motto-skip-back-button,\n.motto-skip-forward-button,\n.motto-native-skip-button {\n background: transparent !important;\n border: none !important;\n padding: 4px !important;\n margin: 0px !important;\n cursor: pointer !important;\n color: #ffffff !important;\n transition: all 0.2s ease !important;\n min-width: 32px !important;\n height: 32px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n border-radius: 4px !important;\n width: 25px;\n}\n.motto-skip-back-button:hover,\n.motto-skip-forward-button:hover,\n.motto-native-skip-button:hover {\n opacity: 0.8 !important;\n background: transparent !important;\n transform: scale(1.05) !important;\n}\n.motto-skip-back-button:active,\n.motto-skip-forward-button:active,\n.motto-native-skip-button:active {\n transform: scale(0.95) !important;\n}\n.motto-skip-back-button svg,\n.motto-skip-forward-button svg,\n.motto-native-skip-button svg {\n width: 24px !important;\n height: 24px !important;\n}\n@media (max-width: 767px) {\n .shaka-controls-container .motto-native-skip-button,\n .shaka-controls-container .motto-skip-back-button,\n .shaka-controls-container .motto-skip-forward-button,\n .shaka-controls-container .shaka-play-button,\n .shaka-controls-container .shaka-pause-button {\n display: none !important;\n }\n}\n.shaka-spinner-svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-spinner-path {\n stroke: white !important;\n fill: none !important;\n}\n.shaka-spinner-container {\n color: white !important;\n}\n.shaka-buffering-spinner {\n color: white !important;\n fill: white !important;\n}\n.shaka-buffering-spinner svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-buffering-spinner path {\n stroke: white !important;\n fill: none !important;\n}\n[data-shaka-player-container] .shaka-spinner,\n[data-shaka-player-container] .spinner {\n color: white !important;\n border-color: white !important;\n}\n.material-icons.shaka-spinner {\n color: white !important;\n}\n.shaka-controls-container .shaka-spinner,\n.shaka-video-container .shaka-spinner {\n color: white !important;\n fill: white !important;\n}\n.shaka-controls-container .shaka-spinner svg,\n.shaka-video-container .shaka-spinner svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-controls-container .shaka-spinner path,\n.shaka-video-container .shaka-spinner path {\n stroke: white !important;\n}\n.motto-video-loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background:\n linear-gradient(\n 135deg,\n #1a1a1a 0%,\n #2d2d2d 100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10;\n transition: opacity 0.3s ease;\n}\n.motto-video-loading-overlay.hidden {\n opacity: 0;\n pointer-events: none;\n}\n.motto-video-loading-content {\n text-align: center;\n color: white;\n}\n.motto-video-loading-icon {\n width: 64px;\n height: 64px;\n margin-bottom: 16px;\n opacity: 0.7;\n}\n.motto-video-loading-text {\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 8px;\n}\n.motto-video-loading-subtext {\n font-size: 14px;\n opacity: 0.7;\n}\n@keyframes pulse-live {\n 0% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.shaka-play-button-container {\n display: none !important;\n}\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-gradient-position { syntax: "*"; inherits: false; }\n@property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-via-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }\n@property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }\n@property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-tracking { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-blur { syntax: "*"; inherits: false; }\n@property --tw-brightness { syntax: "*"; inherits: false; }\n@property --tw-contrast { syntax: "*"; inherits: false; }\n@property --tw-grayscale { syntax: "*"; inherits: false; }\n@property --tw-hue-rotate { syntax: "*"; inherits: false; }\n@property --tw-invert { syntax: "*"; inherits: false; }\n@property --tw-opacity { syntax: "*"; inherits: false; }\n@property --tw-saturate { syntax: "*"; inherits: false; }\n@property --tw-sepia { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }\n@property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-duration { syntax: "*"; inherits: false; }\n@property --tw-scale-x { syntax: "*"; inherits: false; initial-value: 1; }\n@property --tw-scale-y { syntax: "*"; inherits: false; initial-value: 1; }\n@property --tw-scale-z { syntax: "*"; inherits: false; initial-value: 1; }\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-duration: initial;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-scale-z: 1;\n }\n }\n}\n');
|
|
67
|
+
|
|
68
|
+
// src/Player.tsx
|
|
69
|
+
var import_react11 = require("react");
|
|
70
|
+
var import_shaka_player4 = __toESM(require("shaka-player/dist/shaka-player.ui"));
|
|
71
|
+
|
|
72
|
+
// src/hooks/useShakePlayer.ts
|
|
73
|
+
var import_react = require("react");
|
|
74
|
+
var import_shaka_player = require("shaka-player/dist/shaka-player.ui");
|
|
75
|
+
var useShakePlayer = ({
|
|
76
|
+
src,
|
|
77
|
+
shakaConfig,
|
|
78
|
+
drmConfig,
|
|
79
|
+
onError,
|
|
80
|
+
onPlayerReady
|
|
81
|
+
}) => {
|
|
82
|
+
const playerRef = (0, import_react.useRef)(null);
|
|
83
|
+
const initializePlayer = (0, import_react.useCallback)(async (video) => {
|
|
84
|
+
try {
|
|
85
|
+
import_shaka_player.polyfill.installAll();
|
|
86
|
+
if (!import_shaka_player.Player.isBrowserSupported()) {
|
|
87
|
+
throw new Error("Browser not supported by Shaka Player");
|
|
88
|
+
}
|
|
89
|
+
const player = new import_shaka_player.Player();
|
|
90
|
+
playerRef.current = player;
|
|
91
|
+
await player.attach(video);
|
|
92
|
+
if (shakaConfig) {
|
|
93
|
+
player.configure(shakaConfig);
|
|
94
|
+
}
|
|
95
|
+
if (drmConfig) {
|
|
96
|
+
if (drmConfig.clearKeys) {
|
|
97
|
+
player.configure({ "drm.clearKeys": drmConfig.clearKeys });
|
|
98
|
+
}
|
|
99
|
+
if (drmConfig.servers) {
|
|
100
|
+
player.configure({ "drm.servers": drmConfig.servers });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
player.addEventListener("error", (event) => {
|
|
104
|
+
const error = event.detail;
|
|
105
|
+
console.error("Shaka Player Error:", error);
|
|
106
|
+
onError?.(new Error(`Shaka Player Error: ${error.message || "Unknown error"}`));
|
|
107
|
+
});
|
|
108
|
+
await player.load(src);
|
|
109
|
+
onPlayerReady?.(player);
|
|
110
|
+
return player;
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error("Error initializing Shaka Player:", error);
|
|
113
|
+
onError?.(error);
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}, [shakaConfig, drmConfig, src, onError, onPlayerReady]);
|
|
117
|
+
const destroyPlayer = (0, import_react.useCallback)(async () => {
|
|
118
|
+
if (playerRef.current) {
|
|
119
|
+
try {
|
|
120
|
+
await playerRef.current.destroy();
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.warn("Error destroying Shaka Player:", error);
|
|
123
|
+
} finally {
|
|
124
|
+
playerRef.current = null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, []);
|
|
128
|
+
return {
|
|
129
|
+
playerRef,
|
|
130
|
+
initializePlayer,
|
|
131
|
+
destroyPlayer
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/hooks/useQualityControl.ts
|
|
136
|
+
var import_react2 = require("react");
|
|
137
|
+
var useQualityControl = (playerRef, qualityConfig, onQualityChange) => {
|
|
138
|
+
const getAvailableQualities = (0, import_react2.useCallback)(() => {
|
|
139
|
+
if (!playerRef.current) return [];
|
|
140
|
+
const tracks = playerRef.current.getVariantTracks();
|
|
141
|
+
const qualities = tracks.filter(
|
|
142
|
+
(track, index, self) => index === self.findIndex((t) => t.height === track.height)
|
|
143
|
+
).map((track) => ({
|
|
144
|
+
height: track.height || 0,
|
|
145
|
+
bandwidth: track.bandwidth || 0,
|
|
146
|
+
label: `${track.height}p`
|
|
147
|
+
})).sort((a, b) => b.height - a.height);
|
|
148
|
+
return qualities;
|
|
149
|
+
}, [playerRef]);
|
|
150
|
+
const setQuality = (0, import_react2.useCallback)((height) => {
|
|
151
|
+
if (!playerRef.current) return;
|
|
152
|
+
if (height === 0) {
|
|
153
|
+
playerRef.current.configure({
|
|
154
|
+
abr: { enabled: true }
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
playerRef.current.configure({
|
|
158
|
+
abr: { enabled: false }
|
|
159
|
+
});
|
|
160
|
+
const tracks = playerRef.current.getVariantTracks();
|
|
161
|
+
const targetTrack = tracks.find((track) => track.height === height);
|
|
162
|
+
if (targetTrack) {
|
|
163
|
+
playerRef.current.selectVariantTrack(
|
|
164
|
+
targetTrack,
|
|
165
|
+
/* clearBuffer= */
|
|
166
|
+
true
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}, [playerRef]);
|
|
171
|
+
const setupQualityTracking = (0, import_react2.useCallback)(() => {
|
|
172
|
+
if (!playerRef.current || !onQualityChange) return;
|
|
173
|
+
const handleQualityChange = () => {
|
|
174
|
+
const activeTrack = playerRef.current.getVariantTracks().find((track) => track.active);
|
|
175
|
+
if (activeTrack) {
|
|
176
|
+
onQualityChange({
|
|
177
|
+
height: activeTrack.height || 0,
|
|
178
|
+
bandwidth: activeTrack.bandwidth || 0
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
playerRef.current.addEventListener("variantchanged", handleQualityChange);
|
|
183
|
+
return () => {
|
|
184
|
+
playerRef.current?.removeEventListener("variantchanged", handleQualityChange);
|
|
185
|
+
};
|
|
186
|
+
}, [playerRef, onQualityChange]);
|
|
187
|
+
const configureQuality = (0, import_react2.useCallback)(() => {
|
|
188
|
+
if (!playerRef.current || !qualityConfig) return;
|
|
189
|
+
if (qualityConfig.enableAdaptation !== void 0) {
|
|
190
|
+
playerRef.current.configure({
|
|
191
|
+
abr: { enabled: qualityConfig.enableAdaptation }
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (qualityConfig.selectedQuality !== void 0) {
|
|
195
|
+
setQuality(qualityConfig.selectedQuality);
|
|
196
|
+
}
|
|
197
|
+
}, [playerRef, qualityConfig, setQuality]);
|
|
198
|
+
return {
|
|
199
|
+
getAvailableQualities,
|
|
200
|
+
setQuality,
|
|
201
|
+
setupQualityTracking,
|
|
202
|
+
configureQuality
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/hooks/useSkipControls.ts
|
|
207
|
+
var import_react3 = require("react");
|
|
208
|
+
var useSkipControls = (videoRef, onSkipBack, onSkipForward) => {
|
|
209
|
+
const skipDuration = 15;
|
|
210
|
+
const skipBack = (0, import_react3.useCallback)(() => {
|
|
211
|
+
const video = videoRef.current;
|
|
212
|
+
if (!video) return;
|
|
213
|
+
const newTime = Math.max(0, video.currentTime - skipDuration);
|
|
214
|
+
video.currentTime = newTime;
|
|
215
|
+
onSkipBack?.(newTime);
|
|
216
|
+
}, [videoRef, onSkipBack]);
|
|
217
|
+
const skipForward = (0, import_react3.useCallback)(() => {
|
|
218
|
+
const video = videoRef.current;
|
|
219
|
+
if (!video) return;
|
|
220
|
+
const newTime = Math.min(video.duration || 0, video.currentTime + skipDuration);
|
|
221
|
+
video.currentTime = newTime;
|
|
222
|
+
onSkipForward?.(newTime);
|
|
223
|
+
}, [videoRef, onSkipForward]);
|
|
224
|
+
const shouldShowSkipControls = (0, import_react3.useCallback)(() => {
|
|
225
|
+
return true;
|
|
226
|
+
}, []);
|
|
227
|
+
return {
|
|
228
|
+
skipBack,
|
|
229
|
+
skipForward,
|
|
230
|
+
skipDuration,
|
|
231
|
+
shouldShowSkipControls
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// src/hooks/useMuxAnalytics.ts
|
|
236
|
+
var import_react4 = require("react");
|
|
237
|
+
var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
238
|
+
var import_shaka_player2 = __toESM(require("shaka-player/dist/shaka-player.ui"));
|
|
239
|
+
var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
|
|
240
|
+
const shakaPlayerMuxRef = (0, import_react4.useRef)(null);
|
|
241
|
+
const initializeMux = (0, import_react4.useCallback)(() => {
|
|
242
|
+
if (!muxConfig || !playerRef.current) return;
|
|
243
|
+
try {
|
|
244
|
+
const playerInitTime = import_mux_data_shakaplayer.default.utils.now();
|
|
245
|
+
const muxOptions = {
|
|
246
|
+
debug: muxConfig.debug || false,
|
|
247
|
+
disableCookies: muxConfig.disableCookies || false,
|
|
248
|
+
respectDoNotTrack: muxConfig.respectDoNotTrack || false,
|
|
249
|
+
automaticErrorTracking: muxConfig.automaticErrorTracking !== false,
|
|
250
|
+
...muxConfig.beaconCollectionDomain && { beaconCollectionDomain: muxConfig.beaconCollectionDomain },
|
|
251
|
+
...muxConfig.errorTranslator && { errorTranslator: muxConfig.errorTranslator },
|
|
252
|
+
data: {
|
|
253
|
+
env_key: muxConfig.envKey,
|
|
254
|
+
player_name: "Motto Video Player",
|
|
255
|
+
player_version: "1.0.0",
|
|
256
|
+
player_init_time: playerInitTime,
|
|
257
|
+
...muxConfig.metadata
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
shakaPlayerMuxRef.current = (0, import_mux_data_shakaplayer.default)(playerRef.current, muxOptions, import_shaka_player2.default);
|
|
261
|
+
onMuxReady?.();
|
|
262
|
+
} catch (error) {
|
|
263
|
+
console.error("Failed to initialize Mux Analytics:", error);
|
|
264
|
+
}
|
|
265
|
+
}, [muxConfig, onMuxReady, playerRef]);
|
|
266
|
+
const updateMuxData = (0, import_react4.useCallback)((data) => {
|
|
267
|
+
if (playerRef.current?.mux?.updateData) {
|
|
268
|
+
try {
|
|
269
|
+
playerRef.current.mux.updateData(data);
|
|
270
|
+
onMuxDataUpdate?.(data);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
console.error("Failed to update Mux data:", error);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}, [onMuxDataUpdate, playerRef]);
|
|
276
|
+
const handleMuxError = (0, import_react4.useCallback)((error) => {
|
|
277
|
+
if (shakaPlayerMuxRef.current?.loadErrorHandler) {
|
|
278
|
+
shakaPlayerMuxRef.current.loadErrorHandler(error);
|
|
279
|
+
}
|
|
280
|
+
}, []);
|
|
281
|
+
const destroyMux = (0, import_react4.useCallback)(() => {
|
|
282
|
+
if (playerRef.current?.mux?.destroy) {
|
|
283
|
+
try {
|
|
284
|
+
playerRef.current.mux.destroy();
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error("Error destroying Mux:", error);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (shakaPlayerMuxRef.current) {
|
|
290
|
+
shakaPlayerMuxRef.current = null;
|
|
291
|
+
}
|
|
292
|
+
}, [playerRef]);
|
|
293
|
+
return {
|
|
294
|
+
initializeMux,
|
|
295
|
+
updateMuxData,
|
|
296
|
+
handleMuxError,
|
|
297
|
+
destroyMux,
|
|
298
|
+
shakaPlayerMuxRef
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// src/hooks/useShakaUI.ts
|
|
303
|
+
var import_react5 = require("react");
|
|
304
|
+
var import_shaka_player3 = require("shaka-player/dist/shaka-player.ui");
|
|
305
|
+
var SkipBackButton = class {
|
|
306
|
+
constructor(parent, controls, onSkipBack) {
|
|
307
|
+
this.parent = parent;
|
|
308
|
+
this.controls = controls;
|
|
309
|
+
this.eventManager = { listen: (element, event, handler) => {
|
|
310
|
+
element.addEventListener(event, handler);
|
|
311
|
+
} };
|
|
312
|
+
this.button_ = document.createElement("button");
|
|
313
|
+
this.button_.className = "shaka-button motto-native-skip-button";
|
|
314
|
+
this.button_.innerHTML = `
|
|
315
|
+
<svg width="24px" stroke-width="2" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
316
|
+
<path d="M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
317
|
+
<path d="M9 9L9 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
318
|
+
<path d="M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
319
|
+
<path d="M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
320
|
+
</svg>
|
|
321
|
+
`;
|
|
322
|
+
this.button_.title = "Skip back 15 seconds";
|
|
323
|
+
this.button_.setAttribute("aria-label", "Skip back 15 seconds");
|
|
324
|
+
this.parent.appendChild(this.button_);
|
|
325
|
+
this.eventManager.listen(this.button_, "click", () => {
|
|
326
|
+
const video = this.controls.getVideo();
|
|
327
|
+
if (video) {
|
|
328
|
+
const newTime = Math.max(0, video.currentTime - 15);
|
|
329
|
+
video.currentTime = newTime;
|
|
330
|
+
onSkipBack?.(newTime);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
var SkipForwardButton = class {
|
|
336
|
+
constructor(parent, controls, onSkipForward) {
|
|
337
|
+
this.parent = parent;
|
|
338
|
+
this.controls = controls;
|
|
339
|
+
this.eventManager = { listen: (element, event, handler) => {
|
|
340
|
+
element.addEventListener(event, handler);
|
|
341
|
+
} };
|
|
342
|
+
this.button_ = document.createElement("button");
|
|
343
|
+
this.button_.className = "shaka-button motto-native-skip-button";
|
|
344
|
+
this.button_.innerHTML = `
|
|
345
|
+
<svg fill="none" height="24" stroke-width="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
346
|
+
<path d="M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
347
|
+
<path d="M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
348
|
+
<path d="M9 9L9 16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
349
|
+
<path d="M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
350
|
+
</svg>
|
|
351
|
+
`;
|
|
352
|
+
this.button_.title = "Skip forward 15 seconds";
|
|
353
|
+
this.button_.setAttribute("aria-label", "Skip forward 15 seconds");
|
|
354
|
+
this.parent.appendChild(this.button_);
|
|
355
|
+
this.eventManager.listen(this.button_, "click", () => {
|
|
356
|
+
const video = this.controls.getVideo();
|
|
357
|
+
if (video) {
|
|
358
|
+
const newTime = Math.min(video.duration || 0, video.currentTime + 15);
|
|
359
|
+
video.currentTime = newTime;
|
|
360
|
+
onSkipForward?.(newTime);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
var SkipBackButtonFactory = class {
|
|
366
|
+
constructor(onSkipBack) {
|
|
367
|
+
this.onSkipBack = onSkipBack;
|
|
368
|
+
}
|
|
369
|
+
create(rootElement, controls) {
|
|
370
|
+
return new SkipBackButton(rootElement, controls, this.onSkipBack);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
var SkipForwardButtonFactory = class {
|
|
374
|
+
constructor(onSkipForward) {
|
|
375
|
+
this.onSkipForward = onSkipForward;
|
|
376
|
+
}
|
|
377
|
+
create(rootElement, controls) {
|
|
378
|
+
return new SkipForwardButton(rootElement, controls, this.onSkipForward);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
var MobilePlayButton = class {
|
|
382
|
+
constructor(parent, controls) {
|
|
383
|
+
this.parent = parent;
|
|
384
|
+
this.controls = controls;
|
|
385
|
+
this.video = controls?.getVideo?.() || parent.querySelector("video") || document.querySelector("video");
|
|
386
|
+
if (!this.video) {
|
|
387
|
+
console.error("MobilePlayButton: No video element found");
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
this.eventManager = { listen: (element, event, handler) => {
|
|
391
|
+
element.addEventListener(event, handler);
|
|
392
|
+
} };
|
|
393
|
+
this.button_ = document.createElement("button");
|
|
394
|
+
this.button_.className = "motto-mobile-play-button";
|
|
395
|
+
this.updateIcon();
|
|
396
|
+
this.parent.appendChild(this.button_);
|
|
397
|
+
this.eventManager.listen(this.button_, "click", () => {
|
|
398
|
+
if (this.video.paused) {
|
|
399
|
+
this.video.play();
|
|
400
|
+
} else {
|
|
401
|
+
this.video.pause();
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
this.eventManager.listen(this.video, "play", () => this.updateIcon());
|
|
405
|
+
this.eventManager.listen(this.video, "pause", () => this.updateIcon());
|
|
406
|
+
}
|
|
407
|
+
updateIcon() {
|
|
408
|
+
if (this.video.paused) {
|
|
409
|
+
this.button_.innerHTML = `
|
|
410
|
+
<svg xmlns="http://www.w3.org/2000/svg" stroke-width="2" viewBox="0 0 24 24" fill="currentColor">
|
|
411
|
+
<path stroke-width="2" fill-rule="evenodd" d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z" clip-rule="evenodd" />
|
|
412
|
+
</svg>
|
|
413
|
+
`;
|
|
414
|
+
this.button_.setAttribute("aria-label", "Play");
|
|
415
|
+
} else {
|
|
416
|
+
this.button_.innerHTML = `
|
|
417
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
418
|
+
<path fill-rule="evenodd" d="M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z" clip-rule="evenodd" />
|
|
419
|
+
</svg>
|
|
420
|
+
`;
|
|
421
|
+
this.button_.setAttribute("aria-label", "Pause");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
var MobileSkipBackButton = class {
|
|
426
|
+
constructor(parent, controls, onSkipBack) {
|
|
427
|
+
this.parent = parent;
|
|
428
|
+
this.controls = controls;
|
|
429
|
+
this.video = controls?.getVideo?.() || parent.querySelector("video") || document.querySelector("video");
|
|
430
|
+
if (!this.video) {
|
|
431
|
+
console.error("MobileSkipBackButton: No video element found");
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
this.eventManager = { listen: (element, event, handler) => {
|
|
435
|
+
element.addEventListener(event, handler);
|
|
436
|
+
} };
|
|
437
|
+
this.button_ = document.createElement("button");
|
|
438
|
+
this.button_.className = "motto-mobile-skip-button";
|
|
439
|
+
this.button_.innerHTML = `
|
|
440
|
+
<svg width="20px" stroke-width="2" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
441
|
+
<path d="M3 13C3 17.9706 7.02944 22 12 22C16.9706 22 21 17.9706 21 13C21 8.02944 16.9706 4 12 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
442
|
+
<path d="M9 9L9 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
443
|
+
<path d="M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
444
|
+
<path d="M12 4L4.5 4M4.5 4L6.5 2M4.5 4L6.5 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
445
|
+
</svg>
|
|
446
|
+
`;
|
|
447
|
+
this.button_.setAttribute("aria-label", "Skip back 15 seconds");
|
|
448
|
+
this.parent.appendChild(this.button_);
|
|
449
|
+
this.eventManager.listen(this.button_, "click", () => {
|
|
450
|
+
const newTime = Math.max(0, this.video.currentTime - 15);
|
|
451
|
+
this.video.currentTime = newTime;
|
|
452
|
+
onSkipBack?.(newTime);
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
var MobileSkipForwardButton = class {
|
|
457
|
+
constructor(parent, controls, onSkipForward) {
|
|
458
|
+
this.parent = parent;
|
|
459
|
+
this.controls = controls;
|
|
460
|
+
this.video = controls?.getVideo?.() || parent.querySelector("video") || document.querySelector("video");
|
|
461
|
+
if (!this.video) {
|
|
462
|
+
console.error("MobileSkipForwardButton: No video element found");
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
this.eventManager = { listen: (element, event, handler) => {
|
|
466
|
+
element.addEventListener(event, handler);
|
|
467
|
+
} };
|
|
468
|
+
this.button_ = document.createElement("button");
|
|
469
|
+
this.button_.className = "motto-mobile-skip-button";
|
|
470
|
+
this.button_.innerHTML = `
|
|
471
|
+
<svg fill="none" height="20" stroke-width="2" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg">
|
|
472
|
+
<path d="M21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
473
|
+
<path d="M12 4H19.5M19.5 4L17.5 2M19.5 4L17.5 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
474
|
+
<path d="M9 9L9 16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
475
|
+
<path d="M15 9L13 9C12.4477 9 12 9.44772 12 10L12 11.5C12 12.0523 12.4477 12.5 13 12.5L14 12.5C14.5523 12.5 15 12.9477 15 13.5L15 15C15 15.5523 14.5523 16 14 16L12 16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
476
|
+
</svg>
|
|
477
|
+
`;
|
|
478
|
+
this.button_.setAttribute("aria-label", "Skip forward 15 seconds");
|
|
479
|
+
this.parent.appendChild(this.button_);
|
|
480
|
+
this.eventManager.listen(this.button_, "click", () => {
|
|
481
|
+
const newTime = Math.min(this.video.duration || 0, this.video.currentTime + 15);
|
|
482
|
+
this.video.currentTime = newTime;
|
|
483
|
+
onSkipForward?.(newTime);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
var MobileControlsContainer = class {
|
|
488
|
+
constructor(parent, controls, onSkipBack, onSkipForward) {
|
|
489
|
+
this.parent = parent;
|
|
490
|
+
this.controls = controls;
|
|
491
|
+
if (!parent) {
|
|
492
|
+
console.error("MobileControlsContainer: No parent element provided");
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
this.container_ = document.createElement("div");
|
|
496
|
+
this.container_.className = "motto-mobile-controls-overlay";
|
|
497
|
+
const controlsGroup = document.createElement("div");
|
|
498
|
+
controlsGroup.className = "motto-mobile-controls-group";
|
|
499
|
+
new MobileSkipBackButton(controlsGroup, controls, onSkipBack);
|
|
500
|
+
new MobilePlayButton(controlsGroup, controls);
|
|
501
|
+
new MobileSkipForwardButton(controlsGroup, controls, onSkipForward);
|
|
502
|
+
this.container_.appendChild(controlsGroup);
|
|
503
|
+
this.parent.appendChild(this.container_);
|
|
504
|
+
this.setupVisibilitySync();
|
|
505
|
+
}
|
|
506
|
+
setupVisibilitySync() {
|
|
507
|
+
setTimeout(() => {
|
|
508
|
+
this.syncVisibility();
|
|
509
|
+
this.observer = new MutationObserver((mutations) => {
|
|
510
|
+
mutations.forEach((mutation) => {
|
|
511
|
+
if (mutation.type === "attributes" && mutation.attributeName === "class") {
|
|
512
|
+
this.syncVisibility();
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
this.observer.observe(this.parent, {
|
|
517
|
+
attributes: true,
|
|
518
|
+
attributeFilter: ["class"]
|
|
519
|
+
});
|
|
520
|
+
const video = this.controls?.getVideo?.() || this.parent.querySelector("video");
|
|
521
|
+
if (video) {
|
|
522
|
+
video.addEventListener("play", () => {
|
|
523
|
+
setTimeout(() => this.syncVisibility(), 50);
|
|
524
|
+
});
|
|
525
|
+
video.addEventListener("pause", () => {
|
|
526
|
+
setTimeout(() => this.syncVisibility(), 50);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}, 1e3);
|
|
530
|
+
}
|
|
531
|
+
syncVisibility() {
|
|
532
|
+
const mainContainer = this.parent;
|
|
533
|
+
const hasNoCursor = mainContainer.classList.contains("no-cursor");
|
|
534
|
+
const video = this.controls?.getVideo?.() || this.parent.querySelector("video");
|
|
535
|
+
const isVideoPaused = video ? video.paused : false;
|
|
536
|
+
const isControlsVisible = !hasNoCursor || isVideoPaused;
|
|
537
|
+
if (this.container_) {
|
|
538
|
+
if (isControlsVisible) {
|
|
539
|
+
this.container_.style.opacity = "1";
|
|
540
|
+
this.container_.style.pointerEvents = "none";
|
|
541
|
+
} else {
|
|
542
|
+
this.container_.style.opacity = "0";
|
|
543
|
+
this.container_.style.pointerEvents = "none";
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
isElementVisible(element) {
|
|
548
|
+
const style = window.getComputedStyle(element);
|
|
549
|
+
const hasHiddenClass = element.classList.contains("shaka-hidden") || element.classList.contains("hidden") || element.classList.contains("shaka-fade-out");
|
|
550
|
+
return style.display !== "none" && style.visibility !== "hidden" && style.opacity !== "0" && !element.hidden && !hasHiddenClass;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
var MobileControlsContainerFactory = class {
|
|
554
|
+
constructor(onSkipBack, onSkipForward) {
|
|
555
|
+
this.onSkipBack = onSkipBack;
|
|
556
|
+
this.onSkipForward = onSkipForward;
|
|
557
|
+
}
|
|
558
|
+
create(rootElement, controls) {
|
|
559
|
+
return new MobileControlsContainer(rootElement, controls, this.onSkipBack, this.onSkipForward);
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig, seekbarColors, onSkipBack, onSkipForward) => {
|
|
563
|
+
const uiRef = (0, import_react5.useRef)(null);
|
|
564
|
+
const registeredElements = (0, import_react5.useRef)(/* @__PURE__ */ new Set());
|
|
565
|
+
const initializeUI = (0, import_react5.useCallback)(async () => {
|
|
566
|
+
if (!controls || !containerRef.current || !playerRef.current || !videoRef.current) {
|
|
567
|
+
return null;
|
|
568
|
+
}
|
|
569
|
+
const isMobile = window.innerWidth <= 767 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
570
|
+
if (!registeredElements.current.has("skip_back_button")) {
|
|
571
|
+
import_shaka_player3.ui.Controls.registerElement("skip_back_button", new SkipBackButtonFactory(onSkipBack));
|
|
572
|
+
registeredElements.current.add("skip_back_button");
|
|
573
|
+
}
|
|
574
|
+
if (!registeredElements.current.has("skip_forward_button")) {
|
|
575
|
+
import_shaka_player3.ui.Controls.registerElement("skip_forward_button", new SkipForwardButtonFactory(onSkipForward));
|
|
576
|
+
registeredElements.current.add("skip_forward_button");
|
|
577
|
+
}
|
|
578
|
+
if (isMobile) {
|
|
579
|
+
if (!registeredElements.current.has("mobile_controls_container")) {
|
|
580
|
+
import_shaka_player3.ui.Controls.registerElement("mobile_controls_container", new MobileControlsContainerFactory(onSkipBack, onSkipForward));
|
|
581
|
+
registeredElements.current.add("mobile_controls_container");
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
const ui = new import_shaka_player3.ui.Overlay(playerRef.current, containerRef.current, videoRef.current);
|
|
585
|
+
uiRef.current = ui;
|
|
586
|
+
const controlPanelElements = isMobile ? [
|
|
587
|
+
"mute",
|
|
588
|
+
"time_and_duration",
|
|
589
|
+
"spacer",
|
|
590
|
+
"fullscreen",
|
|
591
|
+
"overflow_menu"
|
|
592
|
+
] : [
|
|
593
|
+
"skip_back_button",
|
|
594
|
+
"play_pause",
|
|
595
|
+
"skip_forward_button",
|
|
596
|
+
"mute",
|
|
597
|
+
"volume",
|
|
598
|
+
"time_and_duration",
|
|
599
|
+
"spacer",
|
|
600
|
+
"fullscreen",
|
|
601
|
+
"overflow_menu"
|
|
602
|
+
];
|
|
603
|
+
const uiConfig = {
|
|
604
|
+
seekBarColors: {
|
|
605
|
+
base: seekbarColors?.base || "rgba(255, 255, 255, 0.3)",
|
|
606
|
+
// Unbuffered track
|
|
607
|
+
buffered: seekbarColors?.buffered || "rgba(255, 255, 255, 0.5)",
|
|
608
|
+
// Buffered but not played
|
|
609
|
+
played: seekbarColors?.played || "#ffffff"
|
|
610
|
+
// Progress/played portion (white)
|
|
611
|
+
},
|
|
612
|
+
controlPanelElements,
|
|
613
|
+
...chromecastConfig?.receiverApplicationId && {
|
|
614
|
+
"castReceiverAppId": chromecastConfig.receiverApplicationId,
|
|
615
|
+
"castAndroidReceiverCompatible": false
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
if (chromecastConfig?.receiverApplicationId) {
|
|
619
|
+
uiConfig.castReceiverAppId = chromecastConfig.receiverApplicationId;
|
|
620
|
+
uiConfig.castAndroidReceiverCompatible = false;
|
|
621
|
+
}
|
|
622
|
+
ui.configure(uiConfig);
|
|
623
|
+
if (isMobile) {
|
|
624
|
+
setTimeout(() => {
|
|
625
|
+
const container = containerRef.current;
|
|
626
|
+
const video = videoRef.current;
|
|
627
|
+
if (container && video) {
|
|
628
|
+
new MobileControlsContainer(container, { getVideo: () => video }, onSkipBack, onSkipForward);
|
|
629
|
+
}
|
|
630
|
+
}, 500);
|
|
631
|
+
}
|
|
632
|
+
return ui;
|
|
633
|
+
}, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward]);
|
|
634
|
+
const destroyUI = (0, import_react5.useCallback)(() => {
|
|
635
|
+
if (uiRef.current) {
|
|
636
|
+
try {
|
|
637
|
+
uiRef.current.destroy();
|
|
638
|
+
} catch (error) {
|
|
639
|
+
console.error("Error destroying UI:", error);
|
|
640
|
+
}
|
|
641
|
+
uiRef.current = null;
|
|
642
|
+
}
|
|
643
|
+
}, []);
|
|
644
|
+
return {
|
|
645
|
+
uiRef,
|
|
646
|
+
initializeUI,
|
|
647
|
+
destroyUI
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
// src/hooks/useEventHandlers.ts
|
|
652
|
+
var import_react6 = require("react");
|
|
653
|
+
var useEventHandlers = (videoRef, handlers) => {
|
|
654
|
+
const setupEventListeners = (0, import_react6.useCallback)(() => {
|
|
655
|
+
const video = videoRef.current;
|
|
656
|
+
if (!video) return;
|
|
657
|
+
const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;
|
|
658
|
+
if (onPlay) video.addEventListener("play", onPlay);
|
|
659
|
+
if (onPause) video.addEventListener("pause", onPause);
|
|
660
|
+
if (onEnded) video.addEventListener("ended", onEnded);
|
|
661
|
+
if (onLoadStart) video.addEventListener("loadstart", onLoadStart);
|
|
662
|
+
if (onCanPlay) video.addEventListener("canplay", onCanPlay);
|
|
663
|
+
}, [videoRef, handlers]);
|
|
664
|
+
const cleanupEventListeners = (0, import_react6.useCallback)(() => {
|
|
665
|
+
const video = videoRef.current;
|
|
666
|
+
if (!video) return;
|
|
667
|
+
const { onPlay, onPause, onEnded, onLoadStart, onCanPlay } = handlers;
|
|
668
|
+
if (onPlay) video.removeEventListener("play", onPlay);
|
|
669
|
+
if (onPause) video.removeEventListener("pause", onPause);
|
|
670
|
+
if (onEnded) video.removeEventListener("ended", onEnded);
|
|
671
|
+
if (onLoadStart) video.removeEventListener("loadstart", onLoadStart);
|
|
672
|
+
if (onCanPlay) video.removeEventListener("canplay", onCanPlay);
|
|
673
|
+
}, [videoRef, handlers]);
|
|
674
|
+
return {
|
|
675
|
+
setupEventListeners,
|
|
676
|
+
cleanupEventListeners
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// src/hooks/useLiveBadge.ts
|
|
681
|
+
var import_react7 = require("react");
|
|
682
|
+
var useLiveBadge = (playerRef, options = {}) => {
|
|
683
|
+
const [isLive, setIsLive] = (0, import_react7.useState)(false);
|
|
684
|
+
const [isVisible, setIsVisible] = (0, import_react7.useState)(false);
|
|
685
|
+
const intervalRef = (0, import_react7.useRef)(null);
|
|
686
|
+
const { enabled = true, onLiveStateChange } = options;
|
|
687
|
+
const checkLiveStatus = () => {
|
|
688
|
+
if (!playerRef.current || !enabled) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
try {
|
|
692
|
+
const player = playerRef.current;
|
|
693
|
+
if (!player.getManifest || !player.getPresentationTimeline || typeof player.getPresentationTimeline !== "function") {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const manifest = player.getManifest();
|
|
697
|
+
if (!manifest) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
const timeline = player.getPresentationTimeline();
|
|
701
|
+
if (!timeline || typeof timeline.isLive !== "function") {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
const liveStatus = timeline.isLive();
|
|
705
|
+
if (liveStatus !== isLive) {
|
|
706
|
+
setIsLive(liveStatus);
|
|
707
|
+
setIsVisible(liveStatus);
|
|
708
|
+
onLiveStateChange?.(liveStatus);
|
|
709
|
+
}
|
|
710
|
+
} catch (error) {
|
|
711
|
+
if (error instanceof Error && !error.message.includes("not a function")) {
|
|
712
|
+
console.error("Error checking live status:", error);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
(0, import_react7.useEffect)(() => {
|
|
717
|
+
if (!enabled) {
|
|
718
|
+
setIsLive(false);
|
|
719
|
+
setIsVisible(false);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
checkLiveStatus();
|
|
723
|
+
intervalRef.current = setInterval(checkLiveStatus, 2e3);
|
|
724
|
+
return () => {
|
|
725
|
+
if (intervalRef.current) {
|
|
726
|
+
clearInterval(intervalRef.current);
|
|
727
|
+
intervalRef.current = null;
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
}, [enabled, playerRef.current]);
|
|
731
|
+
(0, import_react7.useEffect)(() => {
|
|
732
|
+
return () => {
|
|
733
|
+
if (intervalRef.current) {
|
|
734
|
+
clearInterval(intervalRef.current);
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
}, []);
|
|
738
|
+
const hideBadge = () => setIsVisible(false);
|
|
739
|
+
const showBadge = () => setIsVisible(true);
|
|
740
|
+
return {
|
|
741
|
+
isLive,
|
|
742
|
+
isVisible,
|
|
743
|
+
hideBadge,
|
|
744
|
+
showBadge,
|
|
745
|
+
checkLiveStatus
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
// src/hooks/usePosterFallback.ts
|
|
750
|
+
var import_react8 = require("react");
|
|
751
|
+
|
|
752
|
+
// src/hooks/useLiveIndicator.ts
|
|
753
|
+
var import_react9 = require("react");
|
|
754
|
+
var useLiveIndicator = (containerRef, options = {}) => {
|
|
755
|
+
const observerRef = (0, import_react9.useRef)(null);
|
|
756
|
+
const {
|
|
757
|
+
enabled = true,
|
|
758
|
+
indicatorColor = "#ff0000",
|
|
759
|
+
indicatorSize = 8,
|
|
760
|
+
showPulseAnimation = true
|
|
761
|
+
} = options;
|
|
762
|
+
(0, import_react9.useEffect)(() => {
|
|
763
|
+
if (!containerRef.current || !enabled) {
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
const addLiveIndicator = (currentTimeElement) => {
|
|
767
|
+
if (currentTimeElement.querySelector(".live-indicator-dot")) {
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
const indicator = document.createElement("span");
|
|
771
|
+
indicator.className = "live-indicator-dot";
|
|
772
|
+
indicator.style.cssText = `
|
|
773
|
+
display: inline-block;
|
|
774
|
+
width: ${indicatorSize}px;
|
|
775
|
+
height: ${indicatorSize}px;
|
|
776
|
+
background-color: ${indicatorColor};
|
|
777
|
+
border-radius: 50%;
|
|
778
|
+
margin-right: 6px;
|
|
779
|
+
vertical-align: middle;
|
|
780
|
+
${showPulseAnimation ? "animation: pulse-live 2s infinite;" : ""}
|
|
781
|
+
`;
|
|
782
|
+
currentTimeElement.insertBefore(indicator, currentTimeElement.firstChild);
|
|
783
|
+
};
|
|
784
|
+
const removeLiveIndicator = (currentTimeElement) => {
|
|
785
|
+
const indicator = currentTimeElement.querySelector(".live-indicator-dot");
|
|
786
|
+
if (indicator) {
|
|
787
|
+
indicator.remove();
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
const checkForLiveContent = () => {
|
|
791
|
+
const currentTimeElements = containerRef.current?.querySelectorAll(".shaka-current-time");
|
|
792
|
+
currentTimeElements?.forEach((element) => {
|
|
793
|
+
const textContent = element.textContent?.trim() || "";
|
|
794
|
+
if (textContent.toLowerCase().includes("live")) {
|
|
795
|
+
addLiveIndicator(element);
|
|
796
|
+
} else {
|
|
797
|
+
removeLiveIndicator(element);
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
checkForLiveContent();
|
|
802
|
+
observerRef.current = new MutationObserver((mutations) => {
|
|
803
|
+
let shouldCheck = false;
|
|
804
|
+
mutations.forEach((mutation) => {
|
|
805
|
+
if (mutation.type === "childList" || mutation.type === "characterData") {
|
|
806
|
+
shouldCheck = true;
|
|
807
|
+
}
|
|
808
|
+
mutation.addedNodes.forEach((node) => {
|
|
809
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
810
|
+
const element = node;
|
|
811
|
+
if (element.classList?.contains("shaka-current-time") || element.querySelector?.(".shaka-current-time")) {
|
|
812
|
+
shouldCheck = true;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
});
|
|
817
|
+
if (shouldCheck) {
|
|
818
|
+
setTimeout(checkForLiveContent, 100);
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
observerRef.current.observe(containerRef.current, {
|
|
822
|
+
childList: true,
|
|
823
|
+
subtree: true,
|
|
824
|
+
characterData: true,
|
|
825
|
+
characterDataOldValue: true
|
|
826
|
+
});
|
|
827
|
+
const intervalId = setInterval(checkForLiveContent, 1e3);
|
|
828
|
+
return () => {
|
|
829
|
+
if (observerRef.current) {
|
|
830
|
+
observerRef.current.disconnect();
|
|
831
|
+
}
|
|
832
|
+
clearInterval(intervalId);
|
|
833
|
+
};
|
|
834
|
+
}, [containerRef, enabled, indicatorColor, indicatorSize, showPulseAnimation]);
|
|
835
|
+
return {
|
|
836
|
+
// Expose method to manually trigger check if needed
|
|
837
|
+
checkForLiveContent: () => {
|
|
838
|
+
const currentTimeElements = containerRef.current?.querySelectorAll(".shaka-current-time");
|
|
839
|
+
currentTimeElements?.forEach((element) => {
|
|
840
|
+
const textContent = element.textContent?.trim() || "";
|
|
841
|
+
if (textContent.toLowerCase().includes("live")) {
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
// src/hooks/useShakaAbsoluteTime.ts
|
|
849
|
+
var import_react10 = require("react");
|
|
850
|
+
function useShakaAbsoluteTime({
|
|
851
|
+
player,
|
|
852
|
+
controls,
|
|
853
|
+
manualStreamStartDate
|
|
854
|
+
}) {
|
|
855
|
+
const [detectedStreamStart, setDetectedStreamStart] = (0, import_react10.useState)(null);
|
|
856
|
+
const detectStreamStartFromManifest = async () => {
|
|
857
|
+
if (!player) return null;
|
|
858
|
+
try {
|
|
859
|
+
const manifest = player.getManifest();
|
|
860
|
+
if (!manifest) return null;
|
|
861
|
+
const isLive = player.isLive();
|
|
862
|
+
if (!isLive) return null;
|
|
863
|
+
const video = player.getMediaElement();
|
|
864
|
+
if (video && video.seekable && video.seekable.length > 0) {
|
|
865
|
+
const seekableStart = video.seekable.start(0);
|
|
866
|
+
const seekableEnd = video.seekable.end(0);
|
|
867
|
+
const seekableDuration = seekableEnd - seekableStart;
|
|
868
|
+
const now = Date.now() / 1e3;
|
|
869
|
+
const estimatedStreamStart = now - seekableDuration;
|
|
870
|
+
return new Date(estimatedStreamStart * 1e3);
|
|
871
|
+
}
|
|
872
|
+
const stats = player.getStats();
|
|
873
|
+
if (stats && stats.manifestTimeSeconds) {
|
|
874
|
+
return new Date((Date.now() / 1e3 - stats.manifestTimeSeconds) * 1e3);
|
|
875
|
+
}
|
|
876
|
+
try {
|
|
877
|
+
const bufferedTimeRanges = video?.buffered;
|
|
878
|
+
if (bufferedTimeRanges && bufferedTimeRanges.length > 0) {
|
|
879
|
+
const totalBuffered = bufferedTimeRanges.end(bufferedTimeRanges.length - 1);
|
|
880
|
+
const now = Date.now() / 1e3;
|
|
881
|
+
return new Date((now - totalBuffered) * 1e3);
|
|
882
|
+
}
|
|
883
|
+
} catch (error) {
|
|
884
|
+
console.warn("Error extracting buffered timing info:", error);
|
|
885
|
+
}
|
|
886
|
+
console.warn("Could not detect stream start time from manifest");
|
|
887
|
+
return null;
|
|
888
|
+
} catch (error) {
|
|
889
|
+
console.warn("Error detecting stream start time:", error);
|
|
890
|
+
return null;
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
(0, import_react10.useEffect)(() => {
|
|
894
|
+
if (!player || manualStreamStartDate) return;
|
|
895
|
+
const detectStartTime = async () => {
|
|
896
|
+
setTimeout(async () => {
|
|
897
|
+
const detectedStart = await detectStreamStartFromManifest();
|
|
898
|
+
if (detectedStart) {
|
|
899
|
+
setDetectedStreamStart(detectedStart);
|
|
900
|
+
console.log("Detected stream start time:", detectedStart.toISOString());
|
|
901
|
+
}
|
|
902
|
+
}, 1e3);
|
|
903
|
+
};
|
|
904
|
+
const onManifestParsed = () => {
|
|
905
|
+
detectStartTime();
|
|
906
|
+
};
|
|
907
|
+
detectStartTime();
|
|
908
|
+
try {
|
|
909
|
+
player.addEventListener("manifestparsed", onManifestParsed);
|
|
910
|
+
player.addEventListener("streaming", onManifestParsed);
|
|
911
|
+
} catch (error) {
|
|
912
|
+
console.warn("Could not add manifest event listeners:", error);
|
|
913
|
+
}
|
|
914
|
+
return () => {
|
|
915
|
+
try {
|
|
916
|
+
player.removeEventListener("manifestparsed", onManifestParsed);
|
|
917
|
+
player.removeEventListener("streaming", onManifestParsed);
|
|
918
|
+
} catch (error) {
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
}, [player, manualStreamStartDate]);
|
|
922
|
+
const effectiveStreamStart = manualStreamStartDate || detectedStreamStart;
|
|
923
|
+
(0, import_react10.useEffect)(() => {
|
|
924
|
+
if (!player || !controls || !effectiveStreamStart) return;
|
|
925
|
+
const video = player.getMediaElement();
|
|
926
|
+
if (!video) return;
|
|
927
|
+
let originalGetDisplayTime;
|
|
928
|
+
let timeDisplayElement;
|
|
929
|
+
const formatElapsedTime = (elapsedSeconds) => {
|
|
930
|
+
const hours = Math.floor(elapsedSeconds / 3600);
|
|
931
|
+
const minutes = Math.floor(elapsedSeconds % 3600 / 60);
|
|
932
|
+
const seconds = Math.floor(elapsedSeconds % 60);
|
|
933
|
+
if (hours > 0) {
|
|
934
|
+
return [hours, minutes, seconds].map((val) => val.toString().padStart(2, "0")).join(":");
|
|
935
|
+
} else {
|
|
936
|
+
return [minutes, seconds].map((val) => val.toString().padStart(2, "0")).join(":");
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
const getElapsedTime = () => {
|
|
940
|
+
const now = /* @__PURE__ */ new Date();
|
|
941
|
+
const elapsedMs = now.getTime() - effectiveStreamStart.getTime();
|
|
942
|
+
return Math.max(0, elapsedMs / 1e3);
|
|
943
|
+
};
|
|
944
|
+
const customGetDisplayTime = function() {
|
|
945
|
+
const elapsedSeconds = getElapsedTime();
|
|
946
|
+
return formatElapsedTime(elapsedSeconds);
|
|
947
|
+
};
|
|
948
|
+
const setupTimeDisplayOverride = () => {
|
|
949
|
+
try {
|
|
950
|
+
const controlsContainer = controls.getControlsContainer();
|
|
951
|
+
if (!controlsContainer) return;
|
|
952
|
+
const timeDisplay = controlsContainer.querySelector(".shaka-current-time");
|
|
953
|
+
if (timeDisplay) {
|
|
954
|
+
timeDisplayElement = timeDisplay;
|
|
955
|
+
if (timeDisplayElement.getDisplayTime) {
|
|
956
|
+
originalGetDisplayTime = timeDisplayElement.getDisplayTime.bind(timeDisplayElement);
|
|
957
|
+
timeDisplayElement.getDisplayTime = customGetDisplayTime.bind(timeDisplayElement);
|
|
958
|
+
} else {
|
|
959
|
+
setupDirectTextUpdate();
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
} catch (error) {
|
|
963
|
+
console.warn("Error setting up time display override:", error);
|
|
964
|
+
setupDirectTextUpdate();
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
const setupDirectTextUpdate = () => {
|
|
968
|
+
let animationFrameId;
|
|
969
|
+
let isDestroyed = false;
|
|
970
|
+
const updateTimeDisplay = () => {
|
|
971
|
+
if (isDestroyed) return;
|
|
972
|
+
try {
|
|
973
|
+
const controlsContainer = controls.getControlsContainer();
|
|
974
|
+
if (controlsContainer) {
|
|
975
|
+
const currentTimeLabels = controlsContainer.querySelectorAll(".shaka-current-time");
|
|
976
|
+
const elapsedSeconds = getElapsedTime();
|
|
977
|
+
const timeText = formatElapsedTime(elapsedSeconds);
|
|
978
|
+
currentTimeLabels.forEach((label) => {
|
|
979
|
+
if (label && label.textContent !== timeText) {
|
|
980
|
+
label.textContent = timeText;
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
} catch (error) {
|
|
985
|
+
console.warn("Error updating time display:", error);
|
|
986
|
+
}
|
|
987
|
+
animationFrameId = requestAnimationFrame(updateTimeDisplay);
|
|
988
|
+
};
|
|
989
|
+
updateTimeDisplay();
|
|
990
|
+
return () => {
|
|
991
|
+
isDestroyed = true;
|
|
992
|
+
if (animationFrameId) {
|
|
993
|
+
cancelAnimationFrame(animationFrameId);
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
const setupSeekbarTooltip = () => {
|
|
998
|
+
try {
|
|
999
|
+
const controlsContainer = controls.getControlsContainer();
|
|
1000
|
+
if (!controlsContainer) return;
|
|
1001
|
+
const seekBar = controlsContainer.querySelector(".shaka-seek-bar");
|
|
1002
|
+
if (!seekBar) return;
|
|
1003
|
+
const onSeekBarMouseMove = (event) => {
|
|
1004
|
+
const rect = seekBar.getBoundingClientRect();
|
|
1005
|
+
const pos = (event.clientX - rect.left) / rect.width;
|
|
1006
|
+
const totalElapsedSeconds = getElapsedTime();
|
|
1007
|
+
const seekableRange = video.seekable;
|
|
1008
|
+
if (seekableRange.length > 0) {
|
|
1009
|
+
const seekableDuration = seekableRange.end(0) - seekableRange.start(0);
|
|
1010
|
+
const positionInStream = totalElapsedSeconds - seekableDuration * (1 - pos);
|
|
1011
|
+
const timeAtPosition = Math.max(0, positionInStream);
|
|
1012
|
+
seekBar.title = formatElapsedTime(timeAtPosition);
|
|
1013
|
+
} else {
|
|
1014
|
+
seekBar.title = formatElapsedTime(totalElapsedSeconds);
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
seekBar.addEventListener("mousemove", onSeekBarMouseMove);
|
|
1018
|
+
return () => {
|
|
1019
|
+
seekBar.removeEventListener("mousemove", onSeekBarMouseMove);
|
|
1020
|
+
};
|
|
1021
|
+
} catch (error) {
|
|
1022
|
+
console.warn("Error setting up seekbar tooltip:", error);
|
|
1023
|
+
return () => {
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
const setupWithDelay = () => {
|
|
1028
|
+
setTimeout(() => {
|
|
1029
|
+
setupTimeDisplayOverride();
|
|
1030
|
+
const cleanupSeekbar = setupSeekbarTooltip();
|
|
1031
|
+
setupWithDelay.cleanupSeekbar = cleanupSeekbar;
|
|
1032
|
+
}, 100);
|
|
1033
|
+
};
|
|
1034
|
+
setupWithDelay();
|
|
1035
|
+
return () => {
|
|
1036
|
+
if (timeDisplayElement && originalGetDisplayTime) {
|
|
1037
|
+
try {
|
|
1038
|
+
timeDisplayElement.getDisplayTime = originalGetDisplayTime;
|
|
1039
|
+
} catch (error) {
|
|
1040
|
+
console.warn("Error restoring original getDisplayTime:", error);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
if (setupWithDelay.cleanupSeekbar) {
|
|
1044
|
+
setupWithDelay.cleanupSeekbar();
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
}, [player, controls, effectiveStreamStart]);
|
|
1048
|
+
return {
|
|
1049
|
+
detectedStreamStart,
|
|
1050
|
+
effectiveStreamStart,
|
|
1051
|
+
isUsingManualDate: !!manualStreamStartDate
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// src/components/Loading.tsx
|
|
1056
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
1057
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1058
|
+
var Loading = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1059
|
+
"div",
|
|
1060
|
+
{
|
|
1061
|
+
className: (0, import_tailwind_merge.twMerge)(
|
|
1062
|
+
"relative bg-[#151515] md:rounded-2xl! overflow-hidden aspect-video text-white w-full h-full flex justify-center items-center text-[10px]",
|
|
1063
|
+
className
|
|
1064
|
+
),
|
|
1065
|
+
role: "status",
|
|
1066
|
+
children: [
|
|
1067
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-white" }),
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Loading..." })
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
);
|
|
1072
|
+
|
|
1073
|
+
// src/components/ErrorScreen.tsx
|
|
1074
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1075
|
+
var ErrorScreen = ({ title, description }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full h-full md:rounded-2xl! aspect-video bg-black", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-[#151515] text-white w-full h-full flex justify-stretch items-center", children: [
|
|
1076
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1077
|
+
"svg",
|
|
1078
|
+
{
|
|
1079
|
+
className: "w-24 h-24 m-6",
|
|
1080
|
+
fill: "none",
|
|
1081
|
+
stroke: "currentColor",
|
|
1082
|
+
strokeWidth: "2",
|
|
1083
|
+
style: { width: 96 },
|
|
1084
|
+
viewBox: "0 0 24 24",
|
|
1085
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1087
|
+
"path",
|
|
1088
|
+
{
|
|
1089
|
+
d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z",
|
|
1090
|
+
strokeLinecap: "round",
|
|
1091
|
+
strokeLinejoin: "round"
|
|
1092
|
+
}
|
|
1093
|
+
)
|
|
1094
|
+
}
|
|
1095
|
+
),
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: "text-2xl mb-2", children: title || "Playback Error" }),
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "text-lg", children: description || "Unable to play the video. Please try again later." })
|
|
1099
|
+
] })
|
|
1100
|
+
] }) });
|
|
1101
|
+
|
|
1102
|
+
// src/components/Title.tsx
|
|
1103
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1104
|
+
var Title = ({ title }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { className: "text-white text-xl font-semibold", children: title }) });
|
|
1105
|
+
|
|
1106
|
+
// src/components/LiveBadge.tsx
|
|
1107
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1108
|
+
var LiveBadge = ({
|
|
1109
|
+
isVisible,
|
|
1110
|
+
position = "top-right",
|
|
1111
|
+
className = "",
|
|
1112
|
+
style = {},
|
|
1113
|
+
text = "LIVE"
|
|
1114
|
+
}) => {
|
|
1115
|
+
if (!isVisible) return null;
|
|
1116
|
+
const positionClasses = {
|
|
1117
|
+
"top-left": "top-4 left-4",
|
|
1118
|
+
"top-right": "top-4 right-4",
|
|
1119
|
+
"bottom-left": "bottom-4 left-4",
|
|
1120
|
+
"bottom-right": "bottom-4 right-4"
|
|
1121
|
+
};
|
|
1122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1123
|
+
"div",
|
|
1124
|
+
{
|
|
1125
|
+
className: `
|
|
1126
|
+
absolute z-50
|
|
1127
|
+
${positionClasses[position]}
|
|
1128
|
+
bg-red-600 text-white
|
|
1129
|
+
px-2 py-1
|
|
1130
|
+
rounded-md
|
|
1131
|
+
text-xs font-bold
|
|
1132
|
+
uppercase tracking-wide
|
|
1133
|
+
shadow-lg
|
|
1134
|
+
animate-pulse
|
|
1135
|
+
pointer-events-none
|
|
1136
|
+
${className}
|
|
1137
|
+
`,
|
|
1138
|
+
style,
|
|
1139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "w-2 h-2 bg-white rounded-full animate-pulse" }),
|
|
1141
|
+
text
|
|
1142
|
+
] })
|
|
1143
|
+
}
|
|
1144
|
+
);
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
// src/styles.css
|
|
1148
|
+
styleInject('/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-red-600: oklch(57.7% 0.245 27.325);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --text-5xl: 3rem;\n --text-5xl--line-height: 1;\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-wide: 0.025em;\n --tracking-widest: 0.1em;\n --radius-md: 0.375rem;\n --radius-2xl: 1rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --aspect-video: 16 / 9;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-auto {\n pointer-events: auto;\n }\n .pointer-events-none {\n pointer-events: none;\n }\n .visible {\n visibility: visible;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .static {\n position: static;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-4 {\n top: calc(var(--spacing) * 4);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-4 {\n right: calc(var(--spacing) * 4);\n }\n .bottom-0 {\n bottom: calc(var(--spacing) * 0);\n }\n .bottom-4 {\n bottom: calc(var(--spacing) * 4);\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-4 {\n left: calc(var(--spacing) * 4);\n }\n .z-10 {\n z-index: 10;\n }\n .z-50 {\n z-index: 50;\n }\n .container {\n width: 100%;\n @media (width >= 40rem) {\n max-width: 40rem;\n }\n @media (width >= 48rem) {\n max-width: 48rem;\n }\n @media (width >= 64rem) {\n max-width: 64rem;\n }\n @media (width >= 80rem) {\n max-width: 80rem;\n }\n @media (width >= 96rem) {\n max-width: 96rem;\n }\n }\n .m-6 {\n margin: calc(var(--spacing) * 6);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-3 {\n margin-top: calc(var(--spacing) * 3);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6);\n }\n .flex {\n display: flex;\n }\n .grid {\n display: grid;\n }\n .hidden {\n display: none;\n }\n .aspect-video {\n aspect-ratio: var(--aspect-video);\n }\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-24 {\n height: calc(var(--spacing) * 24);\n }\n .h-full {\n height: 100%;\n }\n .w-2 {\n width: calc(var(--spacing) * 2);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-full {\n width: 100%;\n }\n .animate-pulse {\n animation: var(--animate-pulse);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .auto-cols-max {\n grid-auto-columns: max-content;\n }\n .grid-flow-col {\n grid-auto-flow: column;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-stretch {\n justify-content: stretch;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .border-b-2 {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 2px;\n }\n .border-white {\n border-color: var(--color-white);\n }\n .bg-\\[\\#151515\\] {\n background-color: #151515;\n }\n .bg-black {\n background-color: var(--color-black);\n }\n .bg-red-600 {\n background-color: var(--color-red-600);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-gradient-to-t {\n --tw-gradient-position: to top in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black\\/70 {\n --tw-gradient-from: color-mix(in srgb, #000 70%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-gradient-from: color-mix(in oklab, var(--color-black) 70%, transparent);\n }\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .bg-cover {\n background-size: cover;\n }\n .bg-center {\n background-position: center;\n }\n .bg-no-repeat {\n background-repeat: no-repeat;\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .font-mono {\n font-family: var(--font-mono);\n }\n .text-2xl {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n .text-5xl {\n font-size: var(--text-5xl);\n line-height: var(--tw-leading, var(--text-5xl--line-height));\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .tracking-wide {\n --tw-tracking: var(--tracking-wide);\n letter-spacing: var(--tracking-wide);\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest);\n letter-spacing: var(--tracking-widest);\n }\n .text-white {\n color: var(--color-white);\n }\n .uppercase {\n text-transform: uppercase;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .filter {\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n }\n .md\\:rounded-2xl {\n @media (width >= 48rem) {\n border-radius: var(--radius-2xl);\n }\n }\n .md\\:rounded-2xl\\! {\n @media (width >= 48rem) {\n border-radius: var(--radius-2xl) !important;\n }\n }\n .md\\:text-base {\n @media (width >= 48rem) {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .md\\:text-xl {\n @media (width >= 48rem) {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n }\n}\n@layer components {\n .motto-video-container {\n position: relative;\n width: 100%;\n min-height: 300px;\n }\n @supports (aspect-ratio: 16/9) {\n .motto-video-container {\n min-height: auto;\n }\n }\n .motto-video-responsive {\n position: absolute;\n top: calc(var(--spacing) * 0);\n left: calc(var(--spacing) * 0);\n height: 100%;\n width: 100%;\n }\n .motto-skip-button {\n position: absolute;\n top: calc(1/2 * 100%);\n z-index: 10;\n display: flex;\n height: calc(var(--spacing) * 16);\n width: calc(var(--spacing) * 16);\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n cursor: pointer;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 70%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 70%, transparent);\n }\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n color: var(--color-white);\n opacity: 80%;\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n &:hover {\n @media (hover: hover) {\n --tw-scale-x: 110%;\n --tw-scale-y: 110%;\n --tw-scale-z: 110%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n }\n &:hover {\n @media (hover: hover) {\n opacity: 100%;\n }\n }\n &:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n }\n .motto-skip-button-back {\n left: calc(var(--spacing) * 5);\n }\n .motto-skip-button-forward {\n right: calc(var(--spacing) * 5);\n }\n .motto-mobile-controls-overlay {\n position: absolute;\n inset: calc(var(--spacing) * 0);\n z-index: 20;\n display: flex;\n align-items: center;\n justify-content: center;\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 300ms;\n transition-duration: 300ms;\n pointer-events: none;\n }\n .motto-mobile-controls-group {\n display: flex;\n align-items: center;\n gap: calc(var(--spacing) * 8);\n opacity: 100%;\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: none;\n }\n .motto-mobile-play-button {\n display: flex;\n height: calc(var(--spacing) * 14);\n width: calc(var(--spacing) * 14);\n cursor: pointer;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 30%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\n }\n color: var(--color-white);\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: auto;\n }\n .motto-mobile-play-button:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n .motto-mobile-play-button svg {\n height: calc(var(--spacing) * 7);\n width: calc(var(--spacing) * 7);\n }\n .motto-mobile-skip-button {\n display: flex;\n height: calc(var(--spacing) * 10);\n width: calc(var(--spacing) * 10);\n cursor: pointer;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: calc(infinity * 1px);\n border-style: var(--tw-border-style);\n border-width: 0px;\n background-color: color-mix(in srgb, #000 30%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 30%, transparent);\n }\n color: var(--color-white);\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n --tw-duration: 200ms;\n transition-duration: 200ms;\n pointer-events: auto;\n }\n .motto-mobile-skip-button:active {\n --tw-scale-x: 95%;\n --tw-scale-y: 95%;\n --tw-scale-z: 95%;\n scale: var(--tw-scale-x) var(--tw-scale-y);\n }\n .motto-mobile-skip-button svg {\n height: calc(var(--spacing) * 6);\n width: calc(var(--spacing) * 6);\n }\n}\n@media (min-width: 768px) {\n .motto-mobile-controls-overlay {\n display: none !important;\n }\n}\n@media (max-width: 767px) {\n .shaka-controls-container .motto-native-skip-button,\n .shaka-controls-container .motto-skip-back-button,\n .shaka-controls-container .motto-skip-forward-button,\n .shaka-controls-container .shaka-button[title*="Skip back"],\n .shaka-controls-container .shaka-button[title*="Skip forward"],\n .shaka-controls-container .shaka-button[aria-label*="Skip back"],\n .shaka-controls-container .shaka-button[aria-label*="Skip forward"],\n .shaka-controls-container button[title*="Skip back"],\n .shaka-controls-container button[title*="Skip forward"],\n .shaka-controls-container button[aria-label*="Skip back"],\n .shaka-controls-container button[aria-label*="Skip forward"],\n .motto-native-skip-button:not(.motto-mobile-skip-button),\n .motto-skip-back-button:not(.motto-mobile-skip-button),\n .motto-skip-forward-button:not(.motto-mobile-skip-button),\n .shaka-button[title*="Skip back"]:not(.motto-mobile-skip-button),\n .shaka-button[title*="Skip forward"]:not(.motto-mobile-skip-button),\n .shaka-button[aria-label*="Skip back"]:not(.motto-mobile-skip-button),\n .shaka-button[aria-label*="Skip forward"]:not(.motto-mobile-skip-button),\n button[title*="Skip back"]:not(.motto-mobile-skip-button),\n button[title*="Skip forward"]:not(.motto-mobile-skip-button),\n button[aria-label*="Skip back"]:not(.motto-mobile-skip-button),\n button[aria-label*="Skip forward"]:not(.motto-mobile-skip-button) {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n width: 0 !important;\n height: 0 !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n .shaka-controls-container {\n z-index: 90 !important;\n height: 100px !important;\n bottom: 0 !important;\n top: unset !important;\n }\n .motto-mobile-skip-button {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important;\n }\n}\n.shaka-seek-bar-container {\n height: 6px !important;\n width: 100% !important;\n margin: 8px 0 !important;\n border-radius: 4px !important;\n position: relative !important;\n border-top: none !important;\n border-bottom: none !important;\n box-shadow: none !important;\n}\n.shaka-seek-bar {\n height: 6px !important;\n width: 100% !important;\n -webkit-appearance: none !important;\n appearance: none !important;\n background: transparent !important;\n cursor: pointer !important;\n border: none !important;\n outline: none !important;\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n border-radius: 4px !important;\n}\n.shaka-seek-bar::-webkit-slider-runnable-track {\n height: 6px !important;\n background: transparent !important;\n border-radius: 4px !important;\n border: none !important;\n}\n.shaka-seek-bar::-moz-range-track {\n height: 6px !important;\n background: transparent !important;\n border-radius: 4px !important;\n border: none !important;\n}\n.shaka-seek-bar::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 16px !important;\n height: 16px !important;\n border-radius: 50% !important;\n background: #ffffff !important;\n cursor: pointer !important;\n border: 2px solid #ffffff !important;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\n margin-top: -4px !important;\n}\n.shaka-seek-bar::-moz-range-thumb {\n width: 16px !important;\n height: 16px !important;\n border-radius: 50% !important;\n background: #ffffff !important;\n cursor: pointer !important;\n border: 2px solid #ffffff !important;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;\n margin-top: -4px !important;\n}\n.motto-skip-back-button,\n.motto-skip-forward-button,\n.motto-native-skip-button {\n background: transparent !important;\n border: none !important;\n padding: 4px !important;\n margin: 0px !important;\n cursor: pointer !important;\n color: #ffffff !important;\n transition: all 0.2s ease !important;\n min-width: 32px !important;\n height: 32px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n border-radius: 4px !important;\n width: 25px;\n}\n.motto-skip-back-button:hover,\n.motto-skip-forward-button:hover,\n.motto-native-skip-button:hover {\n opacity: 0.8 !important;\n background: transparent !important;\n transform: scale(1.05) !important;\n}\n.motto-skip-back-button:active,\n.motto-skip-forward-button:active,\n.motto-native-skip-button:active {\n transform: scale(0.95) !important;\n}\n.motto-skip-back-button svg,\n.motto-skip-forward-button svg,\n.motto-native-skip-button svg {\n width: 24px !important;\n height: 24px !important;\n}\n@media (max-width: 767px) {\n .shaka-controls-container .motto-native-skip-button,\n .shaka-controls-container .motto-skip-back-button,\n .shaka-controls-container .motto-skip-forward-button,\n .shaka-controls-container .shaka-play-button,\n .shaka-controls-container .shaka-pause-button {\n display: none !important;\n }\n}\n.shaka-spinner-svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-spinner-path {\n stroke: white !important;\n fill: none !important;\n}\n.shaka-spinner-container {\n color: white !important;\n}\n.shaka-buffering-spinner {\n color: white !important;\n fill: white !important;\n}\n.shaka-buffering-spinner svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-buffering-spinner path {\n stroke: white !important;\n fill: none !important;\n}\n[data-shaka-player-container] .shaka-spinner,\n[data-shaka-player-container] .spinner {\n color: white !important;\n border-color: white !important;\n}\n.material-icons.shaka-spinner {\n color: white !important;\n}\n.shaka-controls-container .shaka-spinner,\n.shaka-video-container .shaka-spinner {\n color: white !important;\n fill: white !important;\n}\n.shaka-controls-container .shaka-spinner svg,\n.shaka-video-container .shaka-spinner svg {\n color: white !important;\n fill: white !important;\n}\n.shaka-controls-container .shaka-spinner path,\n.shaka-video-container .shaka-spinner path {\n stroke: white !important;\n}\n.motto-video-loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background:\n linear-gradient(\n 135deg,\n #1a1a1a 0%,\n #2d2d2d 100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10;\n transition: opacity 0.3s ease;\n}\n.motto-video-loading-overlay.hidden {\n opacity: 0;\n pointer-events: none;\n}\n.motto-video-loading-content {\n text-align: center;\n color: white;\n}\n.motto-video-loading-icon {\n width: 64px;\n height: 64px;\n margin-bottom: 16px;\n opacity: 0.7;\n}\n.motto-video-loading-text {\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 8px;\n}\n.motto-video-loading-subtext {\n font-size: 14px;\n opacity: 0.7;\n}\n@keyframes pulse-live {\n 0% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-gradient-position { syntax: "*"; inherits: false; }\n@property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-via-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }\n@property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }\n@property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-tracking { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-blur { syntax: "*"; inherits: false; }\n@property --tw-brightness { syntax: "*"; inherits: false; }\n@property --tw-contrast { syntax: "*"; inherits: false; }\n@property --tw-grayscale { syntax: "*"; inherits: false; }\n@property --tw-hue-rotate { syntax: "*"; inherits: false; }\n@property --tw-invert { syntax: "*"; inherits: false; }\n@property --tw-opacity { syntax: "*"; inherits: false; }\n@property --tw-saturate { syntax: "*"; inherits: false; }\n@property --tw-sepia { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }\n@property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-duration { syntax: "*"; inherits: false; }\n@property --tw-scale-x { syntax: "*"; inherits: false; initial-value: 1; }\n@property --tw-scale-y { syntax: "*"; inherits: false; initial-value: 1; }\n@property --tw-scale-z { syntax: "*"; inherits: false; initial-value: 1; }\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-duration: initial;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-scale-z: 1;\n }\n }\n}\n');
|
|
1149
|
+
|
|
1150
|
+
// src/Player.tsx
|
|
1151
|
+
var import_tailwind_merge2 = require("tailwind-merge");
|
|
1152
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1153
|
+
var Player = (0, import_react11.forwardRef)(
|
|
1154
|
+
({
|
|
1155
|
+
src,
|
|
1156
|
+
autoPlay = false,
|
|
1157
|
+
loop = false,
|
|
1158
|
+
muted = false,
|
|
1159
|
+
controls = true,
|
|
1160
|
+
poster,
|
|
1161
|
+
width,
|
|
1162
|
+
height,
|
|
1163
|
+
aspectRatio = 16 / 9,
|
|
1164
|
+
shakaConfig,
|
|
1165
|
+
drmConfig,
|
|
1166
|
+
muxConfig,
|
|
1167
|
+
imaConfig,
|
|
1168
|
+
chromecastConfig,
|
|
1169
|
+
qualityConfig,
|
|
1170
|
+
seekbarConfig,
|
|
1171
|
+
events,
|
|
1172
|
+
containerClassName,
|
|
1173
|
+
streamStartDate,
|
|
1174
|
+
...props
|
|
1175
|
+
}, ref) => {
|
|
1176
|
+
const videoRef = (0, import_react11.useRef)(null);
|
|
1177
|
+
const containerRef = (0, import_react11.useRef)(null);
|
|
1178
|
+
const adContainerRef = (0, import_react11.useRef)(null);
|
|
1179
|
+
(0, import_react11.useImperativeHandle)(ref, () => videoRef.current, []);
|
|
1180
|
+
const { playerRef, initializePlayer, destroyPlayer } = useShakePlayer({
|
|
1181
|
+
src,
|
|
1182
|
+
shakaConfig,
|
|
1183
|
+
drmConfig,
|
|
1184
|
+
onError: events?.onError,
|
|
1185
|
+
onPlayerReady: events?.onPlayerReady
|
|
1186
|
+
});
|
|
1187
|
+
const {
|
|
1188
|
+
getAvailableQualities,
|
|
1189
|
+
setQuality,
|
|
1190
|
+
setupQualityTracking,
|
|
1191
|
+
configureQuality
|
|
1192
|
+
} = useQualityControl(playerRef, qualityConfig, events?.onQualityChange);
|
|
1193
|
+
const {
|
|
1194
|
+
skipBack,
|
|
1195
|
+
skipForward,
|
|
1196
|
+
skipDuration,
|
|
1197
|
+
shouldShowSkipControls
|
|
1198
|
+
} = useSkipControls(videoRef, events?.onSkipBack, events?.onSkipForward);
|
|
1199
|
+
const {
|
|
1200
|
+
initializeMux,
|
|
1201
|
+
updateMuxData,
|
|
1202
|
+
handleMuxError,
|
|
1203
|
+
destroyMux
|
|
1204
|
+
} = useMuxAnalytics(playerRef, muxConfig, events?.onMuxReady, events?.onMuxDataUpdate);
|
|
1205
|
+
const { setupEventListeners, cleanupEventListeners } = useEventHandlers(videoRef, {
|
|
1206
|
+
onPlay: events?.onPlay,
|
|
1207
|
+
onPause: events?.onPause,
|
|
1208
|
+
onEnded: events?.onEnded,
|
|
1209
|
+
onLoadStart: events?.onLoadStart,
|
|
1210
|
+
onCanPlay: events?.onCanPlay
|
|
1211
|
+
});
|
|
1212
|
+
const { uiRef, initializeUI, destroyUI } = useShakaUI(
|
|
1213
|
+
playerRef,
|
|
1214
|
+
containerRef,
|
|
1215
|
+
videoRef,
|
|
1216
|
+
controls,
|
|
1217
|
+
chromecastConfig,
|
|
1218
|
+
seekbarConfig,
|
|
1219
|
+
events?.onSkipBack,
|
|
1220
|
+
events?.onSkipForward
|
|
1221
|
+
);
|
|
1222
|
+
const { isLive, isVisible: isLiveBadgeVisible } = useLiveBadge(playerRef, {
|
|
1223
|
+
enabled: true,
|
|
1224
|
+
onLiveStateChange: (isLive2) => {
|
|
1225
|
+
events?.onLiveStateChange?.(isLive2);
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
useLiveIndicator(containerRef, {
|
|
1229
|
+
enabled: true,
|
|
1230
|
+
indicatorColor: "#ff0000",
|
|
1231
|
+
indicatorSize: 8,
|
|
1232
|
+
showPulseAnimation: true
|
|
1233
|
+
});
|
|
1234
|
+
const { detectedStreamStart, effectiveStreamStart } = useShakaAbsoluteTime({
|
|
1235
|
+
player: playerRef.current,
|
|
1236
|
+
controls: uiRef.current,
|
|
1237
|
+
manualStreamStartDate: streamStartDate
|
|
1238
|
+
});
|
|
1239
|
+
const initializeAds = () => {
|
|
1240
|
+
if (!imaConfig || !playerRef.current || !videoRef.current) return;
|
|
1241
|
+
const adManager = playerRef.current.getAdManager();
|
|
1242
|
+
if (!adManager) return;
|
|
1243
|
+
adManager.addEventListener(import_shaka_player4.default.ads?.Utils?.AD_STARTED, () => {
|
|
1244
|
+
events?.onAdStart?.();
|
|
1245
|
+
});
|
|
1246
|
+
adManager.addEventListener(import_shaka_player4.default.ads?.Utils?.AD_COMPLETE, () => {
|
|
1247
|
+
events?.onAdComplete?.();
|
|
1248
|
+
});
|
|
1249
|
+
adManager.addEventListener(import_shaka_player4.default.ads?.Utils?.AD_ERROR, (event) => {
|
|
1250
|
+
events?.onAdError?.(event.detail);
|
|
1251
|
+
});
|
|
1252
|
+
if (imaConfig.adTagUrl) {
|
|
1253
|
+
const adContainer = adContainerRef.current;
|
|
1254
|
+
if (adContainer) {
|
|
1255
|
+
adManager.initClientSide(adContainer, videoRef.current, imaConfig.adsRenderingSettings);
|
|
1256
|
+
const adsRequest = {
|
|
1257
|
+
adTagUrl: imaConfig.adTagUrl,
|
|
1258
|
+
linearAdSlotWidth: imaConfig.linearAdSlotWidth || width || 640,
|
|
1259
|
+
linearAdSlotHeight: imaConfig.linearAdSlotHeight || height || 360,
|
|
1260
|
+
nonLinearAdSlotWidth: imaConfig.nonLinearAdSlotWidth || width || 640,
|
|
1261
|
+
nonLinearAdSlotHeight: imaConfig.nonLinearAdSlotHeight || 150
|
|
1262
|
+
};
|
|
1263
|
+
adManager.requestClientSideAds(adsRequest);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
const initializeChromecast = () => {
|
|
1268
|
+
if (!chromecastConfig?.enabled) {
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
try {
|
|
1272
|
+
if (events?.onCastStateChange) {
|
|
1273
|
+
setTimeout(() => events.onCastStateChange(false), 100);
|
|
1274
|
+
}
|
|
1275
|
+
} catch (error) {
|
|
1276
|
+
console.warn("Chromecast initialization failed:", error);
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
(0, import_react11.useEffect)(() => {
|
|
1280
|
+
const video = videoRef.current;
|
|
1281
|
+
if (!video) return;
|
|
1282
|
+
const initialize = async () => {
|
|
1283
|
+
try {
|
|
1284
|
+
await initializePlayer(video);
|
|
1285
|
+
setupEventListeners();
|
|
1286
|
+
const cleanupQuality = setupQualityTracking();
|
|
1287
|
+
configureQuality();
|
|
1288
|
+
await initializeUI();
|
|
1289
|
+
initializeMux();
|
|
1290
|
+
initializeAds();
|
|
1291
|
+
initializeChromecast();
|
|
1292
|
+
} catch (error) {
|
|
1293
|
+
console.error("Error during player initialization:", error);
|
|
1294
|
+
handleMuxError(error);
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
initialize();
|
|
1298
|
+
return () => {
|
|
1299
|
+
cleanupEventListeners();
|
|
1300
|
+
destroyUI();
|
|
1301
|
+
destroyMux();
|
|
1302
|
+
destroyPlayer();
|
|
1303
|
+
};
|
|
1304
|
+
}, [
|
|
1305
|
+
src,
|
|
1306
|
+
initializePlayer,
|
|
1307
|
+
setupEventListeners,
|
|
1308
|
+
setupQualityTracking,
|
|
1309
|
+
configureQuality,
|
|
1310
|
+
initializeUI,
|
|
1311
|
+
initializeMux,
|
|
1312
|
+
cleanupEventListeners,
|
|
1313
|
+
destroyUI,
|
|
1314
|
+
destroyMux,
|
|
1315
|
+
destroyPlayer,
|
|
1316
|
+
handleMuxError,
|
|
1317
|
+
playerRef
|
|
1318
|
+
]);
|
|
1319
|
+
(0, import_react11.useEffect)(() => {
|
|
1320
|
+
const video = videoRef.current;
|
|
1321
|
+
if (!video) return;
|
|
1322
|
+
video.autoplay = autoPlay;
|
|
1323
|
+
video.loop = loop;
|
|
1324
|
+
video.muted = muted;
|
|
1325
|
+
video.controls = false;
|
|
1326
|
+
if (poster) video.poster = poster;
|
|
1327
|
+
}, [autoPlay, loop, muted, poster]);
|
|
1328
|
+
(0, import_react11.useImperativeHandle)(ref, () => ({
|
|
1329
|
+
...videoRef.current,
|
|
1330
|
+
// Custom methods for quality control
|
|
1331
|
+
getAvailableQualities,
|
|
1332
|
+
setQuality,
|
|
1333
|
+
// Skip methods
|
|
1334
|
+
skipBack,
|
|
1335
|
+
skipForward,
|
|
1336
|
+
// Mux methods
|
|
1337
|
+
updateMuxData,
|
|
1338
|
+
// Access to underlying instances
|
|
1339
|
+
getPlayer: () => playerRef.current,
|
|
1340
|
+
getMuxMonitor: () => null
|
|
1341
|
+
}), [getAvailableQualities, setQuality, skipBack, skipForward, updateMuxData]);
|
|
1342
|
+
const isResponsive = !width && !height;
|
|
1343
|
+
const containerClasses = (0, import_tailwind_merge2.twMerge)(containerClassName, "motto-video-container");
|
|
1344
|
+
const containerStyle = isResponsive ? {
|
|
1345
|
+
aspectRatio: aspectRatio.toString()
|
|
1346
|
+
} : { width, height };
|
|
1347
|
+
const videoClasses = isResponsive ? "motto-video-responsive" : "w-full h-full ";
|
|
1348
|
+
const videoStyle = isResponsive ? {} : { width, height };
|
|
1349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1350
|
+
"div",
|
|
1351
|
+
{
|
|
1352
|
+
ref: containerRef,
|
|
1353
|
+
className: containerClasses,
|
|
1354
|
+
style: containerStyle,
|
|
1355
|
+
"data-shaka-player-container": true,
|
|
1356
|
+
"data-shaka-player-cast-receiver-id": chromecastConfig?.receiverApplicationId,
|
|
1357
|
+
children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1359
|
+
"video",
|
|
1360
|
+
{
|
|
1361
|
+
ref: videoRef,
|
|
1362
|
+
className: videoClasses,
|
|
1363
|
+
width: isResponsive ? void 0 : width,
|
|
1364
|
+
height: isResponsive ? void 0 : height,
|
|
1365
|
+
style: videoStyle,
|
|
1366
|
+
controls: false,
|
|
1367
|
+
...props
|
|
1368
|
+
}
|
|
1369
|
+
),
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LiveBadge, { isVisible: isLiveBadgeVisible }),
|
|
1371
|
+
imaConfig && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
ref: adContainerRef,
|
|
1375
|
+
className: "absolute top-0 left-0 w-full h-full pointer-events-auto"
|
|
1376
|
+
}
|
|
1377
|
+
)
|
|
1378
|
+
]
|
|
1379
|
+
}
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1382
|
+
);
|
|
1383
|
+
Player.displayName = "Player";
|
|
1384
|
+
|
|
1385
|
+
// src/Video.tsx
|
|
1386
|
+
var import_react13 = require("react");
|
|
1387
|
+
var import_tailwind_merge3 = require("tailwind-merge");
|
|
1388
|
+
var import_react_query = require("@tanstack/react-query");
|
|
1389
|
+
|
|
1390
|
+
// src/api/video.ts
|
|
1391
|
+
var fetchVideoData = async (videoId, publicKey, mottoToken) => {
|
|
1392
|
+
const endpoint = "https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/GetVideo";
|
|
1393
|
+
const url = new URL(endpoint);
|
|
1394
|
+
url.searchParams.set("encoding", "json");
|
|
1395
|
+
url.searchParams.set("message", JSON.stringify({ videoId }));
|
|
1396
|
+
const response = await fetch(url, {
|
|
1397
|
+
method: "GET",
|
|
1398
|
+
headers: {
|
|
1399
|
+
Authorization: `Bearer ${publicKey}`,
|
|
1400
|
+
...Boolean(mottoToken) && { "x-motto-token": mottoToken }
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
if (!response.ok) {
|
|
1404
|
+
throw new Error(`Failed to fetch video: ${response.statusText}`);
|
|
1405
|
+
}
|
|
1406
|
+
const data = await response.json();
|
|
1407
|
+
return data.video;
|
|
1408
|
+
};
|
|
1409
|
+
async function fetchVideosList(publicKey, videoIds, mottoToken, skip = 0, limit = 0) {
|
|
1410
|
+
if (!videoIds || videoIds.length === 0) {
|
|
1411
|
+
return [];
|
|
1412
|
+
}
|
|
1413
|
+
const endpoint = "https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/BatchGetVideos";
|
|
1414
|
+
const url = new URL(endpoint);
|
|
1415
|
+
url.searchParams.set("encoding", "json");
|
|
1416
|
+
url.searchParams.set("message", JSON.stringify({ videoIds }));
|
|
1417
|
+
const response = await fetch(url.toString(), {
|
|
1418
|
+
method: "GET",
|
|
1419
|
+
headers: {
|
|
1420
|
+
Authorization: `Bearer ${publicKey}`,
|
|
1421
|
+
...Boolean(mottoToken) && { "x-motto-token": mottoToken }
|
|
1422
|
+
}
|
|
1423
|
+
}).catch((err) => {
|
|
1424
|
+
throw new Error(`Failed to fetch videos: ${err}`);
|
|
1425
|
+
});
|
|
1426
|
+
if (!response.ok) {
|
|
1427
|
+
throw new Error(`Failed to fetch videos list: ${response.status}`);
|
|
1428
|
+
}
|
|
1429
|
+
const data = await response.json();
|
|
1430
|
+
return data.videos;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// src/api/event.ts
|
|
1434
|
+
async function fetchEventData(publicKey, eventId, unused, filter, order, locale) {
|
|
1435
|
+
const endpoint = "https://cda.mottostreaming.com/motto.cda.cms.event.v1.EventService/GetEvent";
|
|
1436
|
+
const url = new URL(endpoint);
|
|
1437
|
+
const message = { eventId };
|
|
1438
|
+
if (locale?.length) message.locale = locale;
|
|
1439
|
+
if (filter) message.filter = filter;
|
|
1440
|
+
if (order) message.order = order;
|
|
1441
|
+
url.searchParams.set("encoding", "json");
|
|
1442
|
+
url.searchParams.set("message", JSON.stringify(message));
|
|
1443
|
+
const response = await fetch(url.toString(), {
|
|
1444
|
+
method: "GET",
|
|
1445
|
+
headers: {
|
|
1446
|
+
Authorization: `Bearer ${publicKey}`
|
|
1447
|
+
}
|
|
1448
|
+
}).catch((err) => {
|
|
1449
|
+
throw new Error(`Failed to fetch event: ${err}`);
|
|
1450
|
+
});
|
|
1451
|
+
if (!response.ok) {
|
|
1452
|
+
throw new Error(`Failed to fetch event data: ${response.status}`);
|
|
1453
|
+
}
|
|
1454
|
+
const data = await response.json();
|
|
1455
|
+
return data.event;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// src/api/creative-work.ts
|
|
1459
|
+
async function fetchCreativeWorkData(publicKey, creativeWorkId, unused, filter, order, locale) {
|
|
1460
|
+
const endpoint = "https://cda.mottostreaming.com/motto.cda.cms.creative_work.v1.CreativeWorkService/GetCreativeWork";
|
|
1461
|
+
const url = new URL(endpoint);
|
|
1462
|
+
const message = { creativeWorkId };
|
|
1463
|
+
if (locale?.length) message.locale = locale;
|
|
1464
|
+
if (filter) message.filter = filter;
|
|
1465
|
+
if (order) message.order = order;
|
|
1466
|
+
url.searchParams.set("encoding", "json");
|
|
1467
|
+
url.searchParams.set("message", JSON.stringify(message));
|
|
1468
|
+
const response = await fetch(url.toString(), {
|
|
1469
|
+
method: "GET",
|
|
1470
|
+
headers: {
|
|
1471
|
+
Authorization: `Bearer ${publicKey}`
|
|
1472
|
+
}
|
|
1473
|
+
}).catch((err) => {
|
|
1474
|
+
throw new Error(`Failed to fetch creative work: ${err}`);
|
|
1475
|
+
});
|
|
1476
|
+
if (!response.ok) {
|
|
1477
|
+
throw new Error(`Failed to fetch creative work data: ${response.status}`);
|
|
1478
|
+
}
|
|
1479
|
+
const data = await response.json();
|
|
1480
|
+
return data.creativeWork;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
// src/helper.ts
|
|
1484
|
+
var defaultError = {
|
|
1485
|
+
title: "Playback Error",
|
|
1486
|
+
description: "Unable to play the video. Please try again later."
|
|
1487
|
+
};
|
|
1488
|
+
var errorTypes = {
|
|
1489
|
+
api: {
|
|
1490
|
+
title: "Failed to Retrieve Video Info",
|
|
1491
|
+
description: "Error fetching video details. Check your videoId and internet connection and try again."
|
|
1492
|
+
},
|
|
1493
|
+
ERROR_CODE_NOT_AUTHENTICATED: {
|
|
1494
|
+
title: "Authorisation",
|
|
1495
|
+
description: "You don't have permission to play this video. "
|
|
1496
|
+
},
|
|
1497
|
+
ERROR_CODE_GEO_BLOCKED: {
|
|
1498
|
+
title: "Geoblocking Restriction",
|
|
1499
|
+
description: "Sorry, this video is not available in your region due to geoblocking restrictions."
|
|
1500
|
+
},
|
|
1501
|
+
ERROR_CODE_NOT_ENTITLED: {
|
|
1502
|
+
title: "Not entitled",
|
|
1503
|
+
description: "Sorry, you are not entitled to play this video."
|
|
1504
|
+
},
|
|
1505
|
+
ERROR_CODE_VPN_BLOCKED: {
|
|
1506
|
+
title: "VPN BLOCKED",
|
|
1507
|
+
description: "This video is not available due to the use of a VPN."
|
|
1508
|
+
},
|
|
1509
|
+
ERROR_CODE_UNSPECIFIED: defaultError,
|
|
1510
|
+
ERROR_CODE_SIGNATURE_MISMATCH: defaultError,
|
|
1511
|
+
ERROR_CODE_INVALID_DOMAIN: defaultError,
|
|
1512
|
+
default: defaultError
|
|
1513
|
+
};
|
|
1514
|
+
var findHLSPlaylist = (video) => {
|
|
1515
|
+
return video?.playlists?.find((playlist) => {
|
|
1516
|
+
return playlist.format === "HLS" || playlist.format === "hls" || playlist.format === "PLAYLIST_FORMAT_HLS";
|
|
1517
|
+
});
|
|
1518
|
+
};
|
|
1519
|
+
var getErrorType = (error, video) => {
|
|
1520
|
+
if (video?.error && errorTypes[video.error]) {
|
|
1521
|
+
return video.error;
|
|
1522
|
+
}
|
|
1523
|
+
return "DEFAULT_ERROR";
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
// src/messages/useMessages.tsx
|
|
1527
|
+
var import_react12 = require("react");
|
|
1528
|
+
|
|
1529
|
+
// src/messages/en.json
|
|
1530
|
+
var en_default = {
|
|
1531
|
+
DAYS: "days",
|
|
1532
|
+
HOURS: "hours",
|
|
1533
|
+
MINUTES: "min",
|
|
1534
|
+
SECONDS: "sec",
|
|
1535
|
+
STARTING_SOON: "Starting soon...",
|
|
1536
|
+
EVENT_NOT_STARTED: "This event has not started...",
|
|
1537
|
+
DEFAULT_ERROR: "Playback Error",
|
|
1538
|
+
DEFAULT_ERROR_DESCRIPTION: "Unable to play the video. Please try again later.",
|
|
1539
|
+
API_ERROR: "Failed to Retrieve Video Info",
|
|
1540
|
+
API_ERROR_DESCRIPTION: "Error fetching video details. Check your videoId and internet connection and try again.",
|
|
1541
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Authorisation",
|
|
1542
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "You don't have permission to play this video.",
|
|
1543
|
+
ERROR_CODE_GEO_BLOCKED: "Geoblocking Restriction",
|
|
1544
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Sorry, this video is not available in your region due to geoblocking restrictions.",
|
|
1545
|
+
ERROR_CODE_NOT_ENTITLED: "Not entitled",
|
|
1546
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Sorry, you are not entitled to play this video.",
|
|
1547
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOCKED",
|
|
1548
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "This video is not available due to the use of a VPN."
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1551
|
+
// src/messages/es.json
|
|
1552
|
+
var es_default = {
|
|
1553
|
+
DAYS: "d\xEDas",
|
|
1554
|
+
HOURS: "horas",
|
|
1555
|
+
MINUTES: "min",
|
|
1556
|
+
SECONDS: "seg",
|
|
1557
|
+
STARTING_SOON: "En instantes...",
|
|
1558
|
+
EVENT_NOT_STARTED: "Este evento a\xFAn no ha comenzado...",
|
|
1559
|
+
DEFAULT_ERROR: "Error de reproducci\xF3n",
|
|
1560
|
+
DEFAULT_ERROR_DESCRIPTION: "No se puede reproducir el video. Por favor, int\xE9ntelo de nuevo m\xE1s tarde.",
|
|
1561
|
+
API_ERROR: "Error al recuperar informaci\xF3n del video",
|
|
1562
|
+
API_ERROR_DESCRIPTION: "Error al obtener detalles del video. Verifique su videoId y conexi\xF3n a internet e int\xE9ntelo de nuevo.",
|
|
1563
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autorizaci\xF3n",
|
|
1564
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "No tienes permiso para reproducir este video.",
|
|
1565
|
+
ERROR_CODE_GEO_BLOCKED: "Restricci\xF3n geogr\xE1fica",
|
|
1566
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Lo siento, este video no est\xE1 disponible en tu regi\xF3n debido a restricciones geogr\xE1ficas.",
|
|
1567
|
+
ERROR_CODE_NOT_ENTITLED: "No autorizado",
|
|
1568
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Lo siento, no est\xE1s autorizado para reproducir este video.",
|
|
1569
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOQUEADO",
|
|
1570
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Este video no est\xE1 disponible debido al uso de una VPN."
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
// src/messages/ar.json
|
|
1574
|
+
var ar_default = {
|
|
1575
|
+
DAYS: "\u0623\u064A\u0627\u0645",
|
|
1576
|
+
HOURS: "\u0633\u0627\u0639\u0627\u062A",
|
|
1577
|
+
MINUTES: "\u062F\u0642\u0627\u0626\u0642",
|
|
1578
|
+
SECONDS: "\u062B\u0648\u0627\u0646\u064A",
|
|
1579
|
+
STARTING_SOON: "\u064A\u0628\u062F\u0623 \u0642\u0631\u064A\u0628\u0627...",
|
|
1580
|
+
EVENT_NOT_STARTED: "\u0647\u0630\u0627 \u0627\u0644\u062D\u062F\u062B \u0644\u0645 \u064A\u0628\u062F\u0623 \u0628\u0639\u062F...",
|
|
1581
|
+
DEFAULT_ERROR: "\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u0634\u063A\u064A\u0644",
|
|
1582
|
+
DEFAULT_ERROR_DESCRIPTION: "\u063A\u064A\u0631 \u0642\u0627\u062F\u0631 \u0639\u0644\u0649 \u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0641\u064A\u062F\u064A\u0648. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u064B\u0627.",
|
|
1583
|
+
API_ERROR: "\u0641\u0634\u0644 \u0641\u064A \u0627\u0633\u062A\u0631\u062C\u0627\u0639 \u0645\u0639\u0644\u0648\u0645\u0627\u062A \u0627\u0644\u0641\u064A\u062F\u064A\u0648",
|
|
1584
|
+
API_ERROR_DESCRIPTION: "\u062E\u0637\u0623 \u0641\u064A \u062C\u0644\u0628 \u062A\u0641\u0627\u0635\u064A\u0644 \u0627\u0644\u0641\u064A\u062F\u064A\u0648. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0645\u0639\u0631\u0641 \u0627\u0644\u0641\u064A\u062F\u064A\u0648 \u0648\u0627\u062A\u0635\u0627\u0644 \u0627\u0644\u0625\u0646\u062A\u0631\u0646\u062A \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",
|
|
1585
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\u062A\u0641\u0648\u064A\u0636",
|
|
1586
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\u0644\u064A\u0633 \u0644\u062F\u064A\u0643 \u0625\u0630\u0646 \u0644\u062A\u0634\u063A\u064A\u0644 \u0647\u0630\u0627 \u0627\u0644\u0641\u064A\u062F\u064A\u0648.",
|
|
1587
|
+
ERROR_CODE_GEO_BLOCKED: "\u0642\u064A\u0648\u062F \u0627\u0644\u062C\u063A\u0631\u0627\u0641\u064A\u0627",
|
|
1588
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\u0639\u0630\u0631\u064B\u0627\u060C \u0647\u0630\u0627 \u0627\u0644\u0641\u064A\u062F\u064A\u0648 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D \u0641\u064A \u0645\u0646\u0637\u0642\u062A\u0643 \u0628\u0633\u0628\u0628 \u0642\u064A\u0648\u062F \u0627\u0644\u062C\u063A\u0631\u0627\u0641\u064A\u0627.",
|
|
1589
|
+
ERROR_CODE_NOT_ENTITLED: "\u063A\u064A\u0631 \u0645\u062E\u0648\u0644",
|
|
1590
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\u0639\u0630\u0631\u064B\u0627\u060C \u0644\u064A\u0633 \u0644\u062F\u064A\u0643 \u0627\u0644\u062D\u0642 \u0641\u064A \u062A\u0634\u063A\u064A\u0644 \u0647\u0630\u0627 \u0627\u0644\u0641\u064A\u062F\u064A\u0648.",
|
|
1591
|
+
ERROR_CODE_VPN_BLOCKED: "\u062A\u0645 \u062D\u0638\u0631 VPN",
|
|
1592
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "\u0647\u0630\u0627 \u0627\u0644\u0641\u064A\u062F\u064A\u0648 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D \u0628\u0633\u0628\u0628 \u0627\u0633\u062A\u062E\u062F\u0627\u0645 VPN."
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
// src/messages/de.json
|
|
1596
|
+
var de_default = {
|
|
1597
|
+
DAYS: "Tage",
|
|
1598
|
+
HOURS: "Stunden",
|
|
1599
|
+
MINUTES: "Min",
|
|
1600
|
+
SECONDS: "Sek",
|
|
1601
|
+
STARTING_SOON: "Beginnt bald...",
|
|
1602
|
+
DEFAULT_ERROR: "Wiedergabefehler",
|
|
1603
|
+
DEFAULT_ERROR_DESCRIPTION: "Das Video kann nicht abgespielt werden. Bitte versuchen Sie es sp\xE4ter erneut.",
|
|
1604
|
+
API_ERROR: "Fehler beim Abrufen der Videoinformationen",
|
|
1605
|
+
API_ERROR_DESCRIPTION: "Fehler beim Abrufen der Videodetails. \xDCberpr\xFCfen Sie Ihre videoId und Internetverbindung und versuchen Sie es erneut.",
|
|
1606
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autorisierung",
|
|
1607
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "Sie haben keine Berechtigung, dieses Video abzuspielen.",
|
|
1608
|
+
ERROR_CODE_GEO_BLOCKED: "Geoblocking-Beschr\xE4nkung",
|
|
1609
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Entschuldigung, dieses Video ist in Ihrer Region aufgrund von Geoblocking-Beschr\xE4nkungen nicht verf\xFCgbar.",
|
|
1610
|
+
ERROR_CODE_NOT_ENTITLED: "Nicht berechtigt",
|
|
1611
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Entschuldigung, Sie sind nicht berechtigt, dieses Video abzuspielen.",
|
|
1612
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOCKIERT",
|
|
1613
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Dieses Video ist aufgrund der Verwendung eines VPN nicht verf\xFCgbar."
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
// src/messages/fr.json
|
|
1617
|
+
var fr_default = {
|
|
1618
|
+
DAYS: "jours",
|
|
1619
|
+
HOURS: "heures",
|
|
1620
|
+
MINUTES: "minutes",
|
|
1621
|
+
SECONDS: "secondes",
|
|
1622
|
+
STARTING_SOON: "Commence bient\xF4t...",
|
|
1623
|
+
EVENT_NOT_STARTED: "Cet \xE9v\xE9nement n'a pas commenc\xE9...",
|
|
1624
|
+
DEFAULT_ERROR: "Erreur de lecture",
|
|
1625
|
+
DEFAULT_ERROR_DESCRIPTION: "Impossible de lire la vid\xE9o. Veuillez r\xE9essayer plus tard.",
|
|
1626
|
+
API_ERROR: "\xC9chec de la r\xE9cup\xE9ration des informations vid\xE9o",
|
|
1627
|
+
API_ERROR_DESCRIPTION: "Erreur lors de la r\xE9cup\xE9ration des d\xE9tails de la vid\xE9o. V\xE9rifiez votre videoId et votre connexion Internet, puis r\xE9essayez.",
|
|
1628
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autorisation",
|
|
1629
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "Vous n'avez pas la permission de lire cette vid\xE9o.",
|
|
1630
|
+
ERROR_CODE_GEO_BLOCKED: "Restriction de g\xE9oblocage",
|
|
1631
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "D\xE9sol\xE9, cette vid\xE9o n'est pas disponible dans votre r\xE9gion en raison de restrictions de g\xE9oblocage.",
|
|
1632
|
+
ERROR_CODE_NOT_ENTITLED: "Non autoris\xE9",
|
|
1633
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "D\xE9sol\xE9, vous n'\xEAtes pas autoris\xE9 \xE0 lire cette vid\xE9o.",
|
|
1634
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOQU\xC9",
|
|
1635
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Cette vid\xE9o n'est pas disponible en raison de l'utilisation d'un VPN."
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
// src/messages/it.json
|
|
1639
|
+
var it_default = {
|
|
1640
|
+
DAYS: "giorni",
|
|
1641
|
+
HOURS: "ore",
|
|
1642
|
+
MINUTES: "minuti",
|
|
1643
|
+
SECONDS: "secondi",
|
|
1644
|
+
STARTING_SOON: "Inizia presto...",
|
|
1645
|
+
DEFAULT_ERROR: "Errore di riproduzione",
|
|
1646
|
+
DEFAULT_ERROR_DESCRIPTION: "Impossibile riprodurre il video. Per favore riprova pi\xF9 tardi.",
|
|
1647
|
+
API_ERROR: "Errore nel recupero delle informazioni video",
|
|
1648
|
+
API_ERROR_DESCRIPTION: "Errore nel recupero dei dettagli del video. Controlla il tuo videoId e la connessione internet e riprova.",
|
|
1649
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autorizzazione",
|
|
1650
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "Non hai il permesso di riprodurre questo video.",
|
|
1651
|
+
ERROR_CODE_GEO_BLOCKED: "Restrizione geoblocking",
|
|
1652
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Spiacenti, questo video non \xE8 disponibile nella tua regione a causa di restrizioni geografiche.",
|
|
1653
|
+
ERROR_CODE_NOT_ENTITLED: "Non autorizzato",
|
|
1654
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Spiacenti, non sei autorizzato a riprodurre questo video.",
|
|
1655
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOCCATA",
|
|
1656
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Questo video non \xE8 disponibile a causa dell'uso di una VPN."
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
// src/messages/ja.json
|
|
1660
|
+
var ja_default = {
|
|
1661
|
+
DAYS: "\u65E5",
|
|
1662
|
+
HOURS: "\u6642\u9593",
|
|
1663
|
+
MINUTES: "\u5206",
|
|
1664
|
+
SECONDS: "\u79D2",
|
|
1665
|
+
STARTING_SOON: "\u307E\u3082\u306A\u304F\u958B\u59CB...",
|
|
1666
|
+
DEFAULT_ERROR: "\u518D\u751F\u30A8\u30E9\u30FC",
|
|
1667
|
+
DEFAULT_ERROR_DESCRIPTION: "\u30D3\u30C7\u30AA\u3092\u518D\u751F\u3067\u304D\u307E\u305B\u3093\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
1668
|
+
API_ERROR: "\u30D3\u30C7\u30AA\u60C5\u5831\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
1669
|
+
API_ERROR_DESCRIPTION: "\u30D3\u30C7\u30AA\u306E\u8A73\u7D30\u3092\u53D6\u5F97\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002videoId\u3068\u30A4\u30F3\u30BF\u30FC\u30CD\u30C3\u30C8\u63A5\u7D9A\u3092\u78BA\u8A8D\u3057\u3066\u3001\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
1670
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\u8A8D\u8A3C",
|
|
1671
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\u3053\u306E\u30D3\u30C7\u30AA\u3092\u518D\u751F\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
|
|
1672
|
+
ERROR_CODE_GEO_BLOCKED: "\u5730\u57DF\u5236\u9650",
|
|
1673
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\u7533\u3057\u8A33\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u5730\u57DF\u5236\u9650\u306E\u305F\u3081\u3053\u306E\u30D3\u30C7\u30AA\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\u3002",
|
|
1674
|
+
ERROR_CODE_NOT_ENTITLED: "\u6A29\u5229\u306A\u3057",
|
|
1675
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\u7533\u3057\u8A33\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u3053\u306E\u30D3\u30C7\u30AA\u3092\u518D\u751F\u3059\u308B\u6A29\u5229\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
|
|
1676
|
+
ERROR_CODE_VPN_BLOCKED: "VPN\u30D6\u30ED\u30C3\u30AF",
|
|
1677
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "VPN\u306E\u4F7F\u7528\u306B\u3088\u308A\u3001\u3053\u306E\u30D3\u30C7\u30AA\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\u3002"
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
// src/messages/ko.json
|
|
1681
|
+
var ko_default = {
|
|
1682
|
+
DAYS: "\uC77C",
|
|
1683
|
+
HOURS: "\uC2DC\uAC04",
|
|
1684
|
+
MINUTES: "\uBD84",
|
|
1685
|
+
SECONDS: "\uCD08",
|
|
1686
|
+
STARTING_SOON: "\uACE7 \uC2DC\uC791...",
|
|
1687
|
+
DEFAULT_ERROR: "\uC7AC\uC0DD \uC624\uB958",
|
|
1688
|
+
DEFAULT_ERROR_DESCRIPTION: "\uBE44\uB514\uC624\uB97C \uC7AC\uC0DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB098\uC911\uC5D0 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
|
|
1689
|
+
API_ERROR: "\uBE44\uB514\uC624 \uC815\uBCF4 \uAC00\uC838\uC624\uAE30 \uC2E4\uD328",
|
|
1690
|
+
API_ERROR_DESCRIPTION: "\uBE44\uB514\uC624 \uC138\uBD80 \uC815\uBCF4\uB97C \uAC00\uC838\uC624\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. videoId\uC640 \uC778\uD130\uB137 \uC5F0\uACB0\uC744 \uD655\uC778\uD558\uACE0 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
|
|
1691
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\uC778\uC99D",
|
|
1692
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\uC774 \uBE44\uB514\uC624\uB97C \uC7AC\uC0DD\uD560 \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
1693
|
+
ERROR_CODE_GEO_BLOCKED: "\uC9C0\uC5ED \uC81C\uD55C",
|
|
1694
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\uC8C4\uC1A1\uD569\uB2C8\uB2E4. \uC774 \uBE44\uB514\uC624\uB294 \uC9C0\uC5ED \uC81C\uD55C\uC73C\uB85C \uC778\uD574 \uADC0\uD558\uC758 \uC9C0\uC5ED\uC5D0\uC11C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
1695
|
+
ERROR_CODE_NOT_ENTITLED: "\uAD8C\uD55C \uC5C6\uC74C",
|
|
1696
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\uC8C4\uC1A1\uD569\uB2C8\uB2E4. \uC774 \uBE44\uB514\uC624\uB97C \uC7AC\uC0DD\uD560 \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
1697
|
+
ERROR_CODE_VPN_BLOCKED: "VPN \uCC28\uB2E8\uB428",
|
|
1698
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "VPN \uC0AC\uC6A9\uC73C\uB85C \uC778\uD574 \uC774 \uBE44\uB514\uC624\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
// src/messages/pt.json
|
|
1702
|
+
var pt_default = {
|
|
1703
|
+
DAYS: "dias",
|
|
1704
|
+
HOURS: "horas",
|
|
1705
|
+
MINUTES: "minutos",
|
|
1706
|
+
SECONDS: "segundos",
|
|
1707
|
+
STARTING_SOON: "Come\xE7ando em breve...",
|
|
1708
|
+
DEFAULT_ERROR: "Playback Error",
|
|
1709
|
+
DEFAULT_ERROR_DESCRIPTION: "N\xE3o foi poss\xEDvel reproduzir o v\xEDdeo. Por favor, tente novamente mais tarde.",
|
|
1710
|
+
API_ERROR: "Falha ao Recuperar Informa\xE7\xF5es do V\xEDdeo",
|
|
1711
|
+
API_ERROR_DESCRIPTION: "Erro ao buscar detalhes do v\xEDdeo. Verifique seu videoId e conex\xE3o com a internet e tente novamente.",
|
|
1712
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autoriza\xE7\xE3o",
|
|
1713
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "Voc\xEA n\xE3o tem permiss\xE3o para reproduzir este v\xEDdeo.",
|
|
1714
|
+
ERROR_CODE_GEO_BLOCKED: "Restri\xE7\xE3o de Geoblocking",
|
|
1715
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Desculpe, este v\xEDdeo n\xE3o est\xE1 dispon\xEDvel em sua regi\xE3o devido a restri\xE7\xF5es de geoblocking.",
|
|
1716
|
+
ERROR_CODE_NOT_ENTITLED: "N\xE3o autorizado",
|
|
1717
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Desculpe, voc\xEA n\xE3o est\xE1 autorizado a reproduzir este v\xEDdeo.",
|
|
1718
|
+
ERROR_CODE_VPN_BLOCKED: "VPN BLOQUEADO",
|
|
1719
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Este v\xEDdeo n\xE3o est\xE1 dispon\xEDvel devido ao uso de uma VPN."
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
// src/messages/ru.json
|
|
1723
|
+
var ru_default = {
|
|
1724
|
+
DAYS: "\u0434\u043D\u0435\u0439",
|
|
1725
|
+
HOURS: "\u0447\u0430\u0441\u043E\u0432",
|
|
1726
|
+
MINUTES: "\u043C\u0438\u043D",
|
|
1727
|
+
SECONDS: "\u0441\u0435\u043A",
|
|
1728
|
+
STARTING_SOON: "\u0421\u043A\u043E\u0440\u043E \u043D\u0430\u0447\u043D\u0435\u0442\u0441\u044F...",
|
|
1729
|
+
DEFAULT_ERROR: "\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F",
|
|
1730
|
+
DEFAULT_ERROR_DESCRIPTION: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0432\u0438\u0434\u0435\u043E. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0437\u0436\u0435.",
|
|
1731
|
+
API_ERROR: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E \u0432\u0438\u0434\u0435\u043E",
|
|
1732
|
+
API_ERROR_DESCRIPTION: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0438 \u0434\u0435\u0442\u0430\u043B\u0435\u0439 \u0432\u0438\u0434\u0435\u043E. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0432\u0430\u0448 videoId \u0438 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0443, \u0437\u0430\u0442\u0435\u043C \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
|
|
1733
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F",
|
|
1734
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\u0423 \u0432\u0430\u0441 \u043D\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u044F \u043D\u0430 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0433\u043E \u0432\u0438\u0434\u0435\u043E.",
|
|
1735
|
+
ERROR_CODE_GEO_BLOCKED: "\u0413\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435",
|
|
1736
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\u0418\u0437\u0432\u0438\u043D\u0438\u0442\u0435, \u044D\u0442\u043E \u0432\u0438\u0434\u0435\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0432 \u0432\u0430\u0448\u0435\u043C \u0440\u0435\u0433\u0438\u043E\u043D\u0435 \u0438\u0437-\u0437\u0430 \u0433\u0435\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0439.",
|
|
1737
|
+
ERROR_CODE_NOT_ENTITLED: "\u041D\u0435\u0442 \u043F\u0440\u0430\u0432",
|
|
1738
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\u0418\u0437\u0432\u0438\u043D\u0438\u0442\u0435, \u0443 \u0432\u0430\u0441 \u043D\u0435\u0442 \u043F\u0440\u0430\u0432 \u043D\u0430 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0433\u043E \u0432\u0438\u0434\u0435\u043E.",
|
|
1739
|
+
ERROR_CODE_VPN_BLOCKED: "VPN \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D",
|
|
1740
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "\u042D\u0442\u043E \u0432\u0438\u0434\u0435\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0438\u0437-\u0437\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F VPN."
|
|
1741
|
+
};
|
|
1742
|
+
|
|
1743
|
+
// src/messages/zh.json
|
|
1744
|
+
var zh_default = {
|
|
1745
|
+
DAYS: "\u5929",
|
|
1746
|
+
HOURS: "\u5C0F\u65F6",
|
|
1747
|
+
MINUTES: "\u5206\u949F",
|
|
1748
|
+
SECONDS: "\u79D2",
|
|
1749
|
+
STARTING_SOON: "\u5373\u5C06\u5F00\u59CB...",
|
|
1750
|
+
DEFAULT_ERROR: "\u64AD\u653E\u9519\u8BEF",
|
|
1751
|
+
DEFAULT_ERROR_DESCRIPTION: "\u65E0\u6CD5\u64AD\u653E\u89C6\u9891\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",
|
|
1752
|
+
API_ERROR: "\u83B7\u53D6\u89C6\u9891\u4FE1\u606F\u5931\u8D25",
|
|
1753
|
+
API_ERROR_DESCRIPTION: "\u83B7\u53D6\u89C6\u9891\u8BE6\u60C5\u65F6\u51FA\u9519\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u89C6\u9891ID\u548C\u4E92\u8054\u7F51\u8FDE\u63A5\uFF0C\u7136\u540E\u91CD\u8BD5\u3002",
|
|
1754
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\u6388\u6743",
|
|
1755
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\u60A8\u6CA1\u6709\u6743\u9650\u64AD\u653E\u6B64\u89C6\u9891\u3002",
|
|
1756
|
+
ERROR_CODE_GEO_BLOCKED: "\u5730\u7406\u5C01\u9501\u9650\u5236",
|
|
1757
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\u62B1\u6B49\uFF0C\u7531\u4E8E\u5730\u7406\u5C01\u9501\u9650\u5236\uFF0C\u6B64\u89C6\u9891\u5728\u60A8\u7684\u5730\u533A\u4E0D\u53EF\u7528\u3002",
|
|
1758
|
+
ERROR_CODE_NOT_ENTITLED: "\u65E0\u6743\u64AD\u653E",
|
|
1759
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\u62B1\u6B49\uFF0C\u60A8\u65E0\u6743\u64AD\u653E\u6B64\u89C6\u9891\u3002",
|
|
1760
|
+
ERROR_CODE_VPN_BLOCKED: "VPN\u88AB\u5C01\u9501",
|
|
1761
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "\u7531\u4E8E\u4F7F\u7528VPN\uFF0C\u6B64\u89C6\u9891\u4E0D\u53EF\u7528\u3002"
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
// src/messages/nl.json
|
|
1765
|
+
var nl_default = {
|
|
1766
|
+
DAYS: "dagen",
|
|
1767
|
+
HOURS: "uren",
|
|
1768
|
+
MINUTES: "min",
|
|
1769
|
+
SECONDS: "sec",
|
|
1770
|
+
STARTING_SOON: "Begint binnenkort...",
|
|
1771
|
+
EVENT_NOT_STARTED: "Dit evenement is nog niet begonnen...",
|
|
1772
|
+
DEFAULT_ERROR: "Afspelfout",
|
|
1773
|
+
DEFAULT_ERROR_DESCRIPTION: "Kan de video niet afspelen. Probeer het later opnieuw.",
|
|
1774
|
+
API_ERROR: "Kan videogegevens niet ophalen",
|
|
1775
|
+
API_ERROR_DESCRIPTION: "Fout bij het ophalen van videogegevens. Controleer uw video-ID en internetverbinding en probeer het opnieuw.",
|
|
1776
|
+
ERROR_CODE_NOT_AUTHENTICATED: "Autorisatie",
|
|
1777
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "U heeft geen toestemming om deze video af te spelen.",
|
|
1778
|
+
ERROR_CODE_GEO_BLOCKED: "Geoblocking Beperking",
|
|
1779
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "Sorry, deze video is niet beschikbaar in uw regio vanwege geoblocking beperkingen.",
|
|
1780
|
+
ERROR_CODE_NOT_ENTITLED: "Geen recht",
|
|
1781
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "Sorry, u heeft geen recht om deze video af te spelen.",
|
|
1782
|
+
ERROR_CODE_VPN_BLOCKED: "VPN GEBLOKKEERD",
|
|
1783
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "Deze video is niet beschikbaar vanwege het gebruik van een VPN."
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
// src/messages/fa.json
|
|
1787
|
+
var fa_default = {
|
|
1788
|
+
DAYS: "\u0631\u0648\u0632\u0647\u0627",
|
|
1789
|
+
HOURS: "\u0633\u0627\u0639\u062A\u200C\u0647\u0627",
|
|
1790
|
+
MINUTES: "\u062F\u0642\u06CC\u0642\u0647\u200C\u0647\u0627",
|
|
1791
|
+
SECONDS: "\u062B\u0627\u0646\u06CC\u0647\u200C\u0647\u0627",
|
|
1792
|
+
STARTING_SOON: "\u0628\u0647 \u0632\u0648\u062F\u06CC \u0634\u0631\u0648\u0639 \u0645\u06CC\u200C\u0634\u0648\u062F...",
|
|
1793
|
+
EVENT_NOT_STARTED: "\u0627\u06CC\u0646 \u0631\u0648\u06CC\u062F\u0627\u062F \u0647\u0646\u0648\u0632 \u0634\u0631\u0648\u0639 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A...",
|
|
1794
|
+
DEFAULT_ERROR: "\u062E\u0637\u0627\u06CC \u067E\u062E\u0634",
|
|
1795
|
+
DEFAULT_ERROR_DESCRIPTION: "\u0627\u0645\u06A9\u0627\u0646 \u067E\u062E\u0634 \u0648\u06CC\u062F\u06CC\u0648 \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F. \u0644\u0637\u0641\u0627\u064B \u0628\u0639\u062F\u0627\u064B \u062F\u0648\u0628\u0627\u0631\u0647 \u062A\u0644\u0627\u0634 \u06A9\u0646\u06CC\u062F.",
|
|
1796
|
+
API_ERROR: "\u062E\u0637\u0627 \u062F\u0631 \u0628\u0627\u0632\u06CC\u0627\u0628\u06CC \u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0648\u06CC\u062F\u06CC\u0648",
|
|
1797
|
+
API_ERROR_DESCRIPTION: "\u062E\u0637\u0627 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u062C\u0632\u0626\u06CC\u0627\u062A \u0648\u06CC\u062F\u06CC\u0648. \u0648\u06CC\u062F\u06CC\u0648Id \u0648 \u0627\u062A\u0635\u0627\u0644 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u062E\u0648\u062F \u0631\u0627 \u0628\u0631\u0631\u0633\u06CC \u06A9\u0631\u062F\u0647 \u0648 \u062F\u0648\u0628\u0627\u0631\u0647 \u062A\u0644\u0627\u0634 \u06A9\u0646\u06CC\u062F.",
|
|
1798
|
+
ERROR_CODE_NOT_AUTHENTICATED: "\u0645\u062C\u0648\u0632",
|
|
1799
|
+
ERROR_CODE_NOT_AUTHENTICATED_DESCRIPTION: "\u0634\u0645\u0627 \u0627\u062C\u0627\u0632\u0647 \u067E\u062E\u0634 \u0627\u06CC\u0646 \u0648\u06CC\u062F\u06CC\u0648 \u0631\u0627 \u0646\u062F\u0627\u0631\u06CC\u062F.",
|
|
1800
|
+
ERROR_CODE_GEO_BLOCKED: "\u0645\u062D\u062F\u0648\u062F\u06CC\u062A \u062C\u063A\u0631\u0627\u0641\u06CC\u0627\u06CC\u06CC",
|
|
1801
|
+
ERROR_CODE_GEO_BLOCKED_DESCRIPTION: "\u0645\u062A\u0627\u0633\u0641\u06CC\u0645\u060C \u0627\u06CC\u0646 \u0648\u06CC\u062F\u06CC\u0648 \u0628\u0647 \u062F\u0644\u06CC\u0644 \u0645\u062D\u062F\u0648\u062F\u06CC\u062A\u200C\u0647\u0627\u06CC \u062C\u063A\u0631\u0627\u0641\u06CC\u0627\u06CC\u06CC \u062F\u0631 \u0645\u0646\u0637\u0642\u0647 \u0634\u0645\u0627 \u062F\u0631 \u062F\u0633\u062A\u0631\u0633 \u0646\u06CC\u0633\u062A.",
|
|
1802
|
+
ERROR_CODE_NOT_ENTITLED: "\u0639\u062F\u0645 \u062F\u0633\u062A\u0631\u0633\u06CC",
|
|
1803
|
+
ERROR_CODE_NOT_ENTITLED_DESCRIPTION: "\u0645\u062A\u0627\u0633\u0641\u06CC\u0645\u060C \u0634\u0645\u0627 \u0627\u062C\u0627\u0632\u0647 \u067E\u062E\u0634 \u0627\u06CC\u0646 \u0648\u06CC\u062F\u06CC\u0648 \u0631\u0627 \u0646\u062F\u0627\u0631\u06CC\u062F.",
|
|
1804
|
+
ERROR_CODE_VPN_BLOCKED: "\u0645\u0633\u062F\u0648\u062F \u0634\u062F\u0646 VPN",
|
|
1805
|
+
ERROR_CODE_VPN_BLOCKED_DESCRIPTION: "\u0627\u06CC\u0646 \u0648\u06CC\u062F\u06CC\u0648 \u0628\u0647 \u062F\u0644\u06CC\u0644 \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 VPN \u062F\u0631 \u062F\u0633\u062A\u0631\u0633 \u0646\u06CC\u0633\u062A."
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
// src/messages/useMessages.tsx
|
|
1809
|
+
var availableLanguages = {
|
|
1810
|
+
en: en_default,
|
|
1811
|
+
es: es_default,
|
|
1812
|
+
ar: ar_default,
|
|
1813
|
+
de: de_default,
|
|
1814
|
+
fr: fr_default,
|
|
1815
|
+
it: it_default,
|
|
1816
|
+
ja: ja_default,
|
|
1817
|
+
ko: ko_default,
|
|
1818
|
+
pt: pt_default,
|
|
1819
|
+
ru: ru_default,
|
|
1820
|
+
zh: zh_default,
|
|
1821
|
+
nl: nl_default,
|
|
1822
|
+
fa: fa_default
|
|
1823
|
+
};
|
|
1824
|
+
var getBrowserLanguage = () => {
|
|
1825
|
+
const language = navigator.language.split("-")[0];
|
|
1826
|
+
return availableLanguages[language] ? language : "en";
|
|
1827
|
+
};
|
|
1828
|
+
var useMessages = (locale) => {
|
|
1829
|
+
const [language, setLanguage] = (0, import_react12.useState)("en");
|
|
1830
|
+
const [translations, setTranslations] = (0, import_react12.useState)(availableLanguages.en);
|
|
1831
|
+
(0, import_react12.useEffect)(() => {
|
|
1832
|
+
const lang = !!availableLanguages?.[locale] ? locale : getBrowserLanguage();
|
|
1833
|
+
;
|
|
1834
|
+
setLanguage(lang);
|
|
1835
|
+
setTranslations(availableLanguages[lang]);
|
|
1836
|
+
}, [locale]);
|
|
1837
|
+
const t = (key) => {
|
|
1838
|
+
if (translations[key]) {
|
|
1839
|
+
return translations[key];
|
|
1840
|
+
}
|
|
1841
|
+
if (language !== "en" && availableLanguages.en[key]) {
|
|
1842
|
+
return availableLanguages.en[key];
|
|
1843
|
+
}
|
|
1844
|
+
return "";
|
|
1845
|
+
};
|
|
1846
|
+
const changeLanguage = (lng) => {
|
|
1847
|
+
if (availableLanguages[lng]) {
|
|
1848
|
+
setLanguage(lng);
|
|
1849
|
+
setTranslations(availableLanguages[lng]);
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
return { t, language, changeLanguage };
|
|
1853
|
+
};
|
|
1854
|
+
var useMessages_default = useMessages;
|
|
1855
|
+
|
|
1856
|
+
// src/Video.tsx
|
|
1857
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1858
|
+
var Video = ({
|
|
1859
|
+
videoId,
|
|
1860
|
+
publicKey,
|
|
1861
|
+
mottoToken,
|
|
1862
|
+
videoData: providedVideoData,
|
|
1863
|
+
refetchInterval = 0,
|
|
1864
|
+
playerName,
|
|
1865
|
+
locale = "en",
|
|
1866
|
+
events,
|
|
1867
|
+
children,
|
|
1868
|
+
className,
|
|
1869
|
+
queryOptions = {},
|
|
1870
|
+
...props
|
|
1871
|
+
}) => {
|
|
1872
|
+
const {
|
|
1873
|
+
data,
|
|
1874
|
+
isLoading,
|
|
1875
|
+
error,
|
|
1876
|
+
refetch
|
|
1877
|
+
} = (0, import_react_query.useQuery)({
|
|
1878
|
+
queryKey: ["video", videoId, publicKey, mottoToken],
|
|
1879
|
+
queryFn: () => fetchVideoData(videoId, publicKey, mottoToken),
|
|
1880
|
+
enabled: !!videoId && !!publicKey && !providedVideoData,
|
|
1881
|
+
refetchInterval: refetchInterval > 0 ? refetchInterval : false,
|
|
1882
|
+
staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
|
|
1883
|
+
// 5 minutes
|
|
1884
|
+
gcTime: queryOptions.cacheTime ?? 10 * 60 * 1e3,
|
|
1885
|
+
// 10 minutes (was cacheTime in v4)
|
|
1886
|
+
retry: queryOptions.retry ?? 3,
|
|
1887
|
+
retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
|
|
1888
|
+
});
|
|
1889
|
+
const video = providedVideoData || data;
|
|
1890
|
+
const { t } = useMessages_default(locale);
|
|
1891
|
+
const activePlaylist = findHLSPlaylist(video);
|
|
1892
|
+
const hlsUrl = activePlaylist?.url;
|
|
1893
|
+
(0, import_react13.useEffect)(() => {
|
|
1894
|
+
if (events?.onVideoData && video) {
|
|
1895
|
+
events.onVideoData(video);
|
|
1896
|
+
}
|
|
1897
|
+
}, [video, events]);
|
|
1898
|
+
if (isLoading || !providedVideoData && !video) {
|
|
1899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loading, {}) }) });
|
|
1900
|
+
}
|
|
1901
|
+
if (!isLoading && video && !hlsUrl && events?.onEmptyPlaylists) {
|
|
1902
|
+
events.onEmptyPlaylists();
|
|
1903
|
+
}
|
|
1904
|
+
if (error || video?.error) {
|
|
1905
|
+
const errorKey = video?.error ? getErrorType(void 0, video) : "API_ERROR";
|
|
1906
|
+
const errorObj = error || new Error(video?.error || "Unknown error");
|
|
1907
|
+
if (events?.onError) {
|
|
1908
|
+
events.onError(errorObj);
|
|
1909
|
+
}
|
|
1910
|
+
const title = t(errorKey) || t("DEFAULT_ERROR");
|
|
1911
|
+
const description = t(`${errorKey}_DESCRIPTION`) || t("DEFAULT_ERROR_DESCRIPTION");
|
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-full h-full", children: [
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1914
|
+
ErrorScreen,
|
|
1915
|
+
{
|
|
1916
|
+
title,
|
|
1917
|
+
description
|
|
1918
|
+
}
|
|
1919
|
+
),
|
|
1920
|
+
children
|
|
1921
|
+
] }) });
|
|
1922
|
+
}
|
|
1923
|
+
if (!hlsUrl) {
|
|
1924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-full h-full bg-[#151515]", children: [
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Title, { title: video?.name || "" }),
|
|
1926
|
+
children
|
|
1927
|
+
] }) });
|
|
1928
|
+
}
|
|
1929
|
+
console.log("hlsUrl", hlsUrl);
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1931
|
+
Player,
|
|
1932
|
+
{
|
|
1933
|
+
...props,
|
|
1934
|
+
src: hlsUrl,
|
|
1935
|
+
className: (0, import_tailwind_merge3.twMerge)("video-player-container", className),
|
|
1936
|
+
events,
|
|
1937
|
+
containerClassName: "w-full h-full",
|
|
1938
|
+
children
|
|
1939
|
+
}
|
|
1940
|
+
) }) });
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1943
|
+
// src/Event.tsx
|
|
1944
|
+
var import_react14 = require("react");
|
|
1945
|
+
var import_tailwind_merge4 = require("tailwind-merge");
|
|
1946
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
1947
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1948
|
+
var Event = ({
|
|
1949
|
+
publicKey,
|
|
1950
|
+
eventId,
|
|
1951
|
+
events,
|
|
1952
|
+
hideTitle,
|
|
1953
|
+
locale = "en",
|
|
1954
|
+
order,
|
|
1955
|
+
filter,
|
|
1956
|
+
className,
|
|
1957
|
+
settings,
|
|
1958
|
+
auth,
|
|
1959
|
+
queryOptions = {},
|
|
1960
|
+
...props
|
|
1961
|
+
}) => {
|
|
1962
|
+
const {
|
|
1963
|
+
data: eventData,
|
|
1964
|
+
isLoading: isEventLoading,
|
|
1965
|
+
error: eventError
|
|
1966
|
+
} = (0, import_react_query2.useQuery)({
|
|
1967
|
+
queryKey: ["event", publicKey, eventId, filter, order, locale],
|
|
1968
|
+
queryFn: () => fetchEventData(publicKey, eventId, void 0, filter, order, locale),
|
|
1969
|
+
enabled: !!publicKey && !!eventId,
|
|
1970
|
+
staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
|
|
1971
|
+
// 5 minutes
|
|
1972
|
+
gcTime: queryOptions.cacheTime ?? 10 * 60 * 1e3,
|
|
1973
|
+
// 10 minutes
|
|
1974
|
+
retry: queryOptions.retry ?? 3,
|
|
1975
|
+
retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
|
|
1976
|
+
});
|
|
1977
|
+
const [activePlaylist, setActivePlaylist] = (0, import_react14.useState)();
|
|
1978
|
+
const [activeVideoId, setActiveVideoId] = (0, import_react14.useState)();
|
|
1979
|
+
const videoIds = eventData?.videoIds ?? [];
|
|
1980
|
+
const {
|
|
1981
|
+
data: videosData,
|
|
1982
|
+
isLoading: videosIsLoading,
|
|
1983
|
+
error: videosError
|
|
1984
|
+
} = (0, import_react_query2.useQuery)({
|
|
1985
|
+
queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken],
|
|
1986
|
+
queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),
|
|
1987
|
+
enabled: !!publicKey && videoIds.length > 0,
|
|
1988
|
+
refetchInterval: activePlaylist === null ? 3e4 : false,
|
|
1989
|
+
staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
|
|
1990
|
+
gcTime: queryOptions.cacheTime ?? 10 * 60 * 1e3,
|
|
1991
|
+
retry: queryOptions.retry ?? 3,
|
|
1992
|
+
retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
|
|
1993
|
+
});
|
|
1994
|
+
const [loadingApisState, setLoadingApisState] = (0, import_react14.useState)(true);
|
|
1995
|
+
(0, import_react14.useEffect)(() => {
|
|
1996
|
+
if (videosData !== void 0) {
|
|
1997
|
+
setLoadingApisState(false);
|
|
1998
|
+
const videosWithPlaylists = videosData.filter(
|
|
1999
|
+
(video) => video.playlists && video.playlists.length > 0
|
|
2000
|
+
);
|
|
2001
|
+
if (videosWithPlaylists.length > 0) {
|
|
2002
|
+
let hlsPlaylistFound = false;
|
|
2003
|
+
for (const video of videosWithPlaylists) {
|
|
2004
|
+
const hlsPlaylist = findHLSPlaylist(video);
|
|
2005
|
+
if (hlsPlaylist?.url) {
|
|
2006
|
+
setActivePlaylist(hlsPlaylist.url);
|
|
2007
|
+
setActiveVideoId(video.id);
|
|
2008
|
+
hlsPlaylistFound = true;
|
|
2009
|
+
break;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
if (!hlsPlaylistFound) {
|
|
2013
|
+
setActivePlaylist(null);
|
|
2014
|
+
setActiveVideoId(null);
|
|
2015
|
+
}
|
|
2016
|
+
} else {
|
|
2017
|
+
setActivePlaylist(null);
|
|
2018
|
+
setActiveVideoId(null);
|
|
2019
|
+
}
|
|
2020
|
+
} else if (eventData && (!eventData.videoIds || eventData.videoIds.length === 0)) {
|
|
2021
|
+
setLoadingApisState(false);
|
|
2022
|
+
setActivePlaylist(null);
|
|
2023
|
+
setActiveVideoId(null);
|
|
2024
|
+
}
|
|
2025
|
+
}, [videosData, eventData]);
|
|
2026
|
+
const { t } = useMessages_default(locale);
|
|
2027
|
+
(0, import_react14.useEffect)(() => {
|
|
2028
|
+
if (events?.onEventData && eventData) {
|
|
2029
|
+
events.onEventData(eventData);
|
|
2030
|
+
}
|
|
2031
|
+
}, [eventData, events]);
|
|
2032
|
+
(0, import_react14.useEffect)(() => {
|
|
2033
|
+
if (events?.onVideoData && activeVideoId && videosData) {
|
|
2034
|
+
const activeVideo = videosData.find((video) => video.id === activeVideoId);
|
|
2035
|
+
if (activeVideo) {
|
|
2036
|
+
events.onVideoData(activeVideo);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
}, [activeVideoId, videosData, events]);
|
|
2040
|
+
const [error, setError] = (0, import_react14.useState)(null);
|
|
2041
|
+
const [loadingPlaylist, setLoadingPlaylist] = (0, import_react14.useState)(true);
|
|
2042
|
+
const videosDataError = videosData?.some((video) => !!video.error);
|
|
2043
|
+
(0, import_react14.useEffect)(() => {
|
|
2044
|
+
if (eventError || videosError || videosDataError) {
|
|
2045
|
+
const errorObj = eventError || videosError || videosData?.find((video) => !!video.error)?.error && new Error(videosData?.find((video) => !!video.error)?.error) || new Error("default");
|
|
2046
|
+
setError(errorObj);
|
|
2047
|
+
if (events?.onError) {
|
|
2048
|
+
events.onError(errorObj);
|
|
2049
|
+
}
|
|
2050
|
+
} else {
|
|
2051
|
+
setError(null);
|
|
2052
|
+
}
|
|
2053
|
+
}, [eventError, videosError, videosDataError, videosData, events]);
|
|
2054
|
+
(0, import_react14.useEffect)(() => {
|
|
2055
|
+
const eventLoadedWithNoVideos = !isEventLoading && eventData && eventData.videoIds && (!eventData.videoIds || eventData?.videoIds?.length === 0) && !loadingApisState;
|
|
2056
|
+
const allApisLoadedWithPotentialVideos = !isEventLoading && !videosIsLoading && eventData && !loadingApisState;
|
|
2057
|
+
if (eventLoadedWithNoVideos || allApisLoadedWithPotentialVideos) {
|
|
2058
|
+
setLoadingPlaylist(false);
|
|
2059
|
+
}
|
|
2060
|
+
}, [isEventLoading, videosIsLoading, eventData, loadingApisState]);
|
|
2061
|
+
if (error) {
|
|
2062
|
+
const title = t(error.message)?.length ? t(error.message) : t("DEFAULT_ERROR");
|
|
2063
|
+
const description = t(`${error.message}_DESCRIPTION`)?.length ? t(`${error.message}_DESCRIPTION`) : t("DEFAULT_ERROR_DESCRIPTION");
|
|
2064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2065
|
+
ErrorScreen,
|
|
2066
|
+
{
|
|
2067
|
+
title,
|
|
2068
|
+
description
|
|
2069
|
+
}
|
|
2070
|
+
) }) });
|
|
2071
|
+
}
|
|
2072
|
+
if (!loadingPlaylist && eventData && !activePlaylist && events?.onEmptyPlaylists) {
|
|
2073
|
+
events.onEmptyPlaylists();
|
|
2074
|
+
}
|
|
2075
|
+
if (loadingPlaylist) {
|
|
2076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loading, {}) }) });
|
|
2077
|
+
}
|
|
2078
|
+
if (activePlaylist && activeVideoId && videosData) {
|
|
2079
|
+
const activeVideo = videosData.find((video) => video.id === activeVideoId);
|
|
2080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full h-full", children: [
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2082
|
+
Player,
|
|
2083
|
+
{
|
|
2084
|
+
...props,
|
|
2085
|
+
src: activePlaylist,
|
|
2086
|
+
className: (0, import_tailwind_merge4.twMerge)(className, "peer"),
|
|
2087
|
+
events,
|
|
2088
|
+
containerClassName: "w-full h-full"
|
|
2089
|
+
}
|
|
2090
|
+
),
|
|
2091
|
+
!hideTitle && eventData && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2092
|
+
TitleAndDescription,
|
|
2093
|
+
{
|
|
2094
|
+
title: eventData.title,
|
|
2095
|
+
description: eventData.description || "",
|
|
2096
|
+
startTime: eventData.startTime,
|
|
2097
|
+
locale
|
|
2098
|
+
}
|
|
2099
|
+
)
|
|
2100
|
+
] }) });
|
|
2101
|
+
}
|
|
2102
|
+
if (eventData) {
|
|
2103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_tailwind_merge4.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2104
|
+
PreEvent,
|
|
2105
|
+
{
|
|
2106
|
+
event: eventData,
|
|
2107
|
+
hideTitle,
|
|
2108
|
+
locale,
|
|
2109
|
+
backgroundImageUrl: settings?.backgroundImageUrl,
|
|
2110
|
+
showAnimation: settings?.showCountdownAnimation
|
|
2111
|
+
}
|
|
2112
|
+
) }) });
|
|
2113
|
+
}
|
|
2114
|
+
return null;
|
|
2115
|
+
};
|
|
2116
|
+
function PreEvent({
|
|
2117
|
+
event,
|
|
2118
|
+
locale = "en",
|
|
2119
|
+
hideTitle,
|
|
2120
|
+
backgroundImageUrl,
|
|
2121
|
+
showAnimation = true
|
|
2122
|
+
}) {
|
|
2123
|
+
const date = new Date(event.startTime);
|
|
2124
|
+
const now = /* @__PURE__ */ new Date();
|
|
2125
|
+
const [remainingTime, setRemainingTime] = (0, import_react14.useState)(
|
|
2126
|
+
date.getTime() - now.getTime()
|
|
2127
|
+
);
|
|
2128
|
+
const shouldBeStarted = remainingTime < 0;
|
|
2129
|
+
const { t } = useMessages_default(locale);
|
|
2130
|
+
(0, import_react14.useEffect)(() => {
|
|
2131
|
+
const interval = setInterval(() => {
|
|
2132
|
+
if (remainingTime < 0) {
|
|
2133
|
+
clearInterval(interval);
|
|
2134
|
+
} else {
|
|
2135
|
+
setRemainingTime(date.getTime() - (/* @__PURE__ */ new Date()).getTime());
|
|
2136
|
+
}
|
|
2137
|
+
}, 1e3);
|
|
2138
|
+
return () => clearInterval(interval);
|
|
2139
|
+
}, [date, remainingTime]);
|
|
2140
|
+
const renderCountdown = (0, import_react14.useCallback)(() => {
|
|
2141
|
+
if (shouldBeStarted) {
|
|
2142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
|
|
2143
|
+
}
|
|
2144
|
+
const seconds = Math.floor(remainingTime / 1e3) % 60;
|
|
2145
|
+
const minutes = Math.floor(remainingTime / 1e3 / 60) % 60;
|
|
2146
|
+
const hours = Math.floor(remainingTime / 1e3 / 60 / 60) % 24;
|
|
2147
|
+
const days = Math.floor(remainingTime / 1e3 / 60 / 60 / 24);
|
|
2148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2151
|
+
"span",
|
|
2152
|
+
{
|
|
2153
|
+
style: { "--value": days },
|
|
2154
|
+
"aria-live": "polite",
|
|
2155
|
+
"aria-label": days.toString(),
|
|
2156
|
+
children: days?.toString()?.padStart(2, "0")
|
|
2157
|
+
}
|
|
2158
|
+
) }),
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
|
|
2160
|
+
] }),
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2163
|
+
"span",
|
|
2164
|
+
{
|
|
2165
|
+
style: { "--value": hours },
|
|
2166
|
+
"aria-live": "polite",
|
|
2167
|
+
"aria-label": hours.toString(),
|
|
2168
|
+
children: hours?.toString()?.padStart(2, "0")
|
|
2169
|
+
}
|
|
2170
|
+
) }),
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
|
|
2172
|
+
] }),
|
|
2173
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2174
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2175
|
+
"span",
|
|
2176
|
+
{
|
|
2177
|
+
style: { "--value": minutes },
|
|
2178
|
+
"aria-live": "polite",
|
|
2179
|
+
"aria-label": minutes.toString(),
|
|
2180
|
+
children: minutes?.toString()?.padStart(2, "0")
|
|
2181
|
+
}
|
|
2182
|
+
) }),
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
|
|
2184
|
+
] }),
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2187
|
+
"span",
|
|
2188
|
+
{
|
|
2189
|
+
style: { "--value": seconds },
|
|
2190
|
+
"aria-live": "polite",
|
|
2191
|
+
"aria-label": seconds.toString(),
|
|
2192
|
+
children: seconds?.toString()?.padStart(2, "0")
|
|
2193
|
+
}
|
|
2194
|
+
) }),
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
|
|
2196
|
+
] })
|
|
2197
|
+
] });
|
|
2198
|
+
}, [remainingTime, shouldBeStarted, t]);
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: event?.posterUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2201
|
+
"div",
|
|
2202
|
+
{
|
|
2203
|
+
className: "relative overflow-hidden bg-base-200 aspect-video text-base-content w-full h-full flex justify-center items-center flex-col bg-no-repeat bg-cover md:rounded-2xl",
|
|
2204
|
+
style: {
|
|
2205
|
+
backgroundImage: `url(${event.posterUrl})`,
|
|
2206
|
+
backgroundRepeat: "no-repeat",
|
|
2207
|
+
backgroundSize: "cover"
|
|
2208
|
+
},
|
|
2209
|
+
children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative z-10", children: renderCountdown() })
|
|
2212
|
+
]
|
|
2213
|
+
}
|
|
2214
|
+
),
|
|
2215
|
+
!hideTitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2216
|
+
TitleAndDescription,
|
|
2217
|
+
{
|
|
2218
|
+
title: event.title,
|
|
2219
|
+
description: event.description || "",
|
|
2220
|
+
startTime: event.startTime,
|
|
2221
|
+
locale
|
|
2222
|
+
}
|
|
2223
|
+
)
|
|
2224
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2226
|
+
"div",
|
|
2227
|
+
{
|
|
2228
|
+
className: "relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat",
|
|
2229
|
+
style: {
|
|
2230
|
+
backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : ""
|
|
2231
|
+
},
|
|
2232
|
+
children: [
|
|
2233
|
+
backgroundImageUrl && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative z-10", children: renderCountdown() })
|
|
2235
|
+
]
|
|
2236
|
+
}
|
|
2237
|
+
),
|
|
2238
|
+
!hideTitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2239
|
+
TitleAndDescription,
|
|
2240
|
+
{
|
|
2241
|
+
title: event.title,
|
|
2242
|
+
description: event.description || "",
|
|
2243
|
+
startTime: event.startTime,
|
|
2244
|
+
locale
|
|
2245
|
+
}
|
|
2246
|
+
)
|
|
2247
|
+
] }) });
|
|
2248
|
+
}
|
|
2249
|
+
var TitleAndDescription = ({
|
|
2250
|
+
title,
|
|
2251
|
+
description,
|
|
2252
|
+
startTime,
|
|
2253
|
+
locale = "en",
|
|
2254
|
+
className
|
|
2255
|
+
}) => {
|
|
2256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_tailwind_merge4.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
|
|
2258
|
+
startTime ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
|
|
2259
|
+
new Date(startTime || "").toLocaleDateString(locale || "default", {
|
|
2260
|
+
month: "long",
|
|
2261
|
+
year: "numeric",
|
|
2262
|
+
day: "numeric"
|
|
2263
|
+
}),
|
|
2264
|
+
" ",
|
|
2265
|
+
"- ",
|
|
2266
|
+
new Date(startTime || "").toLocaleTimeString(locale || "default", {
|
|
2267
|
+
hour: "2-digit",
|
|
2268
|
+
minute: "2-digit"
|
|
2269
|
+
})
|
|
2270
|
+
] }) : null,
|
|
2271
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
|
|
2272
|
+
] });
|
|
2273
|
+
};
|
|
2274
|
+
|
|
2275
|
+
// src/CreativeWork.tsx
|
|
2276
|
+
var import_react15 = require("react");
|
|
2277
|
+
var import_tailwind_merge5 = require("tailwind-merge");
|
|
2278
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
2279
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2280
|
+
var CreativeWork = ({
|
|
2281
|
+
publicKey,
|
|
2282
|
+
creativeWorkId,
|
|
2283
|
+
events,
|
|
2284
|
+
hideTitle,
|
|
2285
|
+
locale = "en",
|
|
2286
|
+
order,
|
|
2287
|
+
filter,
|
|
2288
|
+
className,
|
|
2289
|
+
settings,
|
|
2290
|
+
auth,
|
|
2291
|
+
queryOptions = {},
|
|
2292
|
+
...props
|
|
2293
|
+
}) => {
|
|
2294
|
+
const {
|
|
2295
|
+
data: creativeWorkData,
|
|
2296
|
+
isLoading: isCreativeWorkLoading,
|
|
2297
|
+
error: creativeWorkError
|
|
2298
|
+
} = (0, import_react_query3.useQuery)({
|
|
2299
|
+
queryKey: ["creative-work", publicKey, creativeWorkId, filter, order, locale],
|
|
2300
|
+
queryFn: () => fetchCreativeWorkData(publicKey, creativeWorkId, void 0, filter, order, locale),
|
|
2301
|
+
enabled: !!publicKey && !!creativeWorkId,
|
|
2302
|
+
staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
|
|
2303
|
+
// 5 minutes
|
|
2304
|
+
gcTime: queryOptions.cacheTime ?? 10 * 60 * 1e3,
|
|
2305
|
+
// 10 minutes
|
|
2306
|
+
retry: queryOptions.retry ?? 3,
|
|
2307
|
+
retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
|
|
2308
|
+
});
|
|
2309
|
+
const [activePlaylist, setActivePlaylist] = (0, import_react15.useState)();
|
|
2310
|
+
const [activeVideoId, setActiveVideoId] = (0, import_react15.useState)();
|
|
2311
|
+
const [showCountDown, setShowCountDown] = (0, import_react15.useState)(false);
|
|
2312
|
+
const videoIds = creativeWorkData?.videoIds ?? [];
|
|
2313
|
+
const {
|
|
2314
|
+
data: videosData,
|
|
2315
|
+
isLoading: videosIsLoading,
|
|
2316
|
+
error: videosError
|
|
2317
|
+
} = (0, import_react_query3.useQuery)({
|
|
2318
|
+
queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken],
|
|
2319
|
+
queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),
|
|
2320
|
+
enabled: !!publicKey && videoIds.length > 0,
|
|
2321
|
+
refetchInterval: activePlaylist === null ? 3e4 : false,
|
|
2322
|
+
staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
|
|
2323
|
+
gcTime: queryOptions.cacheTime ?? 10 * 60 * 1e3,
|
|
2324
|
+
retry: queryOptions.retry ?? 3,
|
|
2325
|
+
retryDelay: queryOptions.retryDelay ?? ((attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4))
|
|
2326
|
+
});
|
|
2327
|
+
const [loadingApisState, setLoadingApisState] = (0, import_react15.useState)(true);
|
|
2328
|
+
(0, import_react15.useEffect)(() => {
|
|
2329
|
+
if (videosData !== void 0) {
|
|
2330
|
+
setLoadingApisState(false);
|
|
2331
|
+
const videosWithPlaylists = videosData.filter(
|
|
2332
|
+
(video) => video.playlists && video.playlists.length > 0
|
|
2333
|
+
);
|
|
2334
|
+
if (videosWithPlaylists.length > 0) {
|
|
2335
|
+
let hlsPlaylistFound = false;
|
|
2336
|
+
for (const video of videosWithPlaylists) {
|
|
2337
|
+
const hlsPlaylist = findHLSPlaylist(video);
|
|
2338
|
+
if (hlsPlaylist?.url) {
|
|
2339
|
+
setActivePlaylist(hlsPlaylist.url);
|
|
2340
|
+
setActiveVideoId(video.id);
|
|
2341
|
+
hlsPlaylistFound = true;
|
|
2342
|
+
break;
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
if (!hlsPlaylistFound) {
|
|
2346
|
+
setActivePlaylist(null);
|
|
2347
|
+
setActiveVideoId(null);
|
|
2348
|
+
}
|
|
2349
|
+
} else {
|
|
2350
|
+
setActivePlaylist(null);
|
|
2351
|
+
setActiveVideoId(null);
|
|
2352
|
+
}
|
|
2353
|
+
} else if (creativeWorkData && (!creativeWorkData.videoIds || creativeWorkData.videoIds.length === 0)) {
|
|
2354
|
+
setLoadingApisState(false);
|
|
2355
|
+
setActivePlaylist(null);
|
|
2356
|
+
setActiveVideoId(null);
|
|
2357
|
+
}
|
|
2358
|
+
}, [videosData, creativeWorkData]);
|
|
2359
|
+
const { t } = useMessages_default(locale);
|
|
2360
|
+
(0, import_react15.useEffect)(() => {
|
|
2361
|
+
if (events?.onCreativeWorkData && creativeWorkData) {
|
|
2362
|
+
events.onCreativeWorkData(creativeWorkData);
|
|
2363
|
+
}
|
|
2364
|
+
if (creativeWorkData && !creativeWorkData?.videoIds?.length) {
|
|
2365
|
+
setShowCountDown(true);
|
|
2366
|
+
}
|
|
2367
|
+
}, [creativeWorkData, events]);
|
|
2368
|
+
(0, import_react15.useEffect)(() => {
|
|
2369
|
+
if (events?.onVideoData && activeVideoId && videosData) {
|
|
2370
|
+
const activeVideo = videosData.find((video) => video.id === activeVideoId);
|
|
2371
|
+
if (activeVideo) {
|
|
2372
|
+
events.onVideoData(activeVideo);
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
}, [activeVideoId, videosData, events]);
|
|
2376
|
+
const [error, setError] = (0, import_react15.useState)(null);
|
|
2377
|
+
const videosDataError = videosData?.some((video) => !!video.error);
|
|
2378
|
+
(0, import_react15.useEffect)(() => {
|
|
2379
|
+
if (creativeWorkError || videosError || videosDataError) {
|
|
2380
|
+
const errorObj = creativeWorkError || videosError || videosData?.find((video) => !!video.error)?.error && new Error(videosData?.find((video) => !!video.error)?.error) || new Error("default");
|
|
2381
|
+
setError(errorObj);
|
|
2382
|
+
if (events?.onError) {
|
|
2383
|
+
events.onError(errorObj);
|
|
2384
|
+
}
|
|
2385
|
+
} else {
|
|
2386
|
+
setError(null);
|
|
2387
|
+
}
|
|
2388
|
+
}, [creativeWorkError, videosError, videosDataError, videosData, events]);
|
|
2389
|
+
if (error) {
|
|
2390
|
+
const title = t(error.message)?.length ? t(error.message) : t("DEFAULT_ERROR");
|
|
2391
|
+
const description = t(`${error.message}_DESCRIPTION`)?.length ? t(`${error.message}_DESCRIPTION`) : t("DEFAULT_ERROR_DESCRIPTION");
|
|
2392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2393
|
+
ErrorScreen,
|
|
2394
|
+
{
|
|
2395
|
+
title,
|
|
2396
|
+
description
|
|
2397
|
+
}
|
|
2398
|
+
) }) });
|
|
2399
|
+
}
|
|
2400
|
+
const [loadingPlaylist, setLoadingPlaylist] = (0, import_react15.useState)(true);
|
|
2401
|
+
(0, import_react15.useEffect)(() => {
|
|
2402
|
+
const creativeWorkLoadedWithNoVideos = !isCreativeWorkLoading && creativeWorkData && creativeWorkData.videoIds && creativeWorkData.videoIds.length === 0;
|
|
2403
|
+
const creativeWorkLoadedWithNoData = !isCreativeWorkLoading && creativeWorkData && !creativeWorkData.videoIds;
|
|
2404
|
+
const isEventsFinished = !videosIsLoading && videosData && videosData.length > 0 && videosData.every((video) => video.playlists && video.playlists.length === 0);
|
|
2405
|
+
if (creativeWorkLoadedWithNoVideos || creativeWorkLoadedWithNoData || isEventsFinished) {
|
|
2406
|
+
setLoadingPlaylist(false);
|
|
2407
|
+
if (events?.onEmptyPlaylists) {
|
|
2408
|
+
events.onEmptyPlaylists();
|
|
2409
|
+
}
|
|
2410
|
+
} else if (activePlaylist) {
|
|
2411
|
+
setLoadingPlaylist(false);
|
|
2412
|
+
}
|
|
2413
|
+
}, [
|
|
2414
|
+
isCreativeWorkLoading,
|
|
2415
|
+
creativeWorkData,
|
|
2416
|
+
videosIsLoading,
|
|
2417
|
+
videosData,
|
|
2418
|
+
activePlaylist,
|
|
2419
|
+
events
|
|
2420
|
+
]);
|
|
2421
|
+
if (isCreativeWorkLoading || videosIsLoading || loadingApisState) {
|
|
2422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Loading, {}) }) });
|
|
2423
|
+
}
|
|
2424
|
+
if (showCountDown && creativeWorkData) {
|
|
2425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2426
|
+
PreCreativeWork,
|
|
2427
|
+
{
|
|
2428
|
+
creativeWork: creativeWorkData,
|
|
2429
|
+
locale,
|
|
2430
|
+
hideTitle,
|
|
2431
|
+
backgroundImageUrl: settings?.backgroundImageUrl,
|
|
2432
|
+
showAnimation: settings?.showCountdownAnimation
|
|
2433
|
+
}
|
|
2434
|
+
) }) });
|
|
2435
|
+
}
|
|
2436
|
+
if (activeVideoId && activePlaylist && !loadingPlaylist) {
|
|
2437
|
+
const activeVideo = videosData?.find((video) => video.id === activeVideoId);
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_tailwind_merge5.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative w-full h-full", children: [
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2440
|
+
Player,
|
|
2441
|
+
{
|
|
2442
|
+
...props,
|
|
2443
|
+
className: (0, import_tailwind_merge5.twMerge)(className, "peer"),
|
|
2444
|
+
events: {
|
|
2445
|
+
...events
|
|
2446
|
+
},
|
|
2447
|
+
src: activePlaylist,
|
|
2448
|
+
containerClassName: "w-full h-full"
|
|
2449
|
+
}
|
|
2450
|
+
),
|
|
2451
|
+
!hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2452
|
+
TitleAndDescription2,
|
|
2453
|
+
{
|
|
2454
|
+
title: creativeWorkData?.title || "",
|
|
2455
|
+
description: creativeWorkData?.description || "",
|
|
2456
|
+
releaseTime: creativeWorkData?.releaseTime || "",
|
|
2457
|
+
locale,
|
|
2458
|
+
className: "mt-3 mb-6 m-event-details-ctn px-4"
|
|
2459
|
+
}
|
|
2460
|
+
)
|
|
2461
|
+
] }) });
|
|
2462
|
+
}
|
|
2463
|
+
if (loadingPlaylist) {
|
|
2464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Loading, {});
|
|
2465
|
+
}
|
|
2466
|
+
return null;
|
|
2467
|
+
};
|
|
2468
|
+
function PreCreativeWork({
|
|
2469
|
+
creativeWork,
|
|
2470
|
+
locale = "en",
|
|
2471
|
+
hideTitle,
|
|
2472
|
+
backgroundImageUrl,
|
|
2473
|
+
showAnimation = true
|
|
2474
|
+
}) {
|
|
2475
|
+
const date = new Date(creativeWork.releaseTime);
|
|
2476
|
+
const now = /* @__PURE__ */ new Date();
|
|
2477
|
+
const [remainingTime, setRemainingTime] = (0, import_react15.useState)(
|
|
2478
|
+
date.getTime() - now.getTime()
|
|
2479
|
+
);
|
|
2480
|
+
const shouldBeStarted = remainingTime < 0;
|
|
2481
|
+
const { t } = useMessages_default(locale);
|
|
2482
|
+
(0, import_react15.useEffect)(() => {
|
|
2483
|
+
const interval = setInterval(() => {
|
|
2484
|
+
if (remainingTime < 0) {
|
|
2485
|
+
clearInterval(interval);
|
|
2486
|
+
} else {
|
|
2487
|
+
setRemainingTime(date.getTime() - (/* @__PURE__ */ new Date()).getTime());
|
|
2488
|
+
}
|
|
2489
|
+
}, 1e3);
|
|
2490
|
+
return () => {
|
|
2491
|
+
clearInterval(interval);
|
|
2492
|
+
};
|
|
2493
|
+
}, [date, remainingTime]);
|
|
2494
|
+
const renderCountdown = () => {
|
|
2495
|
+
if (shouldBeStarted) {
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
|
|
2497
|
+
}
|
|
2498
|
+
const seconds = Math.floor(remainingTime / 1e3) % 60;
|
|
2499
|
+
const minutes = Math.floor(remainingTime / 1e3 / 60) % 60;
|
|
2500
|
+
const hours = Math.floor(remainingTime / 1e3 / 60 / 60) % 24;
|
|
2501
|
+
const days = Math.floor(remainingTime / 1e3 / 60 / 60 / 24);
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-flow-col gap-5 text-center auto-cols-max", children: [
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2505
|
+
"span",
|
|
2506
|
+
{
|
|
2507
|
+
style: { "--value": days },
|
|
2508
|
+
"aria-live": "polite",
|
|
2509
|
+
"aria-label": days.toString(),
|
|
2510
|
+
children: days?.toString()?.padStart(2, "0")
|
|
2511
|
+
}
|
|
2512
|
+
) }),
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("DAYS") })
|
|
2514
|
+
] }),
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2517
|
+
"span",
|
|
2518
|
+
{
|
|
2519
|
+
style: { "--value": hours },
|
|
2520
|
+
"aria-live": "polite",
|
|
2521
|
+
"aria-label": hours.toString(),
|
|
2522
|
+
children: hours?.toString()?.padStart(2, "0")
|
|
2523
|
+
}
|
|
2524
|
+
) }),
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("HOURS") })
|
|
2526
|
+
] }),
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2529
|
+
"span",
|
|
2530
|
+
{
|
|
2531
|
+
style: { "--value": minutes },
|
|
2532
|
+
"aria-live": "polite",
|
|
2533
|
+
"aria-label": minutes.toString(),
|
|
2534
|
+
children: minutes?.toString()?.padStart(2, "0")
|
|
2535
|
+
}
|
|
2536
|
+
) }),
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("MINUTES") })
|
|
2538
|
+
] }),
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-2 bg-neutral rounded-box text-neutral-content", children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "countdown font-mono text-5xl", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2541
|
+
"span",
|
|
2542
|
+
{
|
|
2543
|
+
style: { "--value": seconds },
|
|
2544
|
+
"aria-live": "polite",
|
|
2545
|
+
"aria-label": seconds.toString(),
|
|
2546
|
+
children: seconds?.toString()?.padStart(2, "0")
|
|
2547
|
+
}
|
|
2548
|
+
) }),
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm uppercase tracking-widest mt-1", children: t("SECONDS") })
|
|
2550
|
+
] })
|
|
2551
|
+
] });
|
|
2552
|
+
};
|
|
2553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2555
|
+
"div",
|
|
2556
|
+
{
|
|
2557
|
+
className: "relative overflow-hidden md:rounded-2xl bg-base-200 aspect-video text-base-content flex flex-col justify-center items-center w-full h-full bg-cover bg-center bg-no-repeat",
|
|
2558
|
+
style: {
|
|
2559
|
+
backgroundImage: backgroundImageUrl ? `url(${backgroundImageUrl})` : ""
|
|
2560
|
+
},
|
|
2561
|
+
children: [
|
|
2562
|
+
backgroundImageUrl && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute inset-0 bg-black bg-opacity-40" }),
|
|
2563
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative z-10", children: renderCountdown() })
|
|
2564
|
+
]
|
|
2565
|
+
}
|
|
2566
|
+
),
|
|
2567
|
+
!hideTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2568
|
+
TitleAndDescription2,
|
|
2569
|
+
{
|
|
2570
|
+
title: creativeWork.title,
|
|
2571
|
+
description: creativeWork.description || "",
|
|
2572
|
+
releaseTime: creativeWork.releaseTime,
|
|
2573
|
+
locale
|
|
2574
|
+
}
|
|
2575
|
+
)
|
|
2576
|
+
] });
|
|
2577
|
+
}
|
|
2578
|
+
var TitleAndDescription2 = ({
|
|
2579
|
+
title,
|
|
2580
|
+
description,
|
|
2581
|
+
releaseTime,
|
|
2582
|
+
locale = "en",
|
|
2583
|
+
className
|
|
2584
|
+
}) => {
|
|
2585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_tailwind_merge5.twMerge)("mt-3 mb-6 m-event-details-ctn px-4 text-left w-full", className), children: [
|
|
2586
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-base md:text-xl m-event-title text-base-content font-medium", children: title }),
|
|
2587
|
+
releaseTime ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "text-sm md:text-base text-base-content/70 m-event-start-time", children: [
|
|
2588
|
+
new Date(releaseTime || "").toLocaleDateString(locale || "default", {
|
|
2589
|
+
month: "long",
|
|
2590
|
+
year: "numeric",
|
|
2591
|
+
day: "numeric"
|
|
2592
|
+
}),
|
|
2593
|
+
" ",
|
|
2594
|
+
"- ",
|
|
2595
|
+
new Date(releaseTime || "").toLocaleTimeString(locale || "default", {
|
|
2596
|
+
hour: "2-digit",
|
|
2597
|
+
minute: "2-digit"
|
|
2598
|
+
})
|
|
2599
|
+
] }) : null,
|
|
2600
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-xs md:text-sm text-base-content/60 uppercase", children: description })
|
|
2601
|
+
] });
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
// src/QueryProvider.tsx
|
|
2605
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
2606
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2607
|
+
var queryClient = new import_react_query4.QueryClient({
|
|
2608
|
+
defaultOptions: {
|
|
2609
|
+
queries: {
|
|
2610
|
+
staleTime: 5 * 60 * 1e3,
|
|
2611
|
+
// 5 minutes
|
|
2612
|
+
gcTime: 10 * 60 * 1e3,
|
|
2613
|
+
// 10 minutes
|
|
2614
|
+
retry: 3,
|
|
2615
|
+
refetchOnWindowFocus: false
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
var QueryProvider = ({ children }) => {
|
|
2620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_query4.QueryClientProvider, { client: queryClient, children });
|
|
2621
|
+
};
|
|
2622
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2623
|
+
0 && (module.exports = {
|
|
2624
|
+
CreativeWork,
|
|
2625
|
+
Event,
|
|
2626
|
+
Player,
|
|
2627
|
+
QueryProvider,
|
|
2628
|
+
Video,
|
|
2629
|
+
queryClient
|
|
2630
|
+
});
|
|
2631
|
+
//# sourceMappingURL=index.js.map
|