@zezosoft/react-player 0.0.3 → 0.0.5
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 +124 -23
- package/dist/VideoPlayer/VideoPlayer.d.ts +23 -2
- package/dist/VideoPlayer/_components/ControlsHeader.d.ts +1 -0
- package/dist/components/ui/FullScreenToggle.d.ts +9 -0
- package/dist/components/ui/PiPictureInPictureToggle.d.ts +8 -0
- package/dist/components/ui/Popover.d.ts +4 -2
- package/dist/components/ui/VideoActionButton.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +1 -0
- package/dist/index.js +505 -126
- package/dist/store/VideoState.d.ts +53 -4
- package/package.json +11 -8
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { create } from 'zustand';
|
|
4
|
-
import {
|
|
4
|
+
import { FaCheck, FaGooglePlay } from 'react-icons/fa';
|
|
5
|
+
import { IoVolumeMuteOutline, IoVolumeHighOutline } from 'react-icons/io5';
|
|
6
|
+
import { Settings, Loader } from 'lucide-react';
|
|
7
|
+
import { IoMdClose } from 'react-icons/io';
|
|
5
8
|
import Hls from 'hls.js';
|
|
6
9
|
|
|
7
10
|
function styleInject(css, ref) {
|
|
@@ -31,30 +34,55 @@ function styleInject(css, ref) {
|
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
var css_248z$1 = "/*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-gray-200: oklch(0.928 0.006 264.531);\n --color-gray-900: oklch(0.21 0.034 264.665);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\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 --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\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-font-feature-settings: var(--font-sans--font-feature-settings);\n --default-font-variation-settings: var(\n --font-sans--font-variation-settings\n );\n --default-mono-font-family: var(--font-mono);\n --default-mono-font-feature-settings: var(\n --font-mono--font-feature-settings\n );\n --default-mono-font-variation-settings: var(\n --font-mono--font-variation-settings\n );\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :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 body {\n line-height: inherit;\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, h2, h3, h4, h5, 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, strong {\n font-weight: bolder;\n }\n code, kbd, samp, 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, 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, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::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 color: color-mix(in oklab, currentColor 50%, transparent);\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, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-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 .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-full {\n top: 100%;\n }\n .right-full {\n right: 100%;\n }\n .bottom-full {\n bottom: 100%;\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-full {\n left: 100%;\n }\n .z-50 {\n z-index: 50;\n }\n .mx-1 {\n margin-inline: calc(var(--spacing) * 1);\n }\n .mx-auto {\n margin-inline: auto;\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mr-2 {\n margin-right: calc(var(--spacing) * 2);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .ml-2 {\n margin-left: calc(var(--spacing) * 2);\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .inline-block {\n display: inline-block;\n }\n .size-10 {\n width: calc(var(--spacing) * 10);\n height: calc(var(--spacing) * 10);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-full {\n height: 100%;\n }\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n .w-\\[2px\\] {\n width: 2px;\n }\n .w-\\[10vw\\] {\n width: 10vw;\n }\n .w-\\[15vw\\] {\n width: 15vw;\n }\n .w-\\[720px\\] {\n width: 720px;\n }\n .w-fit {\n width: fit-content;\n }\n .w-full {\n width: 100%;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .transform {\n transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y);\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-7 {\n gap: calc(var(--spacing) * 7);\n }\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .bg-\\[rgba\\(0\\,0\\,0\\,0\\.5\\)\\] {\n background-color: rgba(0,0,0,0.5);\n }\n .bg-gray-900 {\n background-color: var(--color-gray-900);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-gradient-to-b {\n --tw-gradient-position: to bottom in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black {\n --tw-gradient-from: var(--color-black);\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 .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-10 {\n padding: calc(var(--spacing) * 10);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-10 {\n padding-inline: calc(var(--spacing) * 10);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .pt-6 {\n padding-top: calc(var(--spacing) * 6);\n }\n .pb-10 {\n padding-bottom: calc(var(--spacing) * 10);\n }\n .pb-16 {\n padding-bottom: calc(var(--spacing) * 16);\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-black {\n color: var(--color-black);\n }\n .text-white {\n color: var(--color-white);\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: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .transition-opacity {\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 }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .lg\\:size-12 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 12);\n height: calc(var(--spacing) * 12);\n }\n }\n .lg\\:size-15 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 15);\n height: calc(var(--spacing) * 15);\n }\n }\n .lg\\:h-8 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 8);\n }\n }\n .lg\\:w-8 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 8);\n }\n }\n .lg\\:pb-10 {\n @media (width >= 64rem) {\n padding-bottom: calc(var(--spacing) * 10);\n }\n }\n .lg\\:text-2xl {\n @media (width >= 64rem) {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n }\n .lg\\:text-lg {\n @media (width >= 64rem) {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n }\n .lg\\:text-xl {\n @media (width >= 64rem) {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n }\n}\n.noCursor {\n cursor: none !important;\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: rotateX(0);\n}\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: rotateY(0);\n}\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: rotateZ(0);\n}\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false;\n initial-value: skewX(0);\n}\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false;\n initial-value: skewY(0);\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-gradient-position {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-via {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-to {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-via-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 0%;\n}\n@property --tw-gradient-via-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 50%;\n}\n@property --tw-gradient-to-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}";
|
|
35
|
-
styleInject(css_248z$
|
|
37
|
+
var css_248z$2 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-green-100: oklch(96.2% 0.044 156.743);\n --color-green-500: oklch(72.3% 0.219 149.579);\n --color-gray-50: oklch(98.5% 0.002 247.839);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-700: oklch(37.3% 0.034 259.733);\n --color-gray-900: oklch(21% 0.034 264.665);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\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-3xl: 1.875rem;\n --text-3xl--line-height: calc(2.25 / 1.875);\n --font-weight-normal: 400;\n --font-weight-semibold: 600;\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --animate-spin: spin 1s linear infinite;\n --blur-sm: 8px;\n --blur-md: 12px;\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 *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :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, h2, h3, h4, h5, 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, strong {\n font-weight: bolder;\n }\n code, kbd, samp, 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, 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, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::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, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-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-none {\n pointer-events: none;\n }\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .-top-2 {\n top: calc(var(--spacing) * -2);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-full {\n top: 100%;\n }\n .right-32 {\n right: calc(var(--spacing) * 32);\n }\n .right-full {\n right: 100%;\n }\n .bottom-36 {\n bottom: calc(var(--spacing) * 36);\n }\n .bottom-full {\n bottom: 100%;\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-4 {\n left: calc(var(--spacing) * 4);\n }\n .left-32 {\n left: calc(var(--spacing) * 32);\n }\n .left-full {\n left: 100%;\n }\n .z-50 {\n z-index: 50;\n }\n .z-\\[-1\\] {\n z-index: -1;\n }\n .mx-2 {\n margin-inline: calc(var(--spacing) * 2);\n }\n .mx-auto {\n margin-inline: auto;\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mr-2 {\n margin-right: calc(var(--spacing) * 2);\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .ml-2 {\n margin-left: calc(var(--spacing) * 2);\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .inline {\n display: inline;\n }\n .inline-block {\n display: inline-block;\n }\n .h-3 {\n height: calc(var(--spacing) * 3);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-24 {\n height: calc(var(--spacing) * 24);\n }\n .h-full {\n height: 100%;\n }\n .w-3 {\n width: calc(var(--spacing) * 3);\n }\n .w-5 {\n width: calc(var(--spacing) * 5);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-56 {\n width: calc(var(--spacing) * 56);\n }\n .w-\\[2px\\] {\n width: 2px;\n }\n .w-\\[10vw\\] {\n width: 10vw;\n }\n .w-\\[15vw\\] {\n width: 15vw;\n }\n .w-\\[720px\\] {\n width: 720px;\n }\n .w-fit {\n width: fit-content;\n }\n .w-full {\n width: 100%;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .rotate-45 {\n rotate: 45deg;\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .cursor-not-allowed {\n cursor: not-allowed;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .flex-col {\n flex-direction: column;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n .gap-7 {\n gap: calc(var(--spacing) * 7);\n }\n .rounded-lg {\n border-radius: var(--radius-lg);\n }\n .rounded-md {\n border-radius: var(--radius-md);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n .border-l {\n border-left-style: var(--tw-border-style);\n border-left-width: 1px;\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .bg-\\[rgba\\(0\\,0\\,0\\,0\\.5\\)\\] {\n background-color: rgba(0,0,0,0.5);\n }\n .bg-gray-500 {\n background-color: var(--color-gray-500);\n }\n .bg-gray-900 {\n background-color: var(--color-gray-900);\n }\n .bg-green-100 {\n background-color: var(--color-green-100);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-white\\/80 {\n background-color: color-mix(in srgb, #fff 80%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 80%, transparent);\n }\n }\n .bg-white\\/90 {\n background-color: color-mix(in srgb, #fff 90%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 90%, transparent);\n }\n }\n .bg-gradient-to-b {\n --tw-gradient-position: to bottom in oklab;\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-black {\n --tw-gradient-from: var(--color-black);\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 .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-10 {\n padding: calc(var(--spacing) * 10);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .px-10 {\n padding-inline: calc(var(--spacing) * 10);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .pt-6 {\n padding-top: calc(var(--spacing) * 6);\n }\n .pb-10 {\n padding-bottom: calc(var(--spacing) * 10);\n }\n .pb-16 {\n padding-bottom: calc(var(--spacing) * 16);\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 .font-normal {\n --tw-font-weight: var(--font-weight-normal);\n font-weight: var(--font-weight-normal);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-black {\n color: var(--color-black);\n }\n .text-gray-200 {\n color: var(--color-gray-200);\n }\n .text-gray-300 {\n color: var(--color-gray-300);\n }\n .text-gray-400 {\n color: var(--color-gray-400);\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-gray-700 {\n color: var(--color-gray-700);\n }\n .text-gray-900 {\n color: var(--color-gray-900);\n }\n .text-green-500 {\n color: var(--color-green-500);\n }\n .text-white {\n color: var(--color-white);\n }\n .opacity-50 {\n opacity: 50%;\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: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .backdrop-blur-md {\n --tw-backdrop-blur: blur(var(--blur-md));\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .backdrop-blur-sm {\n --tw-backdrop-blur: blur(var(--blur-sm));\n -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-all {\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 }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\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 }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .hover\\:bg-gray-200 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-200);\n }\n }\n }\n .hover\\:bg-gray-300 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-300);\n }\n }\n }\n .hover\\:bg-white\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(in srgb, #fff 90%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 90%, transparent);\n }\n }\n }\n }\n .hover\\:text-gray-200 {\n &:hover {\n @media (hover: hover) {\n color: var(--color-gray-200);\n }\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:ring-gray-400 {\n &:focus {\n --tw-ring-color: var(--color-gray-400);\n }\n }\n .focus\\:ring-offset-1 {\n &:focus {\n --tw-ring-offset-width: 1px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:bg-white\\/50 {\n &:disabled {\n background-color: color-mix(in srgb, #fff 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-white) 50%, transparent);\n }\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .lg\\:h-32 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 32);\n }\n }\n .lg\\:w-32 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 32);\n }\n }\n .lg\\:pb-12 {\n @media (width >= 64rem) {\n padding-bottom: calc(var(--spacing) * 12);\n }\n }\n .lg\\:text-2xl {\n @media (width >= 64rem) {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n }\n }\n .lg\\:text-3xl {\n @media (width >= 64rem) {\n font-size: var(--text-3xl);\n line-height: var(--tw-leading, var(--text-3xl--line-height));\n }\n }\n .lg\\:text-base {\n @media (width >= 64rem) {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n }\n .\\[\\&\\:\\:cue\\]\\:absolute {\n &::cue {\n position: absolute;\n }\n }\n .\\[\\&\\:\\:cue\\]\\:top-\\[6\\%\\] {\n &::cue {\n top: 6%;\n }\n }\n .\\[\\&\\:\\:cue\\]\\:rounded-md {\n &::cue {\n border-radius: var(--radius-md);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:bg-gray-50 {\n &::cue {\n background-color: var(--color-gray-50);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:px-2 {\n &::cue {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:py-1 {\n &::cue {\n padding-block: calc(var(--spacing) * 1);\n }\n }\n .\\[\\&\\:\\:cue\\]\\:text-xl {\n &::cue {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n }\n .\\[\\&\\:\\:cue\\]\\:text-\\[\\#1E1E1E\\] {\n &::cue {\n color: #1E1E1E;\n }\n }\n}\n.noCursor {\n cursor: none !important;\n}\n.icon-class {\n height: calc(var(--spacing) * 14);\n width: calc(var(--spacing) * 14);\n cursor: pointer;\n color: var(--color-gray-400);\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\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 color: var(--color-gray-200);\n }\n }\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 18);\n }\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 18);\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-rotate-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-rotate-z {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-x {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-skew-y {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-gradient-position {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-via {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-to {\n syntax: \"<color>\";\n inherits: false;\n initial-value: #0000;\n}\n@property --tw-gradient-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-via-stops {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-gradient-from-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 0%;\n}\n@property --tw-gradient-via-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 50%;\n}\n@property --tw-gradient-to-position {\n syntax: \"<length-percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-backdrop-blur {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-brightness {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-contrast {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-grayscale {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-hue-rotate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-invert {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-opacity {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-saturate {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-backdrop-sepia {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\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 *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\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-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-backdrop-blur: initial;\n --tw-backdrop-brightness: initial;\n --tw-backdrop-contrast: initial;\n --tw-backdrop-grayscale: initial;\n --tw-backdrop-hue-rotate: initial;\n --tw-backdrop-invert: initial;\n --tw-backdrop-opacity: initial;\n --tw-backdrop-saturate: initial;\n --tw-backdrop-sepia: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}\n";
|
|
38
|
+
styleInject(css_248z$2,{"insertAt":"top"});
|
|
36
39
|
|
|
37
40
|
const useVideoStore = create((set) => ({
|
|
38
41
|
videoRef: null,
|
|
39
42
|
setVideoRef: (ref) => set({ videoRef: ref }),
|
|
40
43
|
videoWrapperRef: null,
|
|
41
44
|
setVideoWrapperRef: (ref) => set({ videoWrapperRef: ref }),
|
|
45
|
+
playing: false,
|
|
46
|
+
setPlaying: (playing) => set({ playing }),
|
|
47
|
+
isBuffering: false,
|
|
48
|
+
setIsBuffering: (isBuffering) => set({ isBuffering }),
|
|
42
49
|
isPlaying: false,
|
|
43
50
|
setIsPlaying: (isPlaying) => set({ isPlaying }),
|
|
51
|
+
muted: false,
|
|
52
|
+
setMuted: (muted) => set({ muted }),
|
|
53
|
+
volume: 1,
|
|
54
|
+
setVolume: (volume) => set({ volume }),
|
|
44
55
|
controls: false,
|
|
45
56
|
setControls: (controls) => set({ controls }),
|
|
46
57
|
currentTime: 0,
|
|
47
58
|
setCurrentTime: (currentTime) => set({ currentTime }),
|
|
59
|
+
duration: 0,
|
|
60
|
+
setDuration: (duration) => set({ duration }),
|
|
61
|
+
isFullscreen: false,
|
|
62
|
+
setIsFullscreen: (isFullscreen) => set({ isFullscreen }),
|
|
48
63
|
hlsInstance: undefined,
|
|
49
64
|
setHlsInstance: (hlsInstance) => set({ hlsInstance }),
|
|
50
65
|
qualityLevels: undefined,
|
|
51
66
|
setQualityLevels: (qualityLevels) => set({ qualityLevels }),
|
|
52
67
|
activeQuality: "auto",
|
|
53
68
|
setActiveQuality: (activeQuality) => set({ activeQuality }),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
activeSubtitle: null,
|
|
70
|
+
setActiveSubtitle: (subtitle) => set({ activeSubtitle: subtitle }),
|
|
71
|
+
subtitles: [],
|
|
72
|
+
setSubtitles: (subtitles) => set({ subtitles }),
|
|
73
|
+
showIntroSkip: false,
|
|
74
|
+
setShowIntroSkip: (show) => set({ showIntroSkip: show }),
|
|
75
|
+
autoPlayNext: false,
|
|
76
|
+
setAutoPlayNext: (value) => set({ autoPlayNext: value }),
|
|
77
|
+
// Next Episode
|
|
78
|
+
episodeList: [],
|
|
79
|
+
setEpisodeList: (list) => set({ episodeList: list }),
|
|
80
|
+
currentEpisodeIndex: 0,
|
|
81
|
+
setCurrentEpisodeIndex: (index) => set({ currentEpisodeIndex: index }),
|
|
82
|
+
showCountdown: false,
|
|
83
|
+
setShowCountdown: (show) => set({ showCountdown: show }),
|
|
84
|
+
countdownTime: 10,
|
|
85
|
+
setCountdownTime: (time) => set({ countdownTime: time }),
|
|
58
86
|
}));
|
|
59
87
|
|
|
60
88
|
/**
|
|
@@ -330,24 +358,22 @@ const VideoSeekSlider = ({ max = 1000, currentTime = 0, bufferTime = 0, hideThum
|
|
|
330
358
|
React__default.createElement(Thumb, { max: max, currentTime: currentTime, isThumbActive: isThumbActive, trackColor: trackColor })));
|
|
331
359
|
};
|
|
332
360
|
|
|
333
|
-
var css_248z = ".ui-video-seek-slider {\n
|
|
334
|
-
styleInject(css_248z,{"insertAt":"top"});
|
|
361
|
+
var css_248z$1 = ".ui-video-seek-slider {\n position: relative;\n touch-action: none;\n}\n.ui-video-seek-slider:focus {\n outline: none;\n}\n.ui-video-seek-slider .track {\n padding: 0;\n cursor: pointer;\n outline: none;\n}\n.ui-video-seek-slider .track:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main {\n width: 100%;\n outline: none;\n height: 18px;\n top: 0;\n position: absolute;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n}\n.ui-video-seek-slider .track .main:before {\n content: \"\";\n position: absolute;\n width: 100%;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.2);\n overflow: hidden;\n transition: height 0.1s;\n outline: none;\n}\n.ui-video-seek-slider .track .main .inner-seek-block {\n position: absolute;\n width: 100%;\n height: 3px;\n transition: height 0.1s, opacity 0.4s;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main:focus {\n border: 0;\n outline: none;\n}\n.ui-video-seek-slider .track .main .buffered {\n background-color: rgba(255, 255, 255, 0.3);\n z-index: 2;\n}\n.ui-video-seek-slider .track .main .seek-hover {\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 1;\n}\n.ui-video-seek-slider .track .main .connect {\n background-color: #ff0000;\n z-index: 3;\n transform-origin: 0 0;\n}\n.ui-video-seek-slider .track .main.with-gap .inner-seek-block,\n.ui-video-seek-slider .track .main.with-gap:before {\n width: calc(100% - 2px);\n margin: 0 auto;\n}\n@media (hover) {\n .ui-video-seek-slider .track .main:hover:before {\n height: 8px;\n }\n .ui-video-seek-slider .track .main:hover .inner-seek-block {\n height: 8px;\n }\n}\n.ui-video-seek-slider .thumb {\n pointer-events: none;\n position: absolute;\n width: 12px;\n height: 12px;\n left: -6px;\n z-index: 4;\n top: 3px;\n}\n.ui-video-seek-slider .thumb .handler {\n border-radius: 100%;\n width: 100%;\n height: 100%;\n background-color: #ff0000;\n opacity: 0;\n transform: scale(0.4);\n transition: transform 0.2s, opacity 0.2s;\n}\n.ui-video-seek-slider .thumb.active .handler {\n opacity: 1;\n transform: scale(1);\n}\n.ui-video-seek-slider .hover-time {\n text-shadow: 1px 1px 1px #000;\n position: absolute;\n line-height: 18px;\n font-size: 16px;\n color: #ddd;\n bottom: 5px;\n left: 0;\n padding: 5px 10px;\n opacity: 0;\n pointer-events: none;\n text-align: center;\n}\n.ui-video-seek-slider .hover-time.active {\n opacity: 1;\n}\n.ui-video-seek-slider .hover-time .preview-screen {\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n width: 200px;\n height: 110px;\n border-radius: 5px;\n background-color: #000;\n margin: 0 auto 10px;\n}\n.ui-video-seek-slider:hover .track .main .seek-hover {\n opacity: 1;\n}\n";
|
|
362
|
+
styleInject(css_248z$1,{"insertAt":"top"});
|
|
335
363
|
|
|
336
364
|
const BottomControls = ({ config }) => {
|
|
337
365
|
const { videoRef, currentTime, isFullscreen } = useVideoStore();
|
|
338
366
|
const duration = videoRef?.duration;
|
|
339
|
-
return (React__default.createElement("div", { className: "px-10
|
|
367
|
+
return (React__default.createElement("div", { className: "px-10" },
|
|
340
368
|
React__default.createElement(VideoSeekSlider, { max: secondsToMilliseconds(duration || 0), currentTime: secondsToMilliseconds(currentTime || 0), bufferTime: secondsToMilliseconds(0), onChange: (currentTime) => {
|
|
341
369
|
if (videoRef) {
|
|
342
370
|
videoRef.currentTime = currentTime / 1000;
|
|
343
371
|
}
|
|
344
372
|
}, secondsPrefix: "00:00:", minutesPrefix: "00:", getPreviewScreenUrl: config?.seekBarConfig?.getPreviewScreenUrl, timeCodes: config?.seekBarConfig?.timeCodes, trackColor: config?.seekBarConfig?.trackColor }),
|
|
345
|
-
React__default.createElement("div", { className: `pt-6 ${isFullscreen ? "pb-10" : "pb-16"} lg:pb-
|
|
346
|
-
React__default.createElement("
|
|
347
|
-
" ",
|
|
348
|
-
React__default.createElement("
|
|
349
|
-
" ",
|
|
350
|
-
React__default.createElement("p", { className: "lg:text-xl font-semibold" }, timeFormat(duration || 0)))));
|
|
373
|
+
React__default.createElement("div", { className: `pt-6 ${isFullscreen ? "pb-10" : "pb-16"} lg:pb-12 flex items-center gap-4 text-white` },
|
|
374
|
+
React__default.createElement("span", { className: "text-lg lg:text-2xl font-semibold text-white cursor-pointer hover:text-gray-200 transition-colors duration-200" }, timeFormat(currentTime || 0)),
|
|
375
|
+
React__default.createElement("span", { className: "text-lg lg:text-3xl font-semibold text-gray-500 cursor-pointer hover:text-gray-200 transition-colors duration-200" }, "/"),
|
|
376
|
+
React__default.createElement("span", { className: "text-lg lg:text-2xl font-semibold text-gray-400 cursor-pointer hover:text-gray-200 transition-colors duration-200" }, timeFormat(duration || 0)))));
|
|
351
377
|
};
|
|
352
378
|
|
|
353
379
|
const Tooltip = ({ children, title, position = "top", }) => {
|
|
@@ -363,29 +389,67 @@ const Tooltip = ({ children, title, position = "top", }) => {
|
|
|
363
389
|
visible && (React__default.createElement("div", { className: `absolute z-50 px-3 py-1 text-sm text-white bg-gray-900 rounded-md shadow-md transition-opacity duration-200 ease-in-out ${positionStyles[position]}` }, title))));
|
|
364
390
|
};
|
|
365
391
|
|
|
366
|
-
const Popover = ({ button, children, }) => {
|
|
392
|
+
const Popover = ({ button, children, closeOnButtonClick = false, }) => {
|
|
367
393
|
const [isOpen, setIsOpen] = useState(false);
|
|
368
394
|
const popoverRef = useRef(null);
|
|
369
|
-
|
|
395
|
+
const buttonRef = useRef(null);
|
|
396
|
+
// Close on outside click or Escape key
|
|
370
397
|
useEffect(() => {
|
|
371
398
|
const handleClickOutside = (event) => {
|
|
372
399
|
if (popoverRef.current &&
|
|
373
|
-
!popoverRef.current.contains(event.target)
|
|
400
|
+
!popoverRef.current.contains(event.target) &&
|
|
401
|
+
buttonRef.current &&
|
|
402
|
+
!buttonRef.current.contains(event.target)) {
|
|
403
|
+
setIsOpen(false);
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
const handleEscape = (event) => {
|
|
407
|
+
if (event.key === "Escape") {
|
|
374
408
|
setIsOpen(false);
|
|
375
409
|
}
|
|
376
410
|
};
|
|
377
411
|
document.addEventListener("mousedown", handleClickOutside);
|
|
378
|
-
|
|
412
|
+
document.addEventListener("keydown", handleEscape);
|
|
413
|
+
return () => {
|
|
414
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
415
|
+
document.removeEventListener("keydown", handleEscape);
|
|
416
|
+
};
|
|
379
417
|
}, []);
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
418
|
+
const togglePopover = () => {
|
|
419
|
+
setIsOpen((prev) => (closeOnButtonClick ? !prev : true));
|
|
420
|
+
};
|
|
421
|
+
return (React__default.createElement("div", { className: "relative inline-block" },
|
|
422
|
+
React__default.createElement("div", { ref: buttonRef, onClick: togglePopover, tabIndex: 0, role: "button" }, button),
|
|
423
|
+
isOpen && (React__default.createElement("div", { ref: popoverRef, className: "absolute left-0 mt-2 w-fit bg-white shadow-lg rounded-lg border border-gray-200 z-50 p-4 transition-all duration-200" },
|
|
424
|
+
React__default.createElement("div", { className: "absolute -top-2 left-4 w-3 h-3 bg-white transform rotate-45 border-l border-t border-gray-200 z-[-1]" }),
|
|
425
|
+
children))));
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
var css_248z = ".icon-button {\n width: 20px;\n height: 20px;\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.icon-button:hover {\n color: #e5e7eb;\n}\n\n@media (min-width: 1024px) {\n .icon-button {\n width: 32px;\n height: 32px;\n }\n}\n\n/* styles/fullscreen-toggle.css */\n.fullscreen-icon {\n width: 20px;\n height: 20px;\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.fullscreen-icon:hover {\n color: #e5e7eb;\n}\n\n@media (min-width: 1024px) {\n .fullscreen-icon {\n width: 32px;\n height: 32px;\n }\n}\n\n/* styles/pi-picture-in-picture-toggle.css */\n.pip-toggle {\n cursor: pointer;\n color: #9ca3af;\n transition: color 0.2s ease-in-out;\n}\n\n.pip-toggle:hover {\n color: #e5e7eb;\n}\n\n.pip-icon {\n width: 15px;\n height: 15px;\n}\n\n@media (min-width: 1024px) {\n .pip-icon {\n width: 28px;\n height: 28px;\n }\n}\n";
|
|
429
|
+
styleInject(css_248z,{"insertAt":"top"});
|
|
430
|
+
|
|
431
|
+
const FullScreenToggle = ({ isFullScreen, onClick, className = "fullscreen-icon", }) => {
|
|
432
|
+
return (React__default.createElement("div", { onClick: onClick }, isFullScreen ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: className },
|
|
433
|
+
React__default.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.849 4.71l4.77 4.77H5.857a1.111 1.111 0 1 0 0 2.221H10.3a1.11 1.11 0 0 0 1.111-1.11V6.145a1.111 1.111 0 0 0-2.222 0v1.762l-4.77-4.77A1.111 1.111 0 1 0 2.85 4.709zm19.349 16.206l-4.77-4.77h1.762a1.111 1.111 0 0 0 0-2.223h-4.444c-.614 0-1.111.498-1.111 1.112v4.444a1.111 1.111 0 0 0 2.222 0v-1.762l4.77 4.77a1.111 1.111 0 1 0 1.571-1.571z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25", className: className },
|
|
434
|
+
React__default.createElement("path", { fill: "currentColor", d: "M4.746 8.056V6.294L18.73 20.278h-1.762a1.111 1.111 0 1 0 0 2.222h4.444a1.11 1.11 0 0 0 1.111-1.111v-4.445a1.111 1.111 0 0 0-2.222 0v1.762L6.317 4.722h1.762a1.111 1.111 0 1 0 0-2.222H3.635c-.614 0-1.112.497-1.112 1.111v4.445a1.111 1.111 0 1 0 2.223 0z" })))));
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
const PiPictureInPictureToggle = ({ onClick, className = "", }) => {
|
|
438
|
+
return (React__default.createElement("div", { onClick: onClick, className: `pip-toggle` },
|
|
439
|
+
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", className: `pip-icon ${className}` },
|
|
440
|
+
React__default.createElement("rect", { width: "9", height: "6", x: "11", y: "11.99", fill: "#fff", rx: "1" }),
|
|
441
|
+
React__default.createElement("rect", { width: "22", height: "18", x: "1", y: "3", stroke: "#B3B3B3", strokeWidth: "2", rx: "3" }))));
|
|
383
442
|
};
|
|
384
443
|
|
|
385
444
|
const ControlsHeader = ({ config }) => {
|
|
386
|
-
const
|
|
387
|
-
const { videoWrapperRef, videoRef, qualityLevels, hlsInstance, setActiveQuality, activeQuality, } = useVideoStore();
|
|
445
|
+
const iconClassName = "icon-button";
|
|
446
|
+
const { videoWrapperRef, videoRef, qualityLevels, hlsInstance, setActiveQuality, activeQuality, subtitles, activeSubtitle, setActiveSubtitle, episodeList, currentEpisodeIndex, } = useVideoStore();
|
|
447
|
+
const [speed, setSpeed] = React.useState(1);
|
|
448
|
+
const [isPipActive, setIsPipActive] = React.useState(false);
|
|
449
|
+
const isFullscreen = document.fullscreenElement !== null;
|
|
388
450
|
const handleFullscreen = () => {
|
|
451
|
+
if (isPipActive)
|
|
452
|
+
return;
|
|
389
453
|
if (document.fullscreenElement) {
|
|
390
454
|
document.exitFullscreen();
|
|
391
455
|
}
|
|
@@ -393,65 +457,141 @@ const ControlsHeader = ({ config }) => {
|
|
|
393
457
|
videoWrapperRef?.requestFullscreen();
|
|
394
458
|
}
|
|
395
459
|
};
|
|
396
|
-
const isFullscreen = document.fullscreenElement !== null;
|
|
397
460
|
const handleMute = () => {
|
|
398
|
-
if (videoRef
|
|
399
|
-
|
|
400
|
-
videoRef.muted = false;
|
|
401
|
-
}
|
|
461
|
+
if (videoRef) {
|
|
462
|
+
videoRef.muted = !videoRef.muted;
|
|
402
463
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
464
|
+
};
|
|
465
|
+
const handleSpeedChange = (newSpeed) => {
|
|
466
|
+
setSpeed(newSpeed);
|
|
467
|
+
if (videoRef) {
|
|
468
|
+
videoRef.playbackRate = newSpeed;
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
const handlePipToggle = async () => {
|
|
472
|
+
if (videoRef) {
|
|
473
|
+
if (!document.pictureInPictureElement && !isPipActive) {
|
|
474
|
+
try {
|
|
475
|
+
await videoRef.requestPictureInPicture();
|
|
476
|
+
setIsPipActive(true);
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
console.error("PiP mode failed:", error);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else if (document.pictureInPictureElement && isPipActive) {
|
|
483
|
+
try {
|
|
484
|
+
await document.exitPictureInPicture();
|
|
485
|
+
setIsPipActive(false);
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
console.error("Exit PiP failed:", error);
|
|
489
|
+
}
|
|
406
490
|
}
|
|
407
491
|
}
|
|
408
492
|
};
|
|
493
|
+
React.useEffect(() => {
|
|
494
|
+
const handlePipChange = () => {
|
|
495
|
+
setIsPipActive(!!document.pictureInPictureElement);
|
|
496
|
+
};
|
|
497
|
+
document.addEventListener("enterpictureinpicture", handlePipChange);
|
|
498
|
+
document.addEventListener("leavepictureinpicture", handlePipChange);
|
|
499
|
+
return () => {
|
|
500
|
+
document.removeEventListener("enterpictureinpicture", handlePipChange);
|
|
501
|
+
document.removeEventListener("leavepictureinpicture", handlePipChange);
|
|
502
|
+
};
|
|
503
|
+
}, []);
|
|
504
|
+
const uniqueQualityLevels = React.useMemo(() => {
|
|
505
|
+
if (!qualityLevels)
|
|
506
|
+
return [];
|
|
507
|
+
const seenHeights = new Set();
|
|
508
|
+
return qualityLevels.filter((level) => {
|
|
509
|
+
if (seenHeights.has(level.height)) {
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
seenHeights.add(level.height);
|
|
514
|
+
return true;
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
}, [qualityLevels]);
|
|
409
518
|
return (React.createElement("div", { className: "flex items-center justify-between p-10 bg-gradient-to-b from-black" },
|
|
410
|
-
React.createElement("div",
|
|
411
|
-
|
|
412
|
-
|
|
519
|
+
React.createElement("div", { className: "flex" },
|
|
520
|
+
React.createElement("div", null,
|
|
521
|
+
React.createElement("h1", { className: "text-gray-200 text-lg lg:text-2xl font-semibold" }, episodeList.length > 0
|
|
522
|
+
? episodeList[currentEpisodeIndex]?.title
|
|
523
|
+
: config?.title),
|
|
524
|
+
config?.isTrailer && (React.createElement("p", { className: "text-gray-300 text-sm lg:text-base font-normal" }, "Trailer")))),
|
|
413
525
|
React.createElement("div", { className: "flex items-center gap-7 text-white" },
|
|
414
526
|
React.createElement("div", null,
|
|
415
527
|
React.createElement(Tooltip, { title: "Settings" },
|
|
416
|
-
React.createElement(Popover, { button: React.createElement(Settings, { className:
|
|
417
|
-
React.createElement("div", { className: "text-
|
|
528
|
+
React.createElement(Popover, { button: React.createElement(Settings, { className: iconClassName }) },
|
|
529
|
+
React.createElement("div", { className: "bg-white/90 backdrop-blur-md text-gray-900 rounded-md w-56 p-2" },
|
|
530
|
+
React.createElement("div", { className: "mb-2" },
|
|
531
|
+
React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Quality"),
|
|
532
|
+
React.createElement("div", { className: "flex flex-col gap-1" },
|
|
533
|
+
React.createElement("button", { onClick: () => {
|
|
534
|
+
if (hlsInstance) {
|
|
535
|
+
hlsInstance.currentLevel = -1;
|
|
536
|
+
setActiveQuality("auto");
|
|
537
|
+
}
|
|
538
|
+
}, className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 ${activeQuality === "auto"
|
|
539
|
+
? "bg-green-100 font-semibold"
|
|
540
|
+
: ""}` },
|
|
541
|
+
activeQuality === "auto" && (React.createElement(FaCheck, { className: "text-green-500" })),
|
|
542
|
+
"Auto"),
|
|
543
|
+
uniqueQualityLevels
|
|
544
|
+
.map((level, index) => (React.createElement("button", { key: index, onClick: () => {
|
|
545
|
+
if (hlsInstance) {
|
|
546
|
+
hlsInstance.currentLevel = index;
|
|
547
|
+
setActiveQuality(String(level.height));
|
|
548
|
+
}
|
|
549
|
+
}, className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 ${activeQuality === String(level.height)
|
|
550
|
+
? "bg-green-100 font-semibold"
|
|
551
|
+
: ""}` },
|
|
552
|
+
activeQuality === String(level.height) && (React.createElement(FaCheck, { className: "text-green-500" })),
|
|
553
|
+
level.height,
|
|
554
|
+
"p")))
|
|
555
|
+
.reverse())),
|
|
556
|
+
React.createElement("div", { className: "mb-2" },
|
|
557
|
+
React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Subtitles"),
|
|
558
|
+
React.createElement("div", { className: "flex flex-col gap-1" },
|
|
559
|
+
React.createElement("button", { onClick: () => setActiveSubtitle(null), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 ${!activeSubtitle ? "bg-green-100 font-semibold" : ""}` },
|
|
560
|
+
!activeSubtitle && (React.createElement(FaCheck, { className: "text-green-500" })),
|
|
561
|
+
"Off"),
|
|
562
|
+
subtitles?.map((subtitle, index) => (React.createElement("button", { key: index, onClick: () => setActiveSubtitle(subtitle), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 ${activeSubtitle?.label === subtitle.label
|
|
563
|
+
? "bg-green-100 font-semibold"
|
|
564
|
+
: ""}` },
|
|
565
|
+
activeSubtitle?.label === subtitle.label && (React.createElement(FaCheck, { className: "text-green-500" })),
|
|
566
|
+
subtitle.label))))),
|
|
418
567
|
React.createElement("div", null,
|
|
419
|
-
React.createElement("p", { className: "
|
|
420
|
-
React.createElement("
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
}, className: "p-2 cursor-pointer flex items-center gap-1.5" },
|
|
426
|
-
activeQuality === "auto" && React.createElement(Check, null),
|
|
427
|
-
" Auto"),
|
|
428
|
-
qualityLevels
|
|
429
|
-
?.map((level, index) => (React.createElement("p", { key: index, onClick: () => {
|
|
430
|
-
if (hlsInstance) {
|
|
431
|
-
hlsInstance.currentLevel = index;
|
|
432
|
-
setActiveQuality(String(level.height));
|
|
433
|
-
}
|
|
434
|
-
}, className: "p-2 cursor-pointer flex items-center gap-1.5" },
|
|
435
|
-
activeQuality === String(level.height) && React.createElement(Check, null),
|
|
436
|
-
" ",
|
|
437
|
-
level.height,
|
|
438
|
-
"p")))
|
|
439
|
-
.reverse()))))),
|
|
568
|
+
React.createElement("p", { className: "font-semibold mb-1 px-3 py-1 text-gray-700" }, "Speed"),
|
|
569
|
+
React.createElement("div", { className: "flex flex-col gap-1" }, [0.5, 1, 1.5, 2].map((s) => (React.createElement("button", { key: s, onClick: () => handleSpeedChange(s), className: `flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-gray-200 ${speed === s ? "bg-green-100 font-semibold" : ""}` },
|
|
570
|
+
speed === s && React.createElement(FaCheck, { className: "text-green-500" }),
|
|
571
|
+
s,
|
|
572
|
+
"x"))))))))),
|
|
440
573
|
React.createElement("div", { onClick: handleMute }, videoRef?.muted ? (React.createElement(Tooltip, { title: "Unmute" },
|
|
441
|
-
React.createElement(
|
|
442
|
-
React.createElement(
|
|
443
|
-
React.createElement(
|
|
444
|
-
|
|
445
|
-
|
|
574
|
+
React.createElement(IoVolumeMuteOutline, { className: iconClassName }))) : (React.createElement(Tooltip, { title: "Mute" },
|
|
575
|
+
React.createElement(IoVolumeHighOutline, { className: iconClassName })))),
|
|
576
|
+
React.createElement(Tooltip, { title: isPipActive
|
|
577
|
+
? "Disabled in PiP"
|
|
578
|
+
: isFullscreen
|
|
579
|
+
? "Exit"
|
|
580
|
+
: "Fullscreen", className: `${iconClassName} ${isPipActive ? "opacity-50 cursor-not-allowed" : ""}` },
|
|
581
|
+
React.createElement("div", { onClick: handleFullscreen, className: isPipActive ? "pointer-events-none" : "" },
|
|
582
|
+
React.createElement(FullScreenToggle, { isFullScreen: isFullscreen, className: iconClassName }))),
|
|
583
|
+
React.createElement(Tooltip, { title: isPipActive ? "Exit PiP" : "Enter PiP" },
|
|
584
|
+
React.createElement("div", { onClick: handlePipToggle },
|
|
585
|
+
React.createElement(PiPictureInPictureToggle, { className: iconClassName }))),
|
|
446
586
|
config?.onClose && (React.createElement(React.Fragment, null,
|
|
447
|
-
React.createElement("div", { className: "w-[2px] h-10 bg-
|
|
587
|
+
React.createElement("div", { className: "w-[2px] h-10 bg-gray-500 hover:bg-gray-300 mx-2" }),
|
|
448
588
|
React.createElement("div", { onClick: config.onClose },
|
|
449
589
|
React.createElement(Tooltip, { title: "Close" },
|
|
450
|
-
React.createElement(
|
|
590
|
+
React.createElement(IoMdClose, { className: iconClassName }))))))));
|
|
451
591
|
};
|
|
452
592
|
|
|
453
593
|
const MiddleControls = () => {
|
|
454
|
-
const { videoRef, isPlaying, setIsPlaying } = useVideoStore();
|
|
594
|
+
const { videoRef, isPlaying, setIsPlaying, isBuffering, setIsBuffering } = useVideoStore();
|
|
455
595
|
const handlePlayPause = () => {
|
|
456
596
|
if (!videoRef)
|
|
457
597
|
return;
|
|
@@ -476,18 +616,66 @@ const MiddleControls = () => {
|
|
|
476
616
|
return;
|
|
477
617
|
videoRef.currentTime += 10;
|
|
478
618
|
};
|
|
479
|
-
|
|
480
|
-
|
|
619
|
+
// Handle buffering state
|
|
620
|
+
useEffect(() => {
|
|
621
|
+
if (!videoRef)
|
|
622
|
+
return;
|
|
623
|
+
const handleWaiting = () => {
|
|
624
|
+
setIsBuffering(true);
|
|
625
|
+
};
|
|
626
|
+
const handlePlaying = () => {
|
|
627
|
+
setIsBuffering(false);
|
|
628
|
+
};
|
|
629
|
+
videoRef.addEventListener("waiting", handleWaiting);
|
|
630
|
+
videoRef.addEventListener("playing", handlePlaying);
|
|
631
|
+
return () => {
|
|
632
|
+
videoRef.removeEventListener("waiting", handleWaiting);
|
|
633
|
+
videoRef.removeEventListener("playing", handlePlaying);
|
|
634
|
+
};
|
|
635
|
+
}, [videoRef, setIsBuffering]);
|
|
636
|
+
useEffect(() => {
|
|
637
|
+
if (!videoRef)
|
|
638
|
+
return;
|
|
639
|
+
const handleWaiting = () => setIsBuffering(true);
|
|
640
|
+
const handlePlaying = () => setIsBuffering(false);
|
|
641
|
+
videoRef.addEventListener("waiting", handleWaiting);
|
|
642
|
+
videoRef.addEventListener("playing", handlePlaying);
|
|
643
|
+
return () => {
|
|
644
|
+
videoRef.removeEventListener("waiting", handleWaiting);
|
|
645
|
+
videoRef.removeEventListener("playing", handlePlaying);
|
|
646
|
+
};
|
|
647
|
+
}, [videoRef, setIsBuffering]);
|
|
648
|
+
// keyboard controls
|
|
649
|
+
useEffect(() => {
|
|
650
|
+
const handleKeyDown = (e) => {
|
|
651
|
+
if (!videoRef)
|
|
652
|
+
return;
|
|
653
|
+
switch (e.code) {
|
|
654
|
+
case "Space":
|
|
655
|
+
e.preventDefault();
|
|
656
|
+
handlePlayPause();
|
|
657
|
+
break;
|
|
658
|
+
case "ArrowLeft":
|
|
659
|
+
handleBackword();
|
|
660
|
+
break;
|
|
661
|
+
case "ArrowRight":
|
|
662
|
+
handleForword();
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
667
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
668
|
+
}, [videoRef, isPlaying]);
|
|
481
669
|
return (React__default.createElement("div", { className: "flex justify-center items-center" },
|
|
482
670
|
React__default.createElement("div", { onClick: handleBackword, className: "w-[15vw] flex justify-center items-center h-full cursor-pointer" },
|
|
483
|
-
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className:
|
|
484
|
-
React__default.createElement("path", {
|
|
485
|
-
React__default.createElement("div", { className: "w-[10vw] flex justify-center items-center h-full cursor-pointer",
|
|
486
|
-
React__default.createElement("path", {
|
|
487
|
-
React__default.createElement("path", {
|
|
488
|
-
React__default.createElement("div", { className: "w-[15vw] flex justify-center items-center h-full cursor-pointer"
|
|
489
|
-
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className:
|
|
490
|
-
React__default.createElement("path", {
|
|
671
|
+
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
|
|
672
|
+
React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M33.5 0C52 0 67 15 67 33.5S52 67 33.5 67 0 52 0 33.5c.03-1.4 1.17-2.53 2.58-2.53 1.4 0 2.55 1.13 2.57 2.53 0 15.65 12.7 28.35 28.35 28.35 15.66 0 28.35-12.7 28.35-28.35 0-15.66-12.69-28.35-28.35-28.35h-.04c-7 0-13.76 2.61-18.94 7.3-.46.42-.91.85-1.34 1.29h6.58c1.42 0 2.57 1.16 2.57 2.58 0 1.42-1.15 2.58-2.57 2.58H6.01c-1.42 0-2.57-1.16-2.57-2.58V2.58C3.44 1.15 4.59 0 6.01 0c1.43 0 2.58 1.15 2.58 2.58v8.52c.78-.86 1.61-1.7 2.47-2.47A33.407 33.407 0 0 1 33.46 0h.04zM33.98 41.34c-1.6-2.21-2-5.2-2-7.85 0-2.65.4-5.63 2-7.83 1.44-1.97 3.47-2.84 5.88-2.84 2.41 0 4.42.87 5.86 2.84 1.61 2.21 2.03 5.16 2.03 7.83 0 2.66-.4 5.64-2 7.85-1.43 1.97-3.47 2.84-5.89 2.84-2.41 0-4.45-.86-5.88-2.84zm-9.73-12.77l-5 1.58v-4.21l5.87-2.65h4.28v20.47h-5.15V28.57zm17.61 9.96c.61-1.33.68-3.6.68-5.04s-.07-3.7-.68-5.02c-.4-.86-1.04-1.29-2-1.29-.95 0-1.59.42-1.99 1.29-.61 1.32-.68 3.58-.68 5.02 0 1.44.07 3.71.68 5.04.4.87 1.04 1.29 1.99 1.29.96 0 1.6-.42 2-1.29z" }))),
|
|
673
|
+
React__default.createElement("div", { onClick: handlePlayPause, className: "w-[10vw] flex justify-center items-center h-full cursor-pointer" }, isBuffering ? (React__default.createElement(Loader, { className: "w-24 h-24 lg:w-32 lg:h-32 animate-spin text-white" })) : isPlaying ? (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
|
|
674
|
+
React__default.createElement("path", { fillRule: "evenodd", d: "M46.332 5.773a4.125 4.125 0 0 0-4.125 4.125v46.75a4.127 4.127 0 0 0 4.125 4.125 4.127 4.127 0 0 0 4.125-4.125V9.898a4.125 4.125 0 0 0-4.125-4.125zM25.707 9.898v46.75a4.125 4.125 0 1 1-8.25 0V9.898a4.123 4.123 0 0 1 4.125-4.125 4.123 4.123 0 0 1 4.125 4.125z", clipRule: "evenodd" }))) : (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
|
|
675
|
+
React__default.createElement("path", { d: "M20.28 9.65c-2.205-1.268-4.026-.228-4.026 2.307v43.805c0 2.535 1.82 3.574 4.027 2.307l38.471-21.903a2.556 2.556 0 0 0 1.094-.935 2.514 2.514 0 0 0 0-2.743 2.556 2.556 0 0 0-1.093-.936L20.28 9.65z" })))),
|
|
676
|
+
React__default.createElement("div", { onClick: handleForword, className: "w-[15vw] flex justify-center items-center h-full cursor-pointer" },
|
|
677
|
+
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon-class", fill: "currentColor", viewBox: "0 0 67 67" },
|
|
678
|
+
React__default.createElement("path", { fillRule: "evenodd", d: "M33.5 0C15 0 0 15 0 33.5S15 67 33.5 67 67 52 67 33.5a2.583 2.583 0 0 0-2.58-2.53c-1.4 0-2.55 1.13-2.57 2.53 0 15.66-12.69 28.35-28.35 28.35-15.65 0-28.35-12.7-28.35-28.35 0-15.66 12.7-28.35 28.35-28.35 7.3 0 13.96 2.76 18.99 7.3.46.42.9.85 1.34 1.29h-6.59a2.58 2.58 0 0 0 0 5.16h13.75c1.42 0 2.57-1.16 2.57-2.58V2.58c0-1.43-1.15-2.58-2.57-2.58-1.43 0-2.58 1.15-2.58 2.58v8.52c-.78-.87-1.61-1.7-2.47-2.48A33.446 33.446 0 0 0 33.54 0h-.04zM33.98 41.34c-1.6-2.21-2-5.2-2-7.85 0-2.65.4-5.63 2-7.83 1.44-1.97 3.47-2.84 5.88-2.84 2.41 0 4.42.87 5.86 2.84 1.61 2.21 2.03 5.16 2.03 7.83 0 2.66-.4 5.64-2 7.85-1.43 1.97-3.47 2.84-5.89 2.84-2.41 0-4.45-.87-5.88-2.84zm-9.73-12.77l-5 1.58v-4.21l5.87-2.65h4.28v20.47h-5.15V28.57zm17.61 9.96c.61-1.33.68-3.6.68-5.04s-.07-3.7-.68-5.02c-.4-.87-1.04-1.29-2-1.29-.95 0-1.59.42-1.99 1.29-.61 1.32-.68 3.58-.68 5.02 0 1.44.07 3.71.68 5.04.4.86 1.04 1.28 1.99 1.28.96 0 1.6-.42 2-1.28z" })))));
|
|
491
679
|
};
|
|
492
680
|
|
|
493
681
|
const VideoPlayerControls = ({ config, height, width, }) => {
|
|
@@ -497,9 +685,23 @@ const VideoPlayerControls = ({ config, height, width, }) => {
|
|
|
497
685
|
React.createElement(BottomControls, { config: config?.bottomConfig?.config })));
|
|
498
686
|
};
|
|
499
687
|
|
|
688
|
+
const VideoActionButton = ({ text, onClick, icon, disabled = false, position = "left", }) => {
|
|
689
|
+
// Increase icon size and apply consistent color to icon
|
|
690
|
+
const renderedIcon = icon
|
|
691
|
+
? React__default.cloneElement(icon, {
|
|
692
|
+
className: "h-5 w-5 text-gray-900",
|
|
693
|
+
})
|
|
694
|
+
: null;
|
|
695
|
+
return (React__default.createElement("div", { className: `absolute bottom-36 ${position === "left" ? "left-32" : "right-32"}` },
|
|
696
|
+
React__default.createElement("button", { onClick: onClick, disabled: disabled, className: "\n bg-white/80 text-gray-900 font-semibold px-6 py-2 \n rounded-md text-sm flex items-center\n backdrop-blur-sm shadow-md\n hover:bg-white/90\n transition\n focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-gray-400\n disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-white/50\n " },
|
|
697
|
+
renderedIcon && React__default.createElement("span", { className: "inline mr-2" }, renderedIcon),
|
|
698
|
+
text)));
|
|
699
|
+
};
|
|
700
|
+
|
|
500
701
|
const Overlay = ({ config }) => {
|
|
501
702
|
const controlsTimerRef = useRef(null);
|
|
502
|
-
const { setControls, controls } = useVideoStore();
|
|
703
|
+
const { setControls, controls, showCountdown, countdownTime, setShowCountdown, setAutoPlayNext, setCurrentEpisodeIndex, episodeList, setCountdownTime, videoRef, currentEpisodeIndex, } = useVideoStore();
|
|
704
|
+
const { onClose } = config?.headerConfig?.config || {};
|
|
503
705
|
const handleMouseEnter = useCallback(() => {
|
|
504
706
|
const videoPlayerControls = document?.getElementById("videoPlayerControls");
|
|
505
707
|
if (videoPlayerControls) {
|
|
@@ -514,20 +716,79 @@ const Overlay = ({ config }) => {
|
|
|
514
716
|
if (videoPlayerControls) {
|
|
515
717
|
videoPlayerControls.classList.add("noCursor");
|
|
516
718
|
}
|
|
517
|
-
},
|
|
719
|
+
}, 2000);
|
|
518
720
|
}, [setControls]);
|
|
519
|
-
|
|
721
|
+
React.useEffect(() => {
|
|
722
|
+
let timer;
|
|
723
|
+
if (showCountdown && countdownTime > 0 && episodeList.length > 0) {
|
|
724
|
+
timer = setInterval(() => {
|
|
725
|
+
setCountdownTime(countdownTime - 1);
|
|
726
|
+
}, 1000);
|
|
727
|
+
}
|
|
728
|
+
else if (showCountdown && countdownTime === 0 && episodeList.length > 0) {
|
|
729
|
+
const nextIndex = currentEpisodeIndex + 1;
|
|
730
|
+
if (nextIndex < episodeList.length) {
|
|
731
|
+
setCurrentEpisodeIndex(nextIndex);
|
|
732
|
+
setAutoPlayNext(true);
|
|
733
|
+
if (videoRef && episodeList[nextIndex]) {
|
|
734
|
+
videoRef.src = episodeList[nextIndex].url;
|
|
735
|
+
videoRef
|
|
736
|
+
.play()
|
|
737
|
+
.catch((err) => console.error("Auto-play failed:", err));
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
if (onClose)
|
|
742
|
+
onClose();
|
|
743
|
+
}
|
|
744
|
+
setShowCountdown(false);
|
|
745
|
+
}
|
|
746
|
+
return () => {
|
|
747
|
+
if (timer)
|
|
748
|
+
clearInterval(timer);
|
|
749
|
+
};
|
|
750
|
+
}, [
|
|
751
|
+
showCountdown,
|
|
752
|
+
countdownTime,
|
|
753
|
+
episodeList.length,
|
|
754
|
+
setCountdownTime,
|
|
755
|
+
setCurrentEpisodeIndex,
|
|
756
|
+
currentEpisodeIndex,
|
|
757
|
+
setAutoPlayNext,
|
|
758
|
+
videoRef,
|
|
759
|
+
episodeList,
|
|
760
|
+
onClose,
|
|
761
|
+
]);
|
|
762
|
+
const handleNextEpisodeManually = () => {
|
|
763
|
+
const nextIndex = currentEpisodeIndex + 1;
|
|
764
|
+
if (nextIndex < episodeList.length && videoRef && episodeList[nextIndex]) {
|
|
765
|
+
setCurrentEpisodeIndex(nextIndex);
|
|
766
|
+
setAutoPlayNext(true);
|
|
767
|
+
videoRef.src = episodeList[nextIndex].url;
|
|
768
|
+
videoRef.play().catch((err) => console.error("Manual play failed:", err));
|
|
769
|
+
setShowCountdown(false);
|
|
770
|
+
}
|
|
771
|
+
else if (onClose) {
|
|
772
|
+
onClose();
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
return (React.createElement("div", { id: "videoPlayerControls", className: "absolute inset-0", onMouseMove: handleMouseEnter },
|
|
776
|
+
controls && React.createElement(VideoPlayerControls, { config: config }),
|
|
777
|
+
showCountdown &&
|
|
778
|
+
episodeList.length > 0 &&
|
|
779
|
+
currentEpisodeIndex + 1 < episodeList.length && (React.createElement(VideoActionButton, { text: "Next Episode", onClick: handleNextEpisodeManually, icon: React.createElement(FaGooglePlay, { className: "text-black" }), disabled: currentEpisodeIndex + 1 >= episodeList.length, position: "right" }))));
|
|
520
780
|
};
|
|
521
781
|
|
|
522
|
-
const VideoPlayer = ({ trackSrc, trackTitle, trackPoster, isTrailer, className, type, height, width, timeCodes, getPreviewScreenUrl, tracking, }) => {
|
|
523
|
-
const { setVideoRef, setCurrentTime, setVideoWrapperRef, videoRef, setQualityLevels, setHlsInstance, setDuration, setIsPlaying, } = useVideoStore();
|
|
782
|
+
const VideoPlayer = ({ trackSrc, trackTitle, intro, onClose, trackPoster, isTrailer, className, type, height, width, timeCodes, getPreviewScreenUrl, tracking, subtitles, episodeList, currentEpisodeIndex = 0, nextEpisodeConfig, }) => {
|
|
783
|
+
const { setVideoRef, setCurrentTime, setVideoWrapperRef, videoRef, setQualityLevels, setHlsInstance, setDuration, setIsPlaying, activeSubtitle, setSubtitles, setEpisodeList, setCurrentEpisodeIndex, setShowCountdown, } = useVideoStore();
|
|
784
|
+
const [showSkipIntro, setShowSkipIntro] = useState(false);
|
|
524
785
|
const onRightClick = (e) => {
|
|
525
786
|
e.preventDefault();
|
|
526
787
|
};
|
|
788
|
+
// === VIDEO SOURCE INIT ===
|
|
527
789
|
useEffect(() => {
|
|
528
|
-
if (!videoRef)
|
|
790
|
+
if (!videoRef)
|
|
529
791
|
return;
|
|
530
|
-
}
|
|
531
792
|
const getVideoExtension = getExtensionFromUrl(trackSrc);
|
|
532
793
|
const contentType = type || getVideoExtension;
|
|
533
794
|
if (contentType === "mp4") {
|
|
@@ -536,21 +797,18 @@ const VideoPlayer = ({ trackSrc, trackTitle, trackPoster, isTrailer, className,
|
|
|
536
797
|
}
|
|
537
798
|
else if (contentType === "hls") {
|
|
538
799
|
if (videoRef?.canPlayType("application/vnd.apple.mpegurl")) {
|
|
539
|
-
// Native HLS support (Safari)
|
|
540
800
|
videoRef.src = trackSrc;
|
|
541
801
|
}
|
|
542
802
|
else if (Hls.isSupported()) {
|
|
543
|
-
// Use hls.js for other browsers
|
|
544
803
|
const hls = new Hls();
|
|
545
804
|
hls.loadSource(trackSrc);
|
|
546
805
|
hls.attachMedia(videoRef);
|
|
547
806
|
setHlsInstance(hls);
|
|
548
|
-
// Get quality levels when HLS loads
|
|
549
807
|
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
550
808
|
setQualityLevels(hls.levels);
|
|
551
809
|
});
|
|
552
810
|
return () => {
|
|
553
|
-
hls.destroy();
|
|
811
|
+
hls.destroy();
|
|
554
812
|
};
|
|
555
813
|
}
|
|
556
814
|
}
|
|
@@ -559,36 +817,89 @@ const VideoPlayer = ({ trackSrc, trackTitle, trackPoster, isTrailer, className,
|
|
|
559
817
|
setQualityLevels([]);
|
|
560
818
|
}
|
|
561
819
|
}, [trackSrc, videoRef]);
|
|
562
|
-
//
|
|
563
|
-
const startTime = useRef(null);
|
|
564
|
-
const isViewCounted = useRef(false);
|
|
820
|
+
// === SUBTITLES ===
|
|
565
821
|
useEffect(() => {
|
|
566
822
|
if (videoRef) {
|
|
567
|
-
videoRef.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
startTime.current = Date.now();
|
|
575
|
-
setIsPlaying(true);
|
|
823
|
+
const tracks = videoRef.getElementsByTagName("track");
|
|
824
|
+
while (tracks.length > 0) {
|
|
825
|
+
videoRef.removeChild(tracks[0]);
|
|
826
|
+
}
|
|
827
|
+
Array.from(videoRef.textTracks).forEach((track) => {
|
|
828
|
+
track.mode = "disabled";
|
|
576
829
|
});
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
830
|
+
if (activeSubtitle && subtitles) {
|
|
831
|
+
const index = subtitles.findIndex((s) => s.label === activeSubtitle.label);
|
|
832
|
+
if (index !== -1) {
|
|
833
|
+
const trackElement = document.createElement("track");
|
|
834
|
+
trackElement.kind = "subtitles";
|
|
835
|
+
trackElement.label = activeSubtitle.label;
|
|
836
|
+
trackElement.srclang = activeSubtitle.lang;
|
|
837
|
+
trackElement.src = activeSubtitle.url;
|
|
838
|
+
trackElement.default = false;
|
|
839
|
+
videoRef.appendChild(trackElement);
|
|
840
|
+
const textTrack = Array.from(videoRef.textTracks).find((track) => track.label === activeSubtitle.label);
|
|
841
|
+
if (textTrack) {
|
|
842
|
+
textTrack.mode = "showing";
|
|
843
|
+
console.log("Subtitle track activated:", activeSubtitle.label);
|
|
844
|
+
}
|
|
583
845
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
Array.from(videoRef.textTracks).forEach((track) => {
|
|
849
|
+
track.mode = "disabled";
|
|
850
|
+
});
|
|
851
|
+
}
|
|
590
852
|
}
|
|
591
|
-
}, [videoRef]);
|
|
853
|
+
}, [activeSubtitle, videoRef, subtitles]);
|
|
854
|
+
// === TRACKING (play/pause/watchtime) ===
|
|
855
|
+
const startTime = useRef(null);
|
|
856
|
+
const isViewCounted = useRef(false);
|
|
857
|
+
useEffect(() => {
|
|
858
|
+
if (!videoRef)
|
|
859
|
+
return;
|
|
860
|
+
const onPlay = () => {
|
|
861
|
+
if (!isViewCounted.current) {
|
|
862
|
+
isViewCounted.current = true;
|
|
863
|
+
tracking?.onViewed?.();
|
|
864
|
+
}
|
|
865
|
+
startTime.current = Date.now();
|
|
866
|
+
setIsPlaying(true);
|
|
867
|
+
};
|
|
868
|
+
const onPause = () => {
|
|
869
|
+
if (startTime.current) {
|
|
870
|
+
const elapsedTime = (Date.now() - startTime.current) / 1000;
|
|
871
|
+
const getCurrentTime = localStorage.getItem("current_time");
|
|
872
|
+
localStorage.setItem("current_time", (Number(getCurrentTime || 0) + elapsedTime).toString());
|
|
873
|
+
startTime.current = null;
|
|
874
|
+
}
|
|
875
|
+
setIsPlaying(false);
|
|
876
|
+
};
|
|
877
|
+
const onEnded = () => {
|
|
878
|
+
if (episodeList &&
|
|
879
|
+
episodeList.length > 0 &&
|
|
880
|
+
currentEpisodeIndex !== undefined) {
|
|
881
|
+
const nextIndex = currentEpisodeIndex + 1;
|
|
882
|
+
if (nextIndex < episodeList.length) {
|
|
883
|
+
setShowCountdown(true);
|
|
884
|
+
}
|
|
885
|
+
else if (onClose) {
|
|
886
|
+
onClose();
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
else if (onClose) {
|
|
890
|
+
onClose();
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
videoRef.addEventListener("play", onPlay);
|
|
894
|
+
videoRef.addEventListener("pause", onPause);
|
|
895
|
+
videoRef.addEventListener("ended", onEnded);
|
|
896
|
+
return () => {
|
|
897
|
+
videoRef.removeEventListener("play", onPlay);
|
|
898
|
+
videoRef.removeEventListener("pause", onPause);
|
|
899
|
+
videoRef.removeEventListener("ended", onEnded);
|
|
900
|
+
};
|
|
901
|
+
}, [videoRef, episodeList, currentEpisodeIndex, onClose]);
|
|
902
|
+
// === BEFORE UNLOAD ===
|
|
592
903
|
const handleUnload = (e) => {
|
|
593
904
|
e.preventDefault();
|
|
594
905
|
if (startTime.current) {
|
|
@@ -598,11 +909,9 @@ const VideoPlayer = ({ trackSrc, trackTitle, trackPoster, isTrailer, className,
|
|
|
598
909
|
}
|
|
599
910
|
const totalTimeWatched = Number(localStorage.getItem("current_time") || 0);
|
|
600
911
|
if (totalTimeWatched >= 30) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
});
|
|
605
|
-
}
|
|
912
|
+
tracking?.onWatchTimeUpdated?.({
|
|
913
|
+
watchTime: totalTimeWatched,
|
|
914
|
+
});
|
|
606
915
|
}
|
|
607
916
|
localStorage.setItem("current_time", "0");
|
|
608
917
|
};
|
|
@@ -614,35 +923,105 @@ const VideoPlayer = ({ trackSrc, trackTitle, trackPoster, isTrailer, className,
|
|
|
614
923
|
window.removeEventListener("unload", handleUnload);
|
|
615
924
|
};
|
|
616
925
|
}, [startTime]);
|
|
617
|
-
|
|
618
|
-
|
|
926
|
+
useEffect(() => {
|
|
927
|
+
if (subtitles) {
|
|
928
|
+
setSubtitles(subtitles);
|
|
929
|
+
}
|
|
930
|
+
if (episodeList) {
|
|
931
|
+
setEpisodeList(episodeList);
|
|
932
|
+
}
|
|
933
|
+
if (currentEpisodeIndex !== undefined) {
|
|
934
|
+
setCurrentEpisodeIndex(currentEpisodeIndex);
|
|
935
|
+
}
|
|
936
|
+
}, [subtitles, episodeList, currentEpisodeIndex]);
|
|
937
|
+
// === INTRO LOGIC ===
|
|
938
|
+
useEffect(() => {
|
|
939
|
+
if (!videoRef || !intro)
|
|
940
|
+
return;
|
|
941
|
+
const checkIntro = () => {
|
|
942
|
+
if (videoRef.currentTime >= intro.start &&
|
|
943
|
+
videoRef.currentTime < intro.end) {
|
|
944
|
+
setShowSkipIntro(true);
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
setShowSkipIntro(false);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
videoRef.addEventListener("timeupdate", checkIntro);
|
|
951
|
+
return () => {
|
|
952
|
+
videoRef.removeEventListener("timeupdate", checkIntro);
|
|
953
|
+
};
|
|
954
|
+
}, [videoRef, intro]);
|
|
955
|
+
const handleSkipIntro = () => {
|
|
956
|
+
if (videoRef && intro) {
|
|
957
|
+
videoRef.currentTime = intro.end;
|
|
958
|
+
setShowSkipIntro(false);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
// === NEXT EPISODE LOGIC (Backend Dependent) ===
|
|
962
|
+
useEffect(() => {
|
|
963
|
+
if (!videoRef || !nextEpisodeConfig)
|
|
964
|
+
return;
|
|
965
|
+
const checkNextEpisode = () => {
|
|
966
|
+
const currentTime = videoRef.currentTime || 0;
|
|
967
|
+
// Show based on backend config
|
|
968
|
+
if (nextEpisodeConfig.showAtEnd && videoRef.ended) {
|
|
969
|
+
setShowCountdown(true);
|
|
970
|
+
}
|
|
971
|
+
else if (nextEpisodeConfig.showAtTime &&
|
|
972
|
+
currentTime >= nextEpisodeConfig.showAtTime) {
|
|
973
|
+
setShowCountdown(true);
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
videoRef.addEventListener("timeupdate", checkNextEpisode);
|
|
977
|
+
videoRef.addEventListener("ended", checkNextEpisode);
|
|
978
|
+
return () => {
|
|
979
|
+
videoRef.removeEventListener("timeupdate", checkNextEpisode);
|
|
980
|
+
videoRef.removeEventListener("ended", checkNextEpisode);
|
|
981
|
+
};
|
|
982
|
+
}, [videoRef, nextEpisodeConfig]);
|
|
983
|
+
return (React__default.createElement("div", { ref: setVideoWrapperRef, className: `${height || "h-full"} ${width || "w-full"} mx-auto absolute` },
|
|
984
|
+
React__default.createElement("video", { ref: setVideoRef, className: `w-full h-full relative ${className} [&::cue]:absolute
|
|
985
|
+
[&::cue]:top-[6%]
|
|
986
|
+
[&::cue]:text-xl
|
|
987
|
+
[&::cue]:bg-gray-50
|
|
988
|
+
[&::cue]:text-[#1E1E1E]
|
|
989
|
+
[&::cue]:px-2
|
|
990
|
+
[&::cue]:py-1
|
|
991
|
+
[&::cue]:rounded-md`, poster: trackPoster, autoPlay: true, crossOrigin: "anonymous", onContextMenu: onRightClick, playsInline: true, preload: "auto", onSeeked: (e) => {
|
|
619
992
|
if (e?.currentTarget?.currentTime) {
|
|
620
993
|
setCurrentTime(e?.currentTarget?.currentTime);
|
|
621
994
|
}
|
|
622
|
-
},
|
|
995
|
+
}, onTimeUpdate: (e) => {
|
|
996
|
+
if (e?.currentTarget?.currentTime) {
|
|
997
|
+
setCurrentTime(e?.currentTarget?.currentTime);
|
|
998
|
+
}
|
|
999
|
+
}, onLoadedMetadata: (e) => {
|
|
623
1000
|
if (e?.currentTarget?.duration) {
|
|
624
1001
|
localStorage.setItem("current_time", "0");
|
|
625
1002
|
setDuration(e?.currentTarget?.duration);
|
|
626
1003
|
}
|
|
627
|
-
} },
|
|
628
|
-
|
|
629
|
-
React__default.createElement(Overlay, { height: height, width: width, config: {
|
|
1004
|
+
} }),
|
|
1005
|
+
React__default.createElement(Overlay, { config: {
|
|
630
1006
|
headerConfig: {
|
|
631
1007
|
config: {
|
|
632
1008
|
isTrailer: isTrailer,
|
|
633
1009
|
title: trackTitle,
|
|
1010
|
+
onClose: onClose,
|
|
1011
|
+
videoRef: videoRef,
|
|
634
1012
|
},
|
|
635
1013
|
},
|
|
636
1014
|
bottomConfig: {
|
|
637
1015
|
config: {
|
|
638
1016
|
seekBarConfig: {
|
|
639
1017
|
timeCodes: timeCodes,
|
|
640
|
-
trackColor: "
|
|
1018
|
+
trackColor: "red",
|
|
641
1019
|
getPreviewScreenUrl,
|
|
642
1020
|
},
|
|
643
1021
|
},
|
|
644
1022
|
},
|
|
645
|
-
} })
|
|
1023
|
+
} }),
|
|
1024
|
+
showSkipIntro && (React__default.createElement(VideoActionButton, { text: "Skip Intro", onClick: handleSkipIntro, position: "left" }))));
|
|
646
1025
|
};
|
|
647
1026
|
|
|
648
1027
|
export { VideoPlayer, useVideoStore };
|