hamrahi-player-library 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.
Files changed (115) hide show
  1. package/README.md +103 -0
  2. package/dist/hamrahi-player-library.css +7 -0
  3. package/dist/hamrahi-player-library.js +6 -0
  4. package/dist/hamrahi-player-library.umd.cjs +64 -0
  5. package/dist/index-2OVdYUgm.js +21871 -0
  6. package/dist/main.d.ts +1 -0
  7. package/dist/nonStaticVideoTag-CaUIINW6.js +137 -0
  8. package/dist/notActive-DokxPXmF.js +10 -0
  9. package/dist/staticPlayer-CqHC_NDw.js +13 -0
  10. package/dist/staticVideoTag-Bq3QUZG0.js +57 -0
  11. package/dist/touchVolumeBrightness-zJwzVg8P.js +131 -0
  12. package/dist/useHideSubtitle-xaoPFO2J.js +29 -0
  13. package/dist/user.actions-ChPfxQsM.js +29 -0
  14. package/dist/videoArea-B8winUaa.js +1379 -0
  15. package/dist/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.d.ts +3 -0
  16. package/dist/videoPlayerLibrary/components/custom-components/elapsedTime/elapsedTime.d.ts +2 -0
  17. package/dist/videoPlayerLibrary/components/custom-components/emoji/emoji.d.ts +3 -0
  18. package/dist/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbar.d.ts +2 -0
  19. package/dist/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbarTooltip.d.ts +3 -0
  20. package/dist/videoPlayerLibrary/components/custom-components/footer/footer.d.ts +2 -0
  21. package/dist/videoPlayerLibrary/components/custom-components/footer/progressbar/markers/markers.d.ts +2 -0
  22. package/dist/videoPlayerLibrary/components/custom-components/footer/progressbar/progressbar.d.ts +2 -0
  23. package/dist/videoPlayerLibrary/components/custom-components/fullScreen/fullScreen.d.ts +2 -0
  24. package/dist/videoPlayerLibrary/components/custom-components/header/header.d.ts +2 -0
  25. package/dist/videoPlayerLibrary/components/custom-components/loader/loader.d.ts +2 -0
  26. package/dist/videoPlayerLibrary/components/custom-components/lockUnlock/lock.d.ts +2 -0
  27. package/dist/videoPlayerLibrary/components/custom-components/lockUnlock/unlock.d.ts +2 -0
  28. package/dist/videoPlayerLibrary/components/custom-components/main/main.d.ts +2 -0
  29. package/dist/videoPlayerLibrary/components/custom-components/markersList/markersList.d.ts +2 -0
  30. package/dist/videoPlayerLibrary/components/custom-components/markersList/markersListIcon.d.ts +3 -0
  31. package/dist/videoPlayerLibrary/components/custom-components/miniPlayer/miniPlayer.d.ts +4 -0
  32. package/dist/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerNonStaticVideoTag.d.ts +2 -0
  33. package/dist/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerStaticVideoTag.d.ts +2 -0
  34. package/dist/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/videoTag.d.ts +2 -0
  35. package/dist/videoPlayerLibrary/components/custom-components/notActive/notActive.d.ts +2 -0
  36. package/dist/videoPlayerLibrary/components/custom-components/pictureInPicture/pictureInPicture.d.ts +2 -0
  37. package/dist/videoPlayerLibrary/components/custom-components/playPause/miniPlayerPlayPause.d.ts +2 -0
  38. package/dist/videoPlayerLibrary/components/custom-components/playPause/playPause.d.ts +2 -0
  39. package/dist/videoPlayerLibrary/components/custom-components/popover/popover.d.ts +3 -0
  40. package/dist/videoPlayerLibrary/components/custom-components/qualityLevels/qualityLevels.d.ts +3 -0
  41. package/dist/videoPlayerLibrary/components/custom-components/settings/settings.d.ts +2 -0
  42. package/dist/videoPlayerLibrary/components/custom-components/soundVolume/soundVolume.d.ts +2 -0
  43. package/dist/videoPlayerLibrary/components/custom-components/speed/speed.d.ts +3 -0
  44. package/dist/videoPlayerLibrary/components/custom-components/subtitles/displaySubtitle.d.ts +2 -0
  45. package/dist/videoPlayerLibrary/components/custom-components/subtitles/subtitleIcon.d.ts +2 -0
  46. package/dist/videoPlayerLibrary/components/custom-components/subtitles/subtitleSettingMenu.d.ts +2 -0
  47. package/dist/videoPlayerLibrary/components/custom-components/title/title.d.ts +2 -0
  48. package/dist/videoPlayerLibrary/components/custom-components/toggle/toggle.d.ts +3 -0
  49. package/dist/videoPlayerLibrary/components/custom-components/tooltip/tooltip.d.ts +2 -0
  50. package/dist/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.d.ts +2 -0
  51. package/dist/videoPlayerLibrary/components/custom-components/videoArea/videoArea.d.ts +2 -0
  52. package/dist/videoPlayerLibrary/components/custom-components/videoAreaShadow.tsx/videoAreaShadow.d.ts +2 -0
  53. package/dist/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.d.ts +2 -0
  54. package/dist/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.d.ts +2 -0
  55. package/dist/videoPlayerLibrary/components/custom-components/videoTag/videoTag.d.ts +2 -0
  56. package/dist/videoPlayerLibrary/components/icon-components/closeIcon.d.ts +3 -0
  57. package/dist/videoPlayerLibrary/components/icon-components/mute.d.ts +3 -0
  58. package/dist/videoPlayerLibrary/components/icon-components/speed.d.ts +3 -0
  59. package/dist/videoPlayerLibrary/components/icon-components/unMute.d.ts +3 -0
  60. package/dist/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.d.ts +2 -0
  61. package/dist/videoPlayerLibrary/components/videoPlayer/videoPlayer.d.ts +6 -0
  62. package/dist/videoPlayerLibrary/components/videoPlayer/vodPlayer/vodPlayer.d.ts +2 -0
  63. package/dist/videoPlayerLibrary/helpers/conditions/conditions.d.ts +1 -0
  64. package/dist/videoPlayerLibrary/helpers/configs/nextConfigs/env.d.ts +4 -0
  65. package/dist/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage.d.ts +1 -0
  66. package/dist/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage_lib.d.ts +1 -0
  67. package/dist/videoPlayerLibrary/helpers/configs/propsColors.d.ts +1 -0
  68. package/dist/videoPlayerLibrary/helpers/constants.d.ts +4 -0
  69. package/dist/videoPlayerLibrary/helpers/environment.d.ts +5 -0
  70. package/dist/videoPlayerLibrary/helpers/errorBoundary/errorBoundary.d.ts +14 -0
  71. package/dist/videoPlayerLibrary/helpers/errorBoundary/errorBoundaryFunctions.d.ts +6 -0
  72. package/dist/videoPlayerLibrary/helpers/getDetailsConfigs.d.ts +3 -0
  73. package/dist/videoPlayerLibrary/helpers/helpers.d.ts +27 -0
  74. package/dist/videoPlayerLibrary/helpers/hooks/useActiveInActive.d.ts +2 -0
  75. package/dist/videoPlayerLibrary/helpers/hooks/useBeforeUnload.d.ts +2 -0
  76. package/dist/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.d.ts +2 -0
  77. package/dist/videoPlayerLibrary/helpers/hooks/useFullScreen.d.ts +2 -0
  78. package/dist/videoPlayerLibrary/helpers/hooks/useGetData/useGetData.d.ts +2 -0
  79. package/dist/videoPlayerLibrary/helpers/hooks/useGetData/useGetDetails.d.ts +2 -0
  80. package/dist/videoPlayerLibrary/helpers/hooks/useGetData/useGetMarkers.d.ts +2 -0
  81. package/dist/videoPlayerLibrary/helpers/hooks/useHandleKeyPress.d.ts +2 -0
  82. package/dist/videoPlayerLibrary/helpers/hooks/useHandleParams.d.ts +2 -0
  83. package/dist/videoPlayerLibrary/helpers/hooks/useHandleResize.d.ts +2 -0
  84. package/dist/videoPlayerLibrary/helpers/hooks/useHideSubtitle.d.ts +2 -0
  85. package/dist/videoPlayerLibrary/helpers/hooks/useJumpToCurrentTime.d.ts +2 -0
  86. package/dist/videoPlayerLibrary/helpers/hooks/useKeyPress.d.ts +2 -0
  87. package/dist/videoPlayerLibrary/helpers/hooks/useLongPress.d.ts +7 -0
  88. package/dist/videoPlayerLibrary/helpers/hooks/useOnClickOutside.d.ts +3 -0
  89. package/dist/videoPlayerLibrary/helpers/hooks/usePingPong.d.ts +2 -0
  90. package/dist/videoPlayerLibrary/helpers/hooks/useSetSubtitleFirstPlay.d.ts +2 -0
  91. package/dist/videoPlayerLibrary/helpers/interfaces/enums.d.ts +100 -0
  92. package/dist/videoPlayerLibrary/helpers/interfaces/interfaces.d.ts +252 -0
  93. package/dist/videoPlayerLibrary/helpers/logs/fluentdLogger.d.ts +1 -0
  94. package/dist/videoPlayerLibrary/helpers/logs/logs.d.ts +163 -0
  95. package/dist/videoPlayerLibrary/helpers/redux/actions/controller.actions.d.ts +12 -0
  96. package/dist/videoPlayerLibrary/helpers/redux/actions/playerCore.actions.d.ts +116 -0
  97. package/dist/videoPlayerLibrary/helpers/redux/actions/progressbar.actions.d.ts +15 -0
  98. package/dist/videoPlayerLibrary/helpers/redux/actions/user.actions.d.ts +2 -0
  99. package/dist/videoPlayerLibrary/helpers/redux/actions/videoData.actions.d.ts +7 -0
  100. package/dist/videoPlayerLibrary/helpers/redux/hooks.d.ts +4 -0
  101. package/dist/videoPlayerLibrary/helpers/redux/slices/controllerSlice.d.ts +26 -0
  102. package/dist/videoPlayerLibrary/helpers/redux/slices/miniPlayerSlice.d.ts +11 -0
  103. package/dist/videoPlayerLibrary/helpers/redux/slices/popoversSlice.d.ts +12 -0
  104. package/dist/videoPlayerLibrary/helpers/redux/slices/userSlice.d.ts +10 -0
  105. package/dist/videoPlayerLibrary/helpers/redux/slices/videoDataSlice.d.ts +20 -0
  106. package/dist/videoPlayerLibrary/helpers/redux/store.d.ts +18 -0
  107. package/dist/videoPlayerLibrary/helpers/services/apiCaller.d.ts +3 -0
  108. package/dist/videoPlayerLibrary/helpers/services/baseUrl.d.ts +3 -0
  109. package/dist/videoPlayerLibrary/helpers/services/services.d.ts +8 -0
  110. package/dist/videoPlayerLibrary/images/importImages.d.ts +2 -0
  111. package/dist/videoPlayerLibrary/index.d.ts +3 -0
  112. package/dist/videoPlayerLibrary/miniPlayerLibrary.d.ts +4 -0
  113. package/dist/videoPlayerLibrary/videoPlayerLibrary.d.ts +4 -0
  114. package/dist/vodPlayer-BZxT6vEI.js +24 -0
  115. package/package.json +63 -0
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,137 @@
1
+ import { jsx as L, Fragment as B, jsxs as Q } from "react/jsx-runtime";
2
+ import { u as g, s as v, c as h, C as m, e as P, y as w, z, a as $, m as a, H as r, A as W, j, B as D, D as S, E as I, F as V, G as J, J as F, K as _, L as q, M as K, N as X, O as C, P as Y, Q as k, R as Z, r as ee, S as H, T as ae, U as ne, V as te, W as se, X as ie, Y as de, Z as re, _ as oe, t as le, w as ue } from "./index-2OVdYUgm.js";
3
+ import { useEffect as E, useState as A, useRef as c, useLayoutEffect as ce } from "react";
4
+ import { c as Ee } from "./videoArea-B8winUaa.js";
5
+ import { a as x } from "./user.actions-ChPfxQsM.js";
6
+ import { u as fe, a as he } from "./useHideSubtitle-xaoPFO2J.js";
7
+ const me = () => {
8
+ let i = null;
9
+ const { isEnded: s } = g(({ controller: { isEnded: f } }) => ({ isEnded: f }), v);
10
+ E(() => (i = setInterval(() => x(), Ee), () => clearInterval(i)), []), E(() => {
11
+ h(m.isEnded) && clearInterval(i);
12
+ }, [s]);
13
+ }, pe = (i) => {
14
+ const [s, f] = A([]), [l, u] = A(0), { qualityLevels: o } = g(({ controller: { qualityLevels: n } }) => ({ qualityLevels: n }), v);
15
+ E(() => {
16
+ if (i) {
17
+ let n = [];
18
+ switch (s.length) {
19
+ case 0:
20
+ n = [i];
21
+ break;
22
+ case 1:
23
+ n = [i, ...s];
24
+ break;
25
+ case 2:
26
+ n = [i, ...s], P(
27
+ w(
28
+ `${n[0]}P`,
29
+ `${n[1]}P`,
30
+ o.indexOf(n[0]) - o.indexOf(n[1])
31
+ )
32
+ );
33
+ break;
34
+ default:
35
+ n = [i, s[0], s[1]], n[1] !== n[2] && P(
36
+ w(
37
+ `${n[1]}P`,
38
+ `${n[2]}P`,
39
+ o.indexOf(n[1]) - o.indexOf(n[2])
40
+ )
41
+ );
42
+ break;
43
+ }
44
+ f(n);
45
+ }
46
+ }, [i]), E(() => {
47
+ s.length === 3 && s[0] === s[2] ? (P(z(l, s)), f([]), u(0)) : u((/* @__PURE__ */ new Date()).getTime());
48
+ }, [s]);
49
+ }, ge = () => {
50
+ E(() => {
51
+ const i = () => {
52
+ x();
53
+ };
54
+ return window.addEventListener("beforeunload", i), () => window.removeEventListener("beforeunload", i);
55
+ }, []);
56
+ }, Te = () => {
57
+ const [i, s] = A(void 0), f = $(), { params: l, details: u, videoElementSizeInfo: o } = g(
58
+ ({ videoData: { params: e, details: t, videoElementSizeInfo: d } }) => ({
59
+ params: e,
60
+ details: t,
61
+ videoElementSizeInfo: d
62
+ }),
63
+ v
64
+ ), { currentTime: n, duration: G } = g(
65
+ ({ controller: { currentTime: e, duration: t, isEnded: d, firstPlay: U } }) => ({
66
+ currentTime: e,
67
+ duration: t,
68
+ isEnded: d,
69
+ firstPlay: U
70
+ }),
71
+ v
72
+ ), y = c(null), O = c(0), p = c(0), R = c(0), T = c(0), b = c(0), M = c(1), N = c(a() ? a().currentTime : 0);
73
+ return me(), ge(), ce(() => {
74
+ let e = new r(W());
75
+ return j(b), R.current = Date.now(), r.isSupported() ? (e.attachMedia(a()), e.on(r.Events.MEDIA_ATTACHED, () => D(r, e)), e.on(r.Events.FRAG_BUFFERED, () => S(e)), e.on(r.Events.FRAG_CHANGED, (t, d) => I(e, d, s)), e.on(r.Events.FRAG_PARSED, (t, d) => V(e, d, s)), e.on(r.Events.ERROR, (t, d) => J(F(d))), a().addEventListener("waiting", (t) => _(t, p)), a().addEventListener("seeking", (t) => q(t, p)), a().addEventListener("play", (t) => K(t, y)), a().addEventListener(
76
+ "playing",
77
+ () => X(
78
+ M,
79
+ b,
80
+ R,
81
+ T,
82
+ y,
83
+ O,
84
+ p,
85
+ N
86
+ )
87
+ ), a().addEventListener("pause", C), a().addEventListener("timeupdate", Y), a().addEventListener("canplay", k), a().addEventListener("ended", Z), a().addEventListener("error", ee), document.addEventListener("visibilitychange", H)) : a().canPlayType("application/vnd.apple.mpegurl") && (a().src = u.stream_link, a().addEventListener("waiting", (t) => _(t, p)), a().addEventListener("play", (t) => ae(t, y)), a().addEventListener("playing", ne), a().addEventListener("canplay", k), a().addEventListener("timeupdate", te), a().addEventListener("ended", se), a().addEventListener("pause", C), ie()), () => {
88
+ de(), e.detachMedia(), e.off(r.Events.MEDIA_ATTACHED, () => D(r, e)), e.off(r.Events.FRAG_BUFFERED, () => S(e)), e.off(r.Events.FRAG_CHANGED, (t, d) => I(e, d, s)), e.off(r.Events.FRAG_PARSED, (t, d) => V(e, d, s)), e.off(r.Events.ERROR, (t, d) => F(d)), e.off(r.Events.MANIFEST_PARSED, () => re(e)), document.removeEventListener("visibilitychange", H);
89
+ };
90
+ }, [u.stream_link]), E(() => {
91
+ n < G && h(m.isEnded) && f(oe(!1));
92
+ }, [n]), E(() => {
93
+ h(m.hasPlayStatusParams) && (l.playStatus ? a().play() : a().pause());
94
+ }, [l.playStatus]), pe(i), fe(), he(), /* @__PURE__ */ L(B, { children: /* @__PURE__ */ Q(
95
+ "video",
96
+ {
97
+ poster: l.banner ? l.banner : u.banner,
98
+ preload: "metadata",
99
+ crossOrigin: "anonymous",
100
+ id: "player-tag",
101
+ playsInline: !0,
102
+ className: "pl-h-full pl-flex-1 pl-items-center",
103
+ style: {
104
+ width: "100%",
105
+ height: "100%",
106
+ maxWidth: o.width ? o.width : "100%",
107
+ maxHeight: o.width ? o.width < o.height ? o.width * 9 / 16 : o.width * 16 / 9 : "100%"
108
+ },
109
+ autoPlay: h(m.hasAutoPlay),
110
+ children: [
111
+ /* @__PURE__ */ L(
112
+ "img",
113
+ {
114
+ onLoad: () => T.current = Date.now(),
115
+ src: l.banner ? l.banner : u.banner,
116
+ alt: l.bannerAlt ? l.bannerAlt : h(m.isStaticFormat) ? "بنر ویدیو پلیر کافه ویدیو" : u.title,
117
+ className: "pl-size-full"
118
+ }
119
+ ),
120
+ h(m.hasSubtitlesInDetails) && le(u.subtitles).map((e) => /* @__PURE__ */ L(
121
+ "track",
122
+ {
123
+ id: `player-tracker-${e.lang}`,
124
+ src: e.url,
125
+ label: ue(e.lang),
126
+ kind: "subtitles",
127
+ srcLang: e.lang
128
+ },
129
+ e.id
130
+ ))
131
+ ]
132
+ }
133
+ ) });
134
+ };
135
+ export {
136
+ Te as default
137
+ };
@@ -0,0 +1,10 @@
1
+ import { jsxs as e, jsx as l } from "react/jsx-runtime";
2
+ import { I as t } from "./index-2OVdYUgm.js";
3
+ const c = () => /* @__PURE__ */ e("div", { className: "pl-flex pl-h-full pl-w-full pl-flex-col pl-items-center pl-justify-center pl-rounded-2xl", children: [
4
+ /* @__PURE__ */ l("div", { className: "pl-flex pl-justify-center", children: /* @__PURE__ */ l("img", { src: t.notFound, alt: "", width: 120, height: 70 }) }),
5
+ /* @__PURE__ */ l("h1", { className: "pl-mb-2 pl-mt-4 pl-text-[12px] pl-font-medium pl-text-black/[0.87]", children: "ویدیویی برای نمایش وجود نداره" }),
6
+ /* @__PURE__ */ l("p", { className: "pl-text-[12px] pl-font-medium pl-text-black/[0.50]", children: "می‌تونید ویدیوهای مشابه با اون رو مشاهده کنید." })
7
+ ] });
8
+ export {
9
+ c as default
10
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { c as o, C as r } from "./index-2OVdYUgm.js";
3
+ import { V as i } from "./videoArea-B8winUaa.js";
4
+ const a = () => /* @__PURE__ */ e(
5
+ "div",
6
+ {
7
+ className: `pl-h-full pl-w-full desktop:pl-aspect-video ${!o(r.isTouchScreen) && !o(r.isFullScreen) && "!pl-rounded-[12px]"}`,
8
+ children: /* @__PURE__ */ e(i, {})
9
+ }
10
+ );
11
+ export {
12
+ a as default
13
+ };
@@ -0,0 +1,57 @@
1
+ import { jsxs as h, jsx as u } from "react/jsx-runtime";
2
+ import { useRef as n, useEffect as m } from "react";
3
+ import { a as y, u as p, s as f, j as P, c as t, C as i, k as S, l as V, n as b, o as w, p as L, q as v, r as D, t as E, w as R, m as T, x as C } from "./index-2OVdYUgm.js";
4
+ import { u as x, a as A } from "./useHideSubtitle-xaoPFO2J.js";
5
+ const q = () => {
6
+ const g = y(), { params: e } = p(({ videoData: { params: a } }) => ({ params: a }), f);
7
+ p(({ controller: { firstPlay: a } }) => ({ firstPlay: a }), f);
8
+ const s = n(0), r = n(0), o = n(null), l = n(null);
9
+ return m(() => {
10
+ P(s), r.current = Date.now();
11
+ }, []), m(() => {
12
+ const a = () => {
13
+ var c;
14
+ const d = (c = T()) == null ? void 0 : c.getBoundingClientRect();
15
+ d && g(C(d));
16
+ };
17
+ return t(i.isFirstPlay) && a(), window.addEventListener("resize", a), () => {
18
+ window.removeEventListener("resize", a), clearInterval(l.current);
19
+ };
20
+ }, [e.id]), x(), A(), /* @__PURE__ */ h(
21
+ "video",
22
+ {
23
+ poster: e.banner ? e.banner : void 0,
24
+ preload: "metadata",
25
+ autoPlay: t(i.hasAutoPlay),
26
+ id: "player-tag",
27
+ crossOrigin: "anonymous",
28
+ className: "pl-h-full pl-w-full pl-flex-1 pl-items-center",
29
+ onCanPlay: S,
30
+ onPause: V,
31
+ onPlay: (a) => b(a, o),
32
+ onPlaying: () => w(s, r, o),
33
+ onTimeUpdate: L,
34
+ onLoadedData: (a) => v(a, l),
35
+ onError: D,
36
+ playsInline: !0,
37
+ "aria-label": e.bannerAlt ? e.bannerAlt : "بنر ویدیو پلیر کافه ویدیو",
38
+ children: [
39
+ /* @__PURE__ */ u("source", { src: e.id }),
40
+ t(i.hasSubtitlesInParams) && E(e.subtitles).map((a) => /* @__PURE__ */ u(
41
+ "track",
42
+ {
43
+ id: `player-tracker-${a.lang}`,
44
+ src: a.url,
45
+ label: R(a.lang),
46
+ kind: "subtitles",
47
+ srcLang: a.lang
48
+ },
49
+ a.id
50
+ ))
51
+ ]
52
+ }
53
+ );
54
+ };
55
+ export {
56
+ q as default
57
+ };
@@ -0,0 +1,131 @@
1
+ import { jsx as l, jsxs as p, Fragment as C } from "react/jsx-runtime";
2
+ import { useState as j, useRef as b, useEffect as x } from "react";
3
+ import { a as H, u as T, s as V, I as P, c as N, C as L, b as E, d as w, e as M, f as B, v as z, h as R, i as m, m as k } from "./index-2OVdYUgm.js";
4
+ const A = ({ className: s, onClick: i }) => /* @__PURE__ */ l(
5
+ "svg",
6
+ {
7
+ width: "20",
8
+ height: "20",
9
+ viewBox: "0 0 20 20",
10
+ fill: "none",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ className: s,
13
+ onClick: i,
14
+ children: /* @__PURE__ */ p("g", { opacity: "0.7", children: [
15
+ /* @__PURE__ */ l("path", { d: "M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z" }),
16
+ /* @__PURE__ */ l("path", { d: "M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z" })
17
+ ] })
18
+ }
19
+ ), $ = ({ className: s, onClick: i }) => /* @__PURE__ */ l(
20
+ "svg",
21
+ {
22
+ width: "13",
23
+ height: "16",
24
+ viewBox: "0 0 13 16",
25
+ fill: "none",
26
+ xmlns: "http://www.w3.org/2000/svg",
27
+ className: s,
28
+ onClick: i,
29
+ children: /* @__PURE__ */ l("path", { d: "M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z" })
30
+ }
31
+ ), I = () => {
32
+ const [s, i] = j(""), a = H(), { settings: t } = T(({ user: { settings: r } }) => ({ settings: r }), V), g = b(t.brightness), d = b(t.volume), f = b(s);
33
+ x(() => {
34
+ f.current = s;
35
+ }, [s]), x(() => {
36
+ let r = 0;
37
+ const o = (e) => {
38
+ N(L.hidePopovers) && !E(e, "progress-area") && (r = e.touches[0].clientY);
39
+ }, c = (e) => {
40
+ N(L.hidePopovers) && !E(e, "progress-area") && (e.stopPropagation(), e.touches[0].clientX > window.innerWidth / 2 ? y(e, "volume", r, window.innerHeight) : e.touches[0].clientX < window.innerWidth / 2 && y(e, "brightness", r, window.innerHeight));
41
+ }, u = () => {
42
+ const { settings: e } = w.getState().user;
43
+ f.current === "brightness" && g.current !== e.brightness ? (M(B(g.current, e.brightness)), g.current = e.brightness) : f.current === "volume" && d.current !== e.volume && (M(z(d.current, e.volume)), d.current = e.volume), setTimeout(() => i(""), 500);
44
+ };
45
+ return document.addEventListener("touchstart", (e) => o(e)), document.addEventListener("touchmove", (e) => c(e)), document.addEventListener("touchend", () => u()), () => {
46
+ document.removeEventListener("touchstart", (e) => o(e)), document.removeEventListener("touchmove", (e) => c(e)), document.removeEventListener("touchend", () => u());
47
+ };
48
+ }, []), x(() => {
49
+ t.volume === 0 && !s && (d.current = 0);
50
+ }, [t.volume]);
51
+ const y = (r, o, c, u) => {
52
+ const { settings: e } = w.getState().user, { activePointerProgressBar: S } = w.getState().controller;
53
+ try {
54
+ S || a(R(!1)), r.stopPropagation(), i(o);
55
+ const { height: v } = document.getElementsByClassName("pl-bar")[0].getBoundingClientRect();
56
+ if (o === "volume") {
57
+ const n = e.volume + (c - r.touches[0].clientY) / 40 * v / u;
58
+ let h;
59
+ n > 100 ? h = 100 : n < 0 ? h = 0 : h = Math.ceil(Math.abs(n)), a(m({ ...e, volume: h })), k().volume = h / 100;
60
+ } else if (o === "brightness") {
61
+ const n = e.brightness + (c - r.touches[0].clientY) / 40 * v / u;
62
+ n > 100 ? a(m({ ...e, brightness: 100 })) : n < 0 ? a(m({ ...e, brightness: 0 })) : a(m({ ...e, brightness: Math.ceil(Math.abs(n)) }));
63
+ }
64
+ } catch {
65
+ return !1;
66
+ }
67
+ };
68
+ return /* @__PURE__ */ p("div", { id: "volume-brightness", children: [
69
+ /* @__PURE__ */ l(
70
+ "div",
71
+ {
72
+ className: "pl-fixed pl-right-0 pl-top-0 pl-h-screen pl-w-screen pl-bg-black",
73
+ style: { opacity: t.brightness < 10 ? 0.9 : 1 - t.brightness / 100 }
74
+ }
75
+ ),
76
+ /* @__PURE__ */ p("div", { className: "pl-absolute pl-right-0 pl-top-0 pl-flex pl-h-full pl-w-full pl-items-center pl-justify-between", children: [
77
+ /* @__PURE__ */ l("div", { className: "pl-flex pl-h-full pl-flex-1 pl-items-center pl-pr-6", children: /* @__PURE__ */ l(
78
+ "div",
79
+ {
80
+ id: "volume-progressbar",
81
+ className: `pl-bar pl-relative pl-h-[200px] pl-w-6 ${s === "volume" && "pl-bg-gray-300"} pl-flex pl-max-h-[80vh] pl-items-end pl-justify-end pl-overflow-hidden pl-rounded-[50px]`,
82
+ children: s === "volume" && /* @__PURE__ */ p(C, { children: [
83
+ /* @__PURE__ */ l(
84
+ "div",
85
+ {
86
+ className: "pl-absolute pl-w-full pl-rounded-b-[50px] pl-bg-secondary-600",
87
+ style: { height: `${t.volume}%` }
88
+ }
89
+ ),
90
+ /* @__PURE__ */ p("div", { className: "pl-mb-[7px] pl-ml-0.5 pl-flex pl-items-center pl-gap-1", children: [
91
+ /* @__PURE__ */ p("div", { className: "pl-relative pl-flex pl-items-center", children: [
92
+ t.volume > 0 && /* @__PURE__ */ l("div", { className: "pl-absolute pl-right-[2px] pl-flex pl-h-2 pl-w-2 pl-items-center pl-justify-center pl-rounded-full pl-border-2 pl-border-r-2 pl-border-transparent pl-border-r-z-yellow-light" }),
93
+ t.volume > 33 && /* @__PURE__ */ l("div", { className: "pl-absolute pl-right-[-1px] pl-flex pl-h-3 pl-w-3 pl-items-center pl-justify-center pl-rounded-full pl-border-2 pl-border-r-2 pl-border-transparent pl-border-r-z-yellow-light" }),
94
+ t.volume > 66 && /* @__PURE__ */ l("div", { className: "pl-absolute pl-right-[-4px] pl-flex pl-h-4 pl-w-4 pl-items-center pl-justify-center pl-rounded-full pl-border-2 pl-border-r-2 pl-border-transparent pl-border-r-z-yellow-light" })
95
+ ] }),
96
+ t.volume === 0 ? /* @__PURE__ */ l(A, { className: "pl-z-[1] pl-h-[13px] pl-w-[13px] pl-fill-dark-7" }) : /* @__PURE__ */ l($, { className: "pl-z-[1] pl-h-[13px] pl-w-[13px] pl-fill-dark-7" })
97
+ ] })
98
+ ] })
99
+ }
100
+ ) }),
101
+ s && /* @__PURE__ */ l("div", { className: "pl-flex pl-h-[54px] pl-w-[54px] pl-items-center pl-justify-center pl-rounded-full pl-bg-secondary-700/[0.8] pl-text-[32px] pl-font-normal pl-text-white", children: s === "volume" ? t.volume : t.brightness }),
102
+ /* @__PURE__ */ l("div", { className: "pl-flex pl-h-full pl-flex-1 pl-items-center pl-justify-end pl-pl-6", children: /* @__PURE__ */ l(
103
+ "div",
104
+ {
105
+ id: "brightness-progressbar",
106
+ className: `pl-bar pl-relative pl-h-[200px] pl-w-6 ${s === "brightness" && "pl-bg-gray-300"} pl-flex pl-max-h-[80vh] pl-items-end pl-justify-end pl-overflow-hidden pl-rounded-[50px]`,
107
+ children: s === "brightness" && /* @__PURE__ */ p(C, { children: [
108
+ /* @__PURE__ */ l(
109
+ "div",
110
+ {
111
+ className: "pl-absolute pl-w-full pl-rounded-b-[50px] pl-bg-primary-600",
112
+ style: { height: `${t.brightness}%` }
113
+ }
114
+ ),
115
+ /* @__PURE__ */ l(
116
+ "div",
117
+ {
118
+ className: "pl-mb-[7px] pl-ml-0.5 pl-flex pl-items-center pl-gap-1",
119
+ style: { opacity: t.brightness / 100 },
120
+ children: /* @__PURE__ */ l("img", { alt: "", src: P.sun, className: "pl-size-5 pl-flex-1" })
121
+ }
122
+ )
123
+ ] })
124
+ }
125
+ ) })
126
+ ] })
127
+ ] });
128
+ };
129
+ export {
130
+ I as default
131
+ };
@@ -0,0 +1,29 @@
1
+ import { useEffect as r } from "react";
2
+ import { a as l, u as c, s as o, c as d, C as p, m as u, a0 as T } from "./index-2OVdYUgm.js";
3
+ const y = () => {
4
+ const a = l(), { params: e } = c(({ videoData: { params: t } }) => ({ params: t }), o);
5
+ r(() => {
6
+ d(p.hasCurrentTimeParams) && (u().currentTime = e.currentTime, a(T(e.currentTime)));
7
+ }, [e.currentTime]);
8
+ }, C = () => {
9
+ const { details: a } = c(({ videoData: { details: e } }) => ({ details: e }), o);
10
+ r(() => {
11
+ const e = u().getElementsByTagName("track");
12
+ for (let t = 0; t < e.length; t++)
13
+ e[t].addEventListener("cuechange", (m) => {
14
+ const n = m.target.track;
15
+ let i;
16
+ n.activeCues && (i = n.activeCues[0]), i && (setTimeout(() => {
17
+ const s = document.getElementById("subtitle-id");
18
+ s && (s.style.display = "block");
19
+ }, 300), i.onexit = () => {
20
+ const s = document.getElementById("subtitle-id");
21
+ s && (s.style.display = "none");
22
+ });
23
+ });
24
+ }, [a.subtitles]);
25
+ };
26
+ export {
27
+ y as a,
28
+ C as u
29
+ };
@@ -0,0 +1,29 @@
1
+ import { d as n, $ as l, m as s } from "./index-2OVdYUgm.js";
2
+ const v = () => {
3
+ const { params: a } = n.getState().videoData, o = s().currentTime;
4
+ if (o !== 0) {
5
+ const d = s().duration, i = {
6
+ video_id: +a.id,
7
+ video_type: 2,
8
+ time: o === d ? 0 : Math.floor(s().currentTime)
9
+ };
10
+ let t = localStorage.getItem("viewedVideos");
11
+ if (t) {
12
+ let e = JSON.parse(t);
13
+ e = e.filter(
14
+ (r) => r.video_id !== i.video_id || r.video_type !== i.video_type
15
+ ), e.length < 10 || e.shift(), e.push(i), localStorage.setItem("viewedVideos", JSON.stringify(e));
16
+ } else localStorage.setItem("viewedVideos", JSON.stringify([i]));
17
+ }
18
+ }, m = () => {
19
+ const a = n.dispatch, { params: o } = n.getState().videoData;
20
+ let d = localStorage.getItem("viewedVideos");
21
+ if (d) {
22
+ const t = JSON.parse(d).find((e) => e.video_id === Number(o.id) && e.video_type === 2);
23
+ t && a(l({ time: t.time }));
24
+ }
25
+ };
26
+ export {
27
+ v as a,
28
+ m as h
29
+ };