cafe-video-player 1.9.3 → 2.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 (126) hide show
  1. package/README.md +16 -21
  2. package/backwardForward-AWKGZCVB.js +13 -0
  3. package/backwardForward-LEAH3F4W.mjs +7 -0
  4. package/chunk-3SYQZL76.mjs +9 -0
  5. package/chunk-3SYQZL76.mjs.map +1 -0
  6. package/chunk-3ZHYUTMI.mjs +8 -0
  7. package/chunk-3ZHYUTMI.mjs.map +1 -0
  8. package/chunk-63ZUB4L2.mjs +25 -0
  9. package/chunk-63ZUB4L2.mjs.map +1 -0
  10. package/chunk-6567FIPA.mjs +7 -0
  11. package/{chunk-PPTHLXJQ.mjs.map → chunk-6567FIPA.mjs.map} +1 -1
  12. package/{chunk-YB4NYTRZ.mjs → chunk-6R7UYUPZ.mjs} +2 -2
  13. package/{chunk-YB4NYTRZ.mjs.map → chunk-6R7UYUPZ.mjs.map} +1 -1
  14. package/chunk-7T6VLIGJ.js +93 -0
  15. package/chunk-7T6VLIGJ.js.map +1 -0
  16. package/chunk-AHMSFS2W.js +32 -0
  17. package/chunk-AHMSFS2W.js.map +1 -0
  18. package/chunk-CVWCBKBR.mjs +9 -0
  19. package/chunk-CVWCBKBR.mjs.map +1 -0
  20. package/{chunk-7LB4RAGD.js → chunk-ESB3FO2C.js} +2 -2
  21. package/{chunk-7LB4RAGD.js.map → chunk-ESB3FO2C.js.map} +1 -1
  22. package/chunk-FONLDNI3.js +16 -0
  23. package/chunk-FONLDNI3.js.map +1 -0
  24. package/{chunk-CY73TBOJ.mjs → chunk-G3NY7MF6.mjs} +3 -3
  25. package/chunk-G3NY7MF6.mjs.map +1 -0
  26. package/chunk-JQ2JCAJT.mjs +10 -0
  27. package/chunk-JQ2JCAJT.mjs.map +1 -0
  28. package/chunk-MIEFZ2ZI.js +39 -0
  29. package/chunk-MIEFZ2ZI.js.map +1 -0
  30. package/chunk-MJGU6VON.js +9 -0
  31. package/{chunk-U23ZPGF2.js.map → chunk-MJGU6VON.js.map} +1 -1
  32. package/chunk-OMANHRIL.mjs +15 -0
  33. package/chunk-OMANHRIL.mjs.map +1 -0
  34. package/chunk-UQTAWRFP.js +19 -0
  35. package/chunk-UQTAWRFP.js.map +1 -0
  36. package/chunk-XTHPP5LC.js +11 -0
  37. package/chunk-XTHPP5LC.js.map +1 -0
  38. package/chunk-Y4BSLEZW.js +21 -0
  39. package/chunk-Y4BSLEZW.js.map +1 -0
  40. package/index.d.mts +15 -6
  41. package/index.d.ts +15 -6
  42. package/index.js +14 -7
  43. package/index.js.map +1 -1
  44. package/index.mjs +11 -7
  45. package/index.mjs.map +1 -1
  46. package/nonStaticVideoTag-2NVH2HVY.mjs +17 -0
  47. package/nonStaticVideoTag-2NVH2HVY.mjs.map +1 -0
  48. package/nonStaticVideoTag-FNVTSWAG.js +24 -0
  49. package/nonStaticVideoTag-FNVTSWAG.js.map +1 -0
  50. package/{notActive-E4FZWQIO.js → notActive-BG25OOWC.js} +3 -3
  51. package/{notActive-2FUSVSVU.mjs → notActive-WY6YNT3Y.mjs} +2 -2
  52. package/package.json +1 -1
  53. package/staticPlayer-ELMNNMQP.mjs +15 -0
  54. package/staticPlayer-TZ5TWO3F.js +17 -0
  55. package/staticVideoTag-IGHEAXZI.mjs +13 -0
  56. package/staticVideoTag-IGHEAXZI.mjs.map +1 -0
  57. package/staticVideoTag-Q7RHS35J.js +15 -0
  58. package/staticVideoTag-Q7RHS35J.js.map +1 -0
  59. package/touchVolumeBrightness-3FDHY2VA.js +19 -0
  60. package/touchVolumeBrightness-3FDHY2VA.js.map +1 -0
  61. package/touchVolumeBrightness-G7XRXNO5.mjs +13 -0
  62. package/touchVolumeBrightness-G7XRXNO5.mjs.map +1 -0
  63. package/videoArea-PBDGG7DD.js +16 -0
  64. package/videoArea-WLM5F2PO.mjs +10 -0
  65. package/videoPlayerStyles.css +68 -78
  66. package/vodPlayer-7DLOCIQD.js +20 -0
  67. package/{vodPlayer-SEMZ24S5.js.map → vodPlayer-7DLOCIQD.js.map} +1 -1
  68. package/vodPlayer-IRVHRBRB.mjs +14 -0
  69. package/{vodPlayer-MS5JE3BW.mjs.map → vodPlayer-IRVHRBRB.mjs.map} +1 -1
  70. package/backwardForward-OQJYFAQ4.mjs +0 -7
  71. package/backwardForward-P3P4S2ZE.js +0 -13
  72. package/chunk-BJ4CIJKZ.js +0 -90
  73. package/chunk-BJ4CIJKZ.js.map +0 -1
  74. package/chunk-CD4S6LOS.mjs +0 -25
  75. package/chunk-CD4S6LOS.mjs.map +0 -1
  76. package/chunk-CY73TBOJ.mjs.map +0 -1
  77. package/chunk-K2JG5NRS.js +0 -21
  78. package/chunk-K2JG5NRS.js.map +0 -1
  79. package/chunk-KCRYSZI6.mjs +0 -9
  80. package/chunk-KCRYSZI6.mjs.map +0 -1
  81. package/chunk-LJQ3BDPD.js +0 -16
  82. package/chunk-LJQ3BDPD.js.map +0 -1
  83. package/chunk-PEF62RSW.mjs +0 -8
  84. package/chunk-PEF62RSW.mjs.map +0 -1
  85. package/chunk-PPTHLXJQ.mjs +0 -7
  86. package/chunk-U23ZPGF2.js +0 -9
  87. package/chunk-U6HUFFUL.js +0 -18
  88. package/chunk-U6HUFFUL.js.map +0 -1
  89. package/chunk-VS776N6J.js +0 -37
  90. package/chunk-VS776N6J.js.map +0 -1
  91. package/chunk-YFRV5WUB.js +0 -32
  92. package/chunk-YFRV5WUB.js.map +0 -1
  93. package/chunk-YRJREWER.mjs +0 -15
  94. package/chunk-YRJREWER.mjs.map +0 -1
  95. package/chunk-YZ2YUV52.mjs +0 -10
  96. package/chunk-YZ2YUV52.mjs.map +0 -1
  97. package/chunk-Z6CUWQ7X.js +0 -11
  98. package/chunk-Z6CUWQ7X.js.map +0 -1
  99. package/chunk-ZTYAF43J.mjs +0 -9
  100. package/chunk-ZTYAF43J.mjs.map +0 -1
  101. package/nonStaticVideoTag-4OYOWQ3M.mjs +0 -17
  102. package/nonStaticVideoTag-4OYOWQ3M.mjs.map +0 -1
  103. package/nonStaticVideoTag-P7COB6D5.js +0 -24
  104. package/nonStaticVideoTag-P7COB6D5.js.map +0 -1
  105. package/staticPlayer-DBAIYNIA.mjs +0 -15
  106. package/staticPlayer-PV2MOOKA.js +0 -17
  107. package/staticVideoTag-NB2AHKU5.js +0 -15
  108. package/staticVideoTag-NB2AHKU5.js.map +0 -1
  109. package/staticVideoTag-U4XWSEQE.mjs +0 -13
  110. package/staticVideoTag-U4XWSEQE.mjs.map +0 -1
  111. package/touchVolumeBrightness-S4HPNA43.js +0 -19
  112. package/touchVolumeBrightness-S4HPNA43.js.map +0 -1
  113. package/touchVolumeBrightness-S7DYCEN7.mjs +0 -13
  114. package/touchVolumeBrightness-S7DYCEN7.mjs.map +0 -1
  115. package/videoArea-GHJPTFBO.mjs +0 -10
  116. package/videoArea-SQJHDXVX.js +0 -16
  117. package/vodPlayer-MS5JE3BW.mjs +0 -14
  118. package/vodPlayer-SEMZ24S5.js +0 -20
  119. /package/{backwardForward-OQJYFAQ4.mjs.map → backwardForward-AWKGZCVB.js.map} +0 -0
  120. /package/{backwardForward-P3P4S2ZE.js.map → backwardForward-LEAH3F4W.mjs.map} +0 -0
  121. /package/{notActive-E4FZWQIO.js.map → notActive-BG25OOWC.js.map} +0 -0
  122. /package/{notActive-2FUSVSVU.mjs.map → notActive-WY6YNT3Y.mjs.map} +0 -0
  123. /package/{staticPlayer-DBAIYNIA.mjs.map → staticPlayer-ELMNNMQP.mjs.map} +0 -0
  124. /package/{staticPlayer-PV2MOOKA.js.map → staticPlayer-TZ5TWO3F.js.map} +0 -0
  125. /package/{videoArea-GHJPTFBO.mjs.map → videoArea-PBDGG7DD.js.map} +0 -0
  126. /package/{videoArea-SQJHDXVX.js.map → videoArea-WLM5F2PO.mjs.map} +0 -0
package/README.md CHANGED
@@ -14,14 +14,13 @@ $ yarn add cafe-video-player
14
14
  ✔ To play vod, follow the example below:
15
15
 
16
16
  ```jsx
17
- import dynamic from "next/dynamic";
18
- const VideoPlayerLibrary = dynamic(() => import("cafe-video-player"), { ssr: false })
17
+ import {VideoPlayerLibrary} from "cafe-video-player";
19
18
 
20
19
  export default function HomePage() {
21
20
 
22
21
  const params = {
23
- id: "6623",
24
- type: "vod"
22
+ type: "vod",
23
+ id: "6623"
25
24
  }
26
25
 
27
26
  return (
@@ -36,20 +35,19 @@ export default function HomePage() {
36
35
  ## Example
37
36
 
38
37
  ✔ To play static videos, follow the example below:
39
- - e-url corresponds to the video link, which must be base64 format
40
- - e-cover corresponds to the cover link, which must be base64 format
38
+ - id corresponds to the video link, which must be base64 format
39
+ - banner corresponds to the cover link, which must be base64 format
41
40
 
42
41
  ```jsx
43
42
 
44
- import dynamic from "next/dynamic";
45
- const VideoPlayerLibrary = dynamic(() => import("cafe-video-player"), { ssr: false })
43
+ import {VideoPlayerLibrary} from "cafe-video-player";
46
44
 
47
45
  export default function HomePage() {
48
46
 
49
47
  const params = {
50
- type: "mp4",
51
- "e-url": "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
52
- "e-cover":"aHR0cHM6Ly9zdGF0aWMudmVjdGVlenkuY29tL3N5c3RlbS9yZXNvdXJjZXMvdGh1bWJuYWlscy8wMjUvMDY3Lzc2Mi9zbWFsbC80ay1iZWF1dGlmdWwtY29sb3JmdWwtYWJzdHJhY3Qtd2FsbHBhcGVyLXBob3RvLmpwZw=="
48
+ type: "static",
49
+ id: "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
50
+ banner: "aHR0cHM6Ly9zdGF0aWMudmVjdGVlenkuY29tL3N5c3RlbS9yZXNvdXJjZXMvdGh1bWJuYWlscy8wMjUvMDY3Lzc2Mi9zbWFsbC80ay1iZWF1dGlmdWwtY29sb3JmdWwtYWJzdHJhY3Qtd2FsbHBhcGVyLXBob3RvLmpwZw=="
53
51
  }
54
52
 
55
53
  return (
@@ -64,25 +62,23 @@ export default function HomePage() {
64
62
 
65
63
  ## Example
66
64
 
67
- ✔ To use the mini-player feature, you must first give an id to the element on which the scroll happens, for example, the body element, and then send this id to the player through props, according to the example below.
65
+ ✔ To use the mini-player feature, follow the example below:
68
66
 
69
67
  ```jsx
70
68
 
71
- import dynamic from "next/dynamic";
72
- const VideoPlayerLibrary = dynamic(() => import("cafe-video-player"), { ssr: false })
69
+ import {MiniPlayerLibrary} from "cafe-video-player";
73
70
 
74
71
  export default function HomePage() {
75
72
 
76
73
  const params = {
77
- type: "mp4",
78
- "e-url": "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
79
- "e-cover": "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEvP3RodW1iPXRydWU=",
80
- scrollElementId: "element-scroll-id"
74
+ type: "vod",
75
+ id: "6623",
76
+ onClose: () => {}
81
77
  }
82
78
 
83
79
  return (
84
80
  <div>
85
- <VideoPlayerLibrary params={params} />
81
+ <MiniPlayerLibrary params={params} />
86
82
  </div>
87
83
  );
88
84
  }
@@ -95,8 +91,7 @@ export default function HomePage() {
95
91
 
96
92
  ```jsx
97
93
 
98
- import dynamic from "next/dynamic";
99
- const VideoPlayerLibrary = dynamic(() => import("cafe-video-player"), { ssr: false })
94
+ import {VideoPlayerLibrary} from "cafe-video-player";
100
95
 
101
96
  export default function HomePage() {
102
97
 
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var chunkY4BSLEZW_js = require('./chunk-Y4BSLEZW.js');
4
+ require('./chunk-UQTAWRFP.js');
5
+ require('./chunk-7T6VLIGJ.js');
6
+ require('./chunk-MJGU6VON.js');
7
+ require('./chunk-SPUHJYDE.js');
8
+
9
+
10
+
11
+ module.exports = chunkY4BSLEZW_js.a;
12
+ //# sourceMappingURL=out.js.map
13
+ //# sourceMappingURL=backwardForward-AWKGZCVB.js.map
@@ -0,0 +1,7 @@
1
+ export { a as default } from './chunk-OMANHRIL.mjs';
2
+ import './chunk-3ZHYUTMI.mjs';
3
+ import './chunk-JQ2JCAJT.mjs';
4
+ import './chunk-6567FIPA.mjs';
5
+ import './chunk-DBPGS72Q.mjs';
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=backwardForward-LEAH3F4W.mjs.map
@@ -0,0 +1,9 @@
1
+ import { L, ga, T as T$1, V, I as I$1, u, v as v$1, r, P as P$1, ca, A as A$1, xa, wa, ha, M } from './chunk-JQ2JCAJT.mjs';
2
+ import { e } from './chunk-DBPGS72Q.mjs';
3
+ import P from 'axios';
4
+
5
+ e();e();var v=t=>{let{params:e}=L.getState().videoData;return ha().vod.getVodUrl+(t||e.id)},s={url:"",maxRetryCount:0,headers:{},retryPolicy:[],errorCallback:void 0},I=t=>(s.url=v(t),s.maxRetryCount=3,s.retryPolicy=[{codeAbove:500,codeBelow:null,excludeCodes:[],includeCodes:[409],delay:1,count:3},{codeAbove:null,codeBelow:404,excludeCodes:[403,402,401,400],includeCodes:[],delay:10,count:6}],s),D=t=>(I(t),s);var A=t=>ga({url:ha().viewCount(t),data:{uuid:M()}}),G=async t=>{let e=L.dispatch;try{let o=await ga({...D(t)});if(T$1(o.status)){if(await P.head("https://"+V(o.data.hls_links)+o.data.path),t)return e(I$1(o.data));A(o.data.content_id),T(o.data);}else throw new Error(JSON.stringify({status:o.status,message:o.data}))}catch{e(u(!0)),e(v$1(!1));}},T=t=>{let e=L.dispatch;e(r({...t,stream_link:!!t.stream_link&&P$1("https://"+V(t.hls_links)+t.path)})),e(u(!0)),e(v$1(!0));},H=()=>{let t=L.dispatch,{subtitles:e,selectedSubtitle:o}=L.getState().videoData,i=e.find(u=>u.language==="fa");o?(Object.values(ca().textTracks).find(u=>u.mode==="showing").mode="disabled",t(A$1(void 0)),xa(wa("empty"))):i?(i.mode="showing",t(A$1(i)),xa(wa(i.language))):(ca().textTracks[0].mode="showing",t(A$1(ca().textTracks[0])),xa(wa(ca().textTracks[0].language)));};
6
+
7
+ export { G as a, H as b };
8
+ //# sourceMappingURL=out.js.map
9
+ //# sourceMappingURL=chunk-3SYQZL76.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts","../src/videoPlayerLibrary/helpers/getDetailsConfigs.ts"],"names":["init_esm_shims","axios","detailAPI","id","params","store_default","API","detailsConfig","vodDetailsConfig","videoId","handleDetailsConfig","videoViewCount","contentId","apiCaller","getUUID","getVodDetails","dispatch","d","responseValidator","weighted_random","setDetailsMiniPlayer","detailSetter","setIsFetchDetails","setIsValidAddress","data","setInfo","addUuidToSrc","handleSubtitle","subtitles","selectedSubtitle","faSubtitle","subtitle","mainPlayerVideoTag","textTrack","setSelectedSubtitle","sendFluentLog","subtitleLog"],"mappings":"yLAAAA,IAUA,OAAOC,MAAW,QCVlBD,IAIO,IAAME,EAAaC,GAAgB,CACtC,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAM,SAAS,EAAE,UACpC,OAAOC,EAAI,EAAE,IAAI,WAAaH,GAAUC,EAAO,GACnD,EAEMG,EAAgC,CAClC,IAAK,GACL,cAAe,EACf,QAAS,CAAC,EACV,YAAa,CAAC,EACd,cAAe,MACnB,EAEMC,EAAoBC,IACtBF,EAAc,IAAML,EAAUO,CAAO,EACrCF,EAAc,cAAgB,EAC9BA,EAAc,YAAc,CACxB,CACI,UAAW,IACX,UAAW,KACX,aAAc,CAAC,EACf,aAAc,CAAC,GAAG,EAClB,MAAO,EACP,MAAO,CACX,EACA,CACI,UAAW,KACX,UAAW,IACX,aAAc,CAAC,IAAK,IAAK,IAAK,GAAG,EACjC,aAAc,CAAC,EACf,MAAO,GACP,MAAO,CACX,CACJ,EACOA,GAIEG,EAAuBD,IAChCD,EAAiBC,CAAO,EACjBF,GD3BX,IAAMI,EAAkBC,GAAsBC,EAAU,CAAE,IAAKP,EAAI,EAAE,UAAUM,CAAS,EAAG,KAAM,CAAE,KAAME,EAAQ,CAAE,CAAE,CAAC,EAEzGC,EAAgB,MAAON,GAAoB,CACpD,IAAMO,EAAWX,EAAM,SACvB,GAAI,CACA,IAAMY,EAAI,MAAMJ,EAAU,CAAE,GAAGH,EAAoBD,CAAO,CAAE,CAAC,EAC7D,GAAIS,EAAkBD,EAAE,MAAM,EAAG,CAE7B,GADA,MAAMhB,EAAM,KAAK,WAAakB,EAAgBF,EAAE,KAAK,SAAS,EAAIA,EAAE,KAAK,IAAI,EACzER,EAAS,OAAOO,EAASI,EAAqBH,EAAE,IAAI,CAAC,EACzDN,EAAeM,EAAE,KAAK,UAAW,EACjCI,EAAaJ,EAAE,IAAI,CACvB,KAAO,OAAM,IAAI,MAAM,KAAK,UAAU,CAAE,OAAQA,EAAE,OAAQ,QAASA,EAAE,IAAK,CAAC,CAAC,CAChF,MAAqB,CACjBD,EAASM,EAAkB,EAAI,CAAC,EAChCN,EAASO,EAAkB,EAAK,CAAC,CACrC,CACJ,EAEaF,EAAgBG,GAAc,CACvC,IAAMR,EAAWX,EAAM,SACvBW,EACIS,EAAQ,CACJ,GAAGD,EACH,YAAa,CAAC,CAACA,EAAK,aAAeE,EAAa,WAAaP,EAAgBK,EAAK,SAAS,EAAIA,EAAK,IAAI,CAC5G,CAAC,CACL,EACAR,EAASM,EAAkB,EAAI,CAAC,EAChCN,EAASO,EAAkB,EAAI,CAAC,CACpC,EAEaI,EAAiB,IAAM,CAChC,IAAMX,EAAWX,EAAM,SACjB,CAAE,UAAAuB,EAAW,iBAAAC,CAAiB,EAAIxB,EAAM,SAAS,EAAE,UAEnDyB,EAAkBF,EAAU,KAAMG,GAAkBA,EAAS,WAAa,IAAI,EAChFF,GACA,OAAO,OAAOG,EAAmB,EAAE,UAAU,EAAE,KAAMC,GAAmBA,EAAU,OAAS,SAAS,EAAG,KAAO,WAC9GjB,EAASkB,EAAoB,MAAS,CAAC,EACvCC,EAAcC,EAAY,OAAO,CAAC,GAE9BN,GACAA,EAAW,KAAO,UAClBd,EAASkB,EAAoBJ,CAAU,CAAC,EACxCK,EAAcC,EAAYN,EAAW,QAAQ,CAAC,IAE9CE,EAAmB,EAAE,WAAW,CAAC,EAAE,KAAO,UAC1ChB,EAASkB,EAAoBF,EAAmB,EAAE,WAAW,CAAC,CAAC,CAAC,EAChEG,EAAcC,EAAYJ,EAAmB,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,EAGlF","sourcesContent":["import { apiCaller } from \"../../services/apiCaller\";\r\nimport { API } from \"../../services/services\";\r\nimport {\r\n setInfo,\r\n setIsFetchDetails,\r\n setIsValidAddress,\r\n setSelectedSubtitle,\r\n} from \"../slices/videoDataSlice\";\r\nimport store from \"../store\";\r\nimport { addUuidToSrc, getUUID, responseValidator, weighted_random } from \"../../helpers\";\r\nimport axios from \"axios\";\r\nimport { handleDetailsConfig } from \"../../getDetailsConfigs\";\r\nimport { subtitleLog } from \"../../logs/logs\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { mainPlayerVideoTag } from \"../../constants\";\r\nimport { setDetailsMiniPlayer } from \"../slices/miniPlayerSlice\";\r\n\r\nconst videoViewCount = (contentId: number) => apiCaller({ url: API().viewCount(contentId), data: { uuid: getUUID() } });\r\n\r\nexport const getVodDetails = async (videoId?:string) => {\r\n const dispatch = store.dispatch;\r\n try {\r\n const d = await apiCaller({ ...handleDetailsConfig(videoId) });\r\n if (responseValidator(d.status)) {\r\n await axios.head(\"https://\" + weighted_random(d.data.hls_links) + d.data.path);\r\n if (videoId) return dispatch(setDetailsMiniPlayer(d.data));\r\n videoViewCount(d.data.content_id!);\r\n detailSetter(d.data);\r\n } else throw new Error(JSON.stringify({ status: d.status, message: d.data }));\r\n } catch (error: any) {\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(false));\r\n }\r\n};\r\n\r\nexport const detailSetter = (data: any) => {\r\n const dispatch = store.dispatch;\r\n dispatch(\r\n setInfo({\r\n ...data,\r\n stream_link: !!data.stream_link && addUuidToSrc(\"https://\" + weighted_random(data.hls_links) + data.path)\r\n })\r\n );\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(true));\r\n};\r\n\r\nexport const handleSubtitle = () => {\r\n const dispatch = store.dispatch;\r\n const { subtitles, selectedSubtitle } = store.getState().videoData;\r\n\r\n const faSubtitle: any = subtitles.find((subtitle: any) => subtitle.language === \"fa\");\r\n if (selectedSubtitle) {\r\n Object.values(mainPlayerVideoTag().textTracks).find((textTrack: any) => textTrack.mode === \"showing\")!.mode = \"disabled\";\r\n dispatch(setSelectedSubtitle(undefined));\r\n sendFluentLog(subtitleLog(\"empty\"));\r\n } else {\r\n if (faSubtitle) {\r\n faSubtitle.mode = \"showing\";\r\n dispatch(setSelectedSubtitle(faSubtitle));\r\n sendFluentLog(subtitleLog(faSubtitle.language));\r\n } else {\r\n mainPlayerVideoTag().textTracks[0].mode = \"showing\";\r\n dispatch(setSelectedSubtitle(mainPlayerVideoTag().textTracks[0]));\r\n sendFluentLog(subtitleLog(mainPlayerVideoTag().textTracks[0].language));\r\n }\r\n }\r\n}; ","import { IDetailsConfig } from \"./interfaces/interfaces\";\r\nimport store from \"./redux/store\";\r\nimport { API } from \"./services/services\";\r\n\r\nexport const detailAPI = (id?: string) => {\r\n const { params } = store.getState().videoData;\r\n return API().vod.getVodUrl + (id ? id : params.id);\r\n};\r\n\r\nconst detailsConfig: IDetailsConfig = {\r\n url: \"\",\r\n maxRetryCount: 0,\r\n headers: {},\r\n retryPolicy: [],\r\n errorCallback: undefined\r\n};\r\n\r\nconst vodDetailsConfig = (videoId?:string) => {\r\n detailsConfig.url = detailAPI(videoId);\r\n detailsConfig.maxRetryCount = 3;\r\n detailsConfig.retryPolicy = [\r\n {\r\n codeAbove: 500,\r\n codeBelow: null,\r\n excludeCodes: [],\r\n includeCodes: [409],\r\n delay: 1,\r\n count: 3\r\n },\r\n {\r\n codeAbove: null,\r\n codeBelow: 404,\r\n excludeCodes: [403, 402, 401, 400],\r\n includeCodes: [],\r\n delay: 10,\r\n count: 6\r\n }\r\n ];\r\n return detailsConfig;\r\n};\r\n\r\n\r\nexport const handleDetailsConfig = (videoId?: string) => {\r\n vodDetailsConfig(videoId);\r\n return detailsConfig;\r\n};\r\n"]}
@@ -0,0 +1,8 @@
1
+ import { L, ca, a, da, J as J$1, F, $, xa, la, E, ma, h, o, pa, w as w$1, ga, ha, qa, t } from './chunk-JQ2JCAJT.mjs';
2
+ import { e } from './chunk-DBPGS72Q.mjs';
3
+
4
+ e();var G=e=>{if(e===null||e.target.nodeName!=="INPUT"){let t=L.dispatch;e!==null&&(e.stopPropagation(),e.preventDefault()),ca().paused?ca().play():ca().pause(),t(a(!ca().paused)),da()&&da().played&&(da().pause(),t(J$1(!1)));}},H=e=>{if(e===null||e.target.nodeName!=="INPUT"){let t=L.dispatch;da().paused?da().play():da().pause(),t(J$1(!da().paused)),ca()&&ca().played&&(ca().pause(),t(a(!1)));}};var J=e=>{let t=L.dispatch,{settings:a}=L.getState().user;t(F({...a,volume:e})),$("isIOS")?ca().muted=!ca().muted:ca().volume=e/100;},K=(e,t=15,a)=>{if(e==="touchBackward"?e="backward":e==="touchForward"&&(e="forward"),a&&a.target.nodeName==="INPUT"||e==="backward"&&ca().currentTime<15||e==="forward"&&ca().duration-ca().currentTime<15)return;xa(la(e));let n=0;e==="backward"?t===0?n=0:n=ca().currentTime-t:e==="forward"&&(t===ca().duration?n=t:n=ca().currentTime+t),ca().currentTime=n;},w=()=>{let e=L.dispatch,t=document.fullscreenElement;$("isIOS")?ca().webkitEnterFullScreen?(e(a(!1)),ca().webkitEnterFullScreen()):(e(E()),xa(ma("fullScreen"))):t?(e(h(!1)),document.exitFullscreen()):(e(E()),document.documentElement.requestFullscreen(),e(h(!0)),xa(ma("fullScreen")));},Q=()=>{$("isTouchScreen")&&!$("isIOS")&&($("isLandscape")&&!$("isFullScreen")?window.screen.orientation.lock("portrait"):window.screen.orientation.lock("landscape"));},W=e=>{let t=L.dispatch;t(o(e==="lock")),xa(pa(e)),e==="unlock"&&localStorage.setItem("unlock-click","true");},X=(e,t)=>{if($("isSendTimelineLog")){let a=L.dispatch,{videoTimelines:n}=L.getState().videoData,c=Math.floor(e),d=Math.floor(t);n.length===0?a(w$1([c>=ca().duration?d:c])):(n[0]<c&&ga({url:ha().videoTimelineLog,method:"post",data:qa(n[0],c)}),d&&d>=ca().duration?a(w$1([])):a(w$1([d])));}},Y=()=>{let e=L.dispatch,t$1=document.getElementById("video-area")?.getBoundingClientRect();t$1.height=t$1.width*9/16,t$1&&e(t(t$1));},Z=e=>{!$("isTouchScreen")&&e.target.nodeName!=="INPUT"&&w();};
5
+
6
+ export { G as a, H as b, J as c, K as d, w as e, Q as f, W as g, X as h, Y as i, Z as j };
7
+ //# sourceMappingURL=out.js.map
8
+ //# sourceMappingURL=chunk-3ZHYUTMI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/controller.actions.ts"],"names":["init_esm_shims","handlePlayPause","event","dispatch","store_default","mainPlayerVideoTag","setPlay","miniPlayerVideoTag","setPlayMiniPlayer","handlePlayerPauseMiniPlayer","handleChangeSoundVolume","volume","settings","setUserSettings","conditions","handleBackwardForward","type","forwardBackwardCount","sendFluentLog","backwardForwardLog","currentTime","handleFullScreen","isFullScreen","setClearPopoversSlice","fullscreenLog","setIsFullScreen","handleLockOrientation","handleLock","setLock","lockLog","handleVideoTimeline","currentTimeValue","movedTimeValue","videoTimelines","movedTime","setVideoTimelines","apiCaller","API","videoTimelineLog","handleVideoElementSizeInfo","element","setVideoElementSizeInfo","handleDoubleClick"],"mappings":"yNAAAA,IAcO,IAAMC,EAAmBC,GAAe,CAC3C,GAAIA,IAAU,MAAQA,EAAM,OAAO,WAAa,QAAS,CACrD,IAAMC,EAAWC,EAAM,SACnBF,IAAU,OACVA,EAAM,gBAAgB,EACtBA,EAAM,eAAe,GAEzBG,EAAmB,EAAE,OAASA,EAAmB,EAAE,KAAK,EAAIA,EAAmB,EAAE,MAAM,EACvFF,EAASG,EAAQ,CAACD,EAAmB,EAAE,MAAM,CAAC,EAC3CE,EAAmB,GAAKA,EAAmB,EAAE,SAC5CA,EAAmB,EAAE,MAAM,EAC3BJ,EAASK,EAAkB,EAAK,CAAC,EAEzC,CACJ,EAEaC,EAA+BP,GAAc,CACtD,GAAIA,IAAU,MAAQA,EAAM,OAAO,WAAa,QAAS,CACrD,IAAMC,EAAWC,EAAM,SACvBG,EAAmB,EAAE,OAASA,EAAmB,EAAE,KAAK,EAAIA,EAAmB,EAAE,MAAM,EACvFJ,EAASK,EAAkB,CAACD,EAAmB,EAAE,MAAM,CAAC,EACrDF,EAAmB,GAAKA,EAAmB,EAAE,SAC5CA,EAAmB,EAAE,MAAM,EAC3BF,EAASG,EAAQ,EAAK,CAAC,EAE/B,CACJ,EAeO,IAAMI,EAA2BC,GAAmB,CACvD,IAAMR,EAAWC,EAAM,SACjB,CAAE,SAAAQ,CAAS,EAAIR,EAAM,SAAS,EAAE,KACtCD,EAASU,EAAgB,CAAE,GAAGD,EAAU,OAAAD,CAAO,CAAC,CAAC,EAC7CG,SAA8B,EAAGT,EAAmB,EAAE,MAAQ,CAACA,EAAmB,EAAE,MACnFA,EAAmB,EAAE,OAASM,EAAS,GAChD,EAEaI,EAAwB,CAACC,EAAcC,EAA+B,GAAIf,IAAgB,CAGnG,GAFIc,IAAS,gBAAiBA,EAAO,WAC5BA,IAAS,iBAAgBA,EAAO,WACpCd,GAASA,EAAM,OAAO,WAAa,SAAac,IAAS,YAAcX,EAAmB,EAAE,YAAc,IAAQW,IAAS,WAAaX,EAAmB,EAAE,SAAWA,EAAmB,EAAE,YAAc,GAAM,OACtNa,EAAcC,EAAmBH,CAAI,CAAC,EACtC,IAAII,EAAc,EACdJ,IAAS,WACLC,IAAyB,EAAGG,EAAc,EACzCA,EAAcf,EAAmB,EAAE,YAAcY,EAC/CD,IAAS,YACZC,IAAyBZ,EAAmB,EAAE,SAAUe,EAAcH,EACrEG,EAAcf,EAAmB,EAAE,YAAcY,GAE1DZ,EAAmB,EAAE,YAAce,CACvC,EAEaC,EAAmB,IAAM,CAClC,IAAMlB,EAAWC,EAAM,SACjBkB,EAAe,SAAS,kBAC1BR,SAA8B,EACzBT,EAAmB,EAAU,uBAC9BF,EAASG,EAAQ,EAAK,CAAC,EAEtBD,EAAmB,EAAU,sBAAsB,IAEpDF,EAASoB,EAAsB,CAAC,EAChCL,EAAcM,EAAc,YAAY,CAAC,GAGzCF,GACAnB,EAASsB,EAAgB,EAAK,CAAC,EAC/B,SAAS,eAAe,IAExBtB,EAASoB,EAAsB,CAAC,EAChC,SAAS,gBAAgB,kBAAkB,EAC3CpB,EAASsB,EAAgB,EAAI,CAAC,EAC9BP,EAAcM,EAAc,YAAY,CAAC,EAGrD,EAEaE,EAAwB,IAAM,CACnCZ,iBAAsC,GAAK,CAACA,SAA8B,IACtEA,eAAoC,GAAK,CAACA,gBAAqC,EAAI,OAAO,OAAO,YAAoB,KAAK,UAAU,EAClI,OAAO,OAAO,YAAoB,KAAK,WAAW,EAEhE,EAEaa,EAAcX,GAAiB,CACxC,IAAMb,EAAWC,EAAM,SACvBD,EAASyB,EAAQZ,IAAS,MAAM,CAAC,EACjCE,EAAcW,EAAQb,CAAI,CAAC,EACxBA,IAAS,UAAU,aAAa,QAAQ,eAAe,MAAM,CACpE,EAEac,EAAsB,CAACC,EAA0BC,IAA4B,CACtF,GAAIlB,qBAA0C,EAAG,CAC7C,IAAMX,EAAWC,EAAM,SACjB,CAAE,eAAA6B,CAAe,EAAI7B,EAAM,SAAS,EAAE,UACxCgB,EAAc,KAAK,MAAMW,CAAgB,EACzCG,EAAY,KAAK,MAAMF,CAAe,EACtCC,EAAe,SAAW,EAC1B9B,EAASgC,EAAkB,CAACf,GAAef,EAAmB,EAAE,SAAW6B,EAAad,CAAW,CAAC,CAAC,GAEjGa,EAAe,CAAC,EAAIb,GACpBgB,EAAU,CAAE,IAAKC,EAAI,EAAE,iBAAkB,OAAQ,OAAQ,KAAMC,EAAiBL,EAAe,CAAC,EAAGb,CAAW,CAAE,CAAC,EACjHc,GAAaA,GAAa7B,EAAmB,EAAE,SAAUF,EAASgC,EAAkB,CAAC,CAAC,CAAC,EACtFhC,EAASgC,EAAkB,CAACD,CAAU,CAAC,CAAC,EAErD,CACJ,EAEaK,EAA6B,IAAM,CAC5C,IAAMpC,EAAWC,EAAM,SACjBoC,EAAe,SAAS,eAAe,YAAY,GAAG,sBAAsB,EAClFA,EAAQ,OAAUA,EAAQ,MAAQ,EAAK,GACnCA,GAASrC,EAASsC,EAAwBD,CAAO,CAAC,CAC1D,EAEaE,EAAqBxC,GAAe,CACzC,CAACY,iBAAsC,GAAKZ,EAAM,OAAO,WAAa,SAASmB,EAAiB,CACxG","sourcesContent":["import { setIsFullScreen, setLock, setPlay } from \"../slices/controllerSlice\";\r\nimport store from \"../store\";\r\nimport { setVideoElementSizeInfo, setVideoTimelines } from \"../slices/videoDataSlice\";\r\nimport { ConditionName } from \"../../interfaces/enums\";\r\nimport { apiCaller } from \"../../services/apiCaller\";\r\nimport { API } from \"../../services/services\";\r\nimport { setUserSettings } from \"../slices/userSlice\";\r\nimport { setClearPopoversSlice } from \"../slices/popoversSlice\";\r\nimport { conditions } from \"../../conditions/conditions\";\r\nimport { backwardForwardLog, fullscreenLog, lockLog, videoTimelineLog } from \"../../logs/logs\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../constants\";\r\nimport { setPlayMiniPlayer } from \"../slices/miniPlayerSlice\";\r\n\r\nexport const handlePlayPause = (event: any) => {\r\n if (event === null || event.target.nodeName !== \"INPUT\") {\r\n const dispatch = store.dispatch;\r\n if (event !== null) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n mainPlayerVideoTag().paused ? mainPlayerVideoTag().play() : mainPlayerVideoTag().pause();\r\n dispatch(setPlay(!mainPlayerVideoTag().paused));\r\n if(miniPlayerVideoTag() && miniPlayerVideoTag().played) {\r\n miniPlayerVideoTag().pause();\r\n dispatch(setPlayMiniPlayer(false));\r\n }\r\n }\r\n};\r\n\r\nexport const handlePlayerPauseMiniPlayer = (event:any) => {\r\n if (event === null || event.target.nodeName !== \"INPUT\") {\r\n const dispatch = store.dispatch;\r\n miniPlayerVideoTag().paused ? miniPlayerVideoTag().play() : miniPlayerVideoTag().pause();\r\n dispatch(setPlayMiniPlayer(!miniPlayerVideoTag().paused))\r\n if(mainPlayerVideoTag() && mainPlayerVideoTag().played) {\r\n mainPlayerVideoTag().pause();\r\n dispatch(setPlay(false));\r\n }\r\n }\r\n}\r\n\r\nexport const handlePlayPauseInDOM = (type: boolean) => {\r\n const dispatch = store.dispatch;\r\n if (type) {\r\n mainPlayerVideoTag().play();\r\n dispatch(setPlay(true));\r\n return true;\r\n } else {\r\n mainPlayerVideoTag().pause();\r\n dispatch(setPlay(false));\r\n return false;\r\n }\r\n};\r\n\r\nexport const handleChangeSoundVolume = (volume: number) => {\r\n const dispatch = store.dispatch;\r\n const { settings } = store.getState().user;\r\n dispatch(setUserSettings({ ...settings, volume }));\r\n if (conditions(ConditionName.isIOS)) mainPlayerVideoTag().muted = !mainPlayerVideoTag().muted;\r\n else mainPlayerVideoTag().volume = volume / 100;\r\n};\r\n\r\nexport const handleBackwardForward = (type: string, forwardBackwardCount: number = 15, event?: any) => {\r\n if (type === \"touchBackward\") type = \"backward\";\r\n else if (type === \"touchForward\") type = \"forward\";\r\n if ((event && event.target.nodeName === \"INPUT\") || (type === \"backward\" && mainPlayerVideoTag().currentTime < 15) || (type === \"forward\" && mainPlayerVideoTag().duration - mainPlayerVideoTag().currentTime < 15 )) return;\r\n sendFluentLog(backwardForwardLog(type));\r\n let currentTime = 0;\r\n if (type === \"backward\") {\r\n if (forwardBackwardCount === 0) currentTime = 0;\r\n else currentTime = mainPlayerVideoTag().currentTime - forwardBackwardCount;\r\n } else if (type === \"forward\") {\r\n if (forwardBackwardCount === mainPlayerVideoTag().duration) currentTime = forwardBackwardCount;\r\n else currentTime = mainPlayerVideoTag().currentTime + forwardBackwardCount;\r\n }\r\n mainPlayerVideoTag().currentTime = currentTime;\r\n};\r\n\r\nexport const handleFullScreen = () => {\r\n const dispatch = store.dispatch;\r\n const isFullScreen = document.fullscreenElement;\r\n if (conditions(ConditionName.isIOS)) {\r\n if ((mainPlayerVideoTag() as any).webkitEnterFullScreen) {\r\n dispatch(setPlay(false));\r\n // Toggle fullscreen in Safari for iPad\r\n (mainPlayerVideoTag() as any).webkitEnterFullScreen();\r\n } else {\r\n dispatch(setClearPopoversSlice());\r\n sendFluentLog(fullscreenLog(\"fullScreen\"));\r\n }\r\n } else {\r\n if (isFullScreen) {\r\n dispatch(setIsFullScreen(false));\r\n document.exitFullscreen();\r\n } else {\r\n dispatch(setClearPopoversSlice());\r\n document.documentElement.requestFullscreen();\r\n dispatch(setIsFullScreen(true));\r\n sendFluentLog(fullscreenLog(\"fullScreen\"));\r\n }\r\n }\r\n};\r\n\r\nexport const handleLockOrientation = () => {\r\n if (conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isIOS)) {\r\n if (conditions(ConditionName.isLandscape) && !conditions(ConditionName.isFullScreen)) (window.screen.orientation as any).lock(\"portrait\");\r\n else (window.screen.orientation as any).lock(\"landscape\");\r\n }\r\n};\r\n\r\nexport const handleLock = (type: string) => {\r\n const dispatch = store.dispatch;\r\n dispatch(setLock(type === \"lock\"));\r\n sendFluentLog(lockLog(type));\r\n if(type === \"unlock\") localStorage.setItem(\"unlock-click\",\"true\");\r\n};\r\n\r\nexport const handleVideoTimeline = (currentTimeValue: number, movedTimeValue?: number) => {\r\n if (conditions(ConditionName.isSendTimelineLog)) {\r\n const dispatch = store.dispatch;\r\n const { videoTimelines } = store.getState().videoData;\r\n let currentTime = Math.floor(currentTimeValue);\r\n let movedTime = Math.floor(movedTimeValue!);\r\n if (videoTimelines.length === 0) {\r\n dispatch(setVideoTimelines([currentTime >= mainPlayerVideoTag().duration ? movedTime! : currentTime]));\r\n } else {\r\n if (videoTimelines[0] < currentTime)\r\n apiCaller({ url: API().videoTimelineLog, method: \"post\", data: videoTimelineLog(videoTimelines[0], currentTime) });\r\n if (movedTime && movedTime >= mainPlayerVideoTag().duration) dispatch(setVideoTimelines([]));\r\n else dispatch(setVideoTimelines([movedTime!]));\r\n }\r\n }\r\n};\r\n\r\nexport const handleVideoElementSizeInfo = () => {\r\n const dispatch = store.dispatch;\r\n const element: any = document.getElementById(\"video-area\")?.getBoundingClientRect();\r\n element.height = (element.width * 9) / 16;\r\n if (element) dispatch(setVideoElementSizeInfo(element));\r\n};\r\n\r\nexport const handleDoubleClick = (event: any) => {\r\n if (!conditions(ConditionName.isTouchScreen) && event.target.nodeName !== \"INPUT\") handleFullScreen();\r\n};\r\n"]}
@@ -0,0 +1,25 @@
1
+ import { b } from './chunk-3SYQZL76.mjs';
2
+ import { a as a$3 } from './chunk-OMANHRIL.mjs';
3
+ import { b as b$1, a as a$4 } from './chunk-6R7UYUPZ.mjs';
4
+ import { a as a$1, j, e as e$1, f as f$1, c, g, i, h as h$1 } from './chunk-3ZHYUTMI.mjs';
5
+ import { ba, $, aa, xa, ja, f, B, D, F, L, r, ca, a as a$2, C, ia, O, oa, h, ma, N as N$1, Q, fa, _, k, l, ka, ea, q } from './chunk-JQ2JCAJT.mjs';
6
+ import { a } from './chunk-6567FIPA.mjs';
7
+ import { e } from './chunk-DBPGS72Q.mjs';
8
+ import oe from 'next/legacy/image';
9
+ import { memo, forwardRef, useState, useRef, useEffect } from 'react';
10
+ import { shallowEqual } from 'react-redux';
11
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
12
+ import { createPortal } from 'react-dom';
13
+ import so from 'next/dynamic';
14
+
15
+ e();e();e();var Eo=()=>{let{details:e,params:o}=ba(({videoData:{details:l,params:i}})=>({details:l,params:i}),shallowEqual);return jsx("div",{className:`pl-w-full pl-max-w-[80%] pl-truncate pl-text-left pl-ml-4 pl-text-[16px] pl-font-normal pl-text-white pl-break-words pl-self-start animate__animated animate__faster ${$("isActiveElements")?"animate__fadeIn pl-opacity-100":"pl-opacity-0 animate__fadeOut"}`,children:$("hasTitle")?e.title:o.id})},ot=Eo;e();var Io=()=>jsxs("div",{className:`pl-relative animate__animated animate__faster ${$("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,children:[jsx(oe,{src:a.lock,alt:"lock-icon",width:20,height:20,onClick:()=>g("unlock")}),!localStorage.getItem("unlock-click")&&jsx("p",{className:"pl-text-[10px] pl-text-black/[0.87] pl-bg-[#F7F7F7] pl-absolute pl-left-0 pl-px-4 pl-py-3 pl-rounded-[8px] pl-w-max",children:"\u0628\u0631\u0627\u06CC \u0628\u0627\u0632 \u06A9\u0631\u062F\u0646 \u0642\u0641\u0644\u060C \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F"})]}),it=Io;var Fo=()=>(ba(({controller:{lock:e,activeElements:o}})=>({lock:e,activeElements:o}),shallowEqual),jsxs("div",{className:`pl-flex pl-items-start pl-justify-end pl-mx-4 pl-mt-5 ${$("isTouchScreenPortrait")?"pl-h-[16px]":"pl-h-[60px]"}`,children:[$("showTitle")&&jsx(ot,{}),$("isLock")&&jsx(it,{})]})),nt=Fo;e();e();var $o=()=>(ba(({controller:{play:e}})=>({play:e}),shallowEqual),ba(({videoData:{videoElementSizeInfo:e,params:o}})=>({videoElementSizeInfo:e,params:o}),shallowEqual),jsx("div",{className:`${!$("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsx(oe,{alt:"",src:$("isPlay")?a.bigPause:a.bigPlay,width:40,height:40,onClick:e=>a$1(e),onDoubleClick:e=>e.stopPropagation(),className:`${$("isPlay")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),at=$o;e();var Do=()=>jsxs("div",{className:"loader-spinner pl-absolute pl-top-[50%] pl-left-[50%] pl-mt-[-50px] pl-ml-[-42px] pl-w-screen pl-h-full pl-overflow-hidden",children:[jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"}),jsx("div",{className:"pl-bg-white"})]}),ct=Do;var Oo=()=>{let[e,o]=useState(!1),[l,i]=useState(!1);ba(({controller:{lock:c,firstPlay:a}})=>({lock:c,firstPlay:a}),shallowEqual);let{activeElements:r,isLoading:p}=ba(({controller:{activeElements:c,isLoading:a}})=>({activeElements:c,isLoading:a}),shallowEqual);return useEffect(()=>{let c=null;return $("isFirstPlay")||$("isActiveElements")?c=setTimeout(()=>i(!0),100):i(!1),()=>clearTimeout(c)},[r]),useEffect(()=>{let c;return $("isLoading")?c=setTimeout(()=>o(!0),$("isFirstPlay")?0:b$1):o(!1),()=>{clearTimeout(c),o(!1);}},[p]),jsx("main",{className:"pl-flex-1 pl-mt-1",children:e?jsx(ct,{}):jsx(Fragment,{children:l&&!$("isLock")&&jsx("div",{id:"main-content",className:`pl-h-full pl-flex pl-justify-center pl-items-center pl-text-center pl-relative ${$("isActiveElements")?"pl-pointer-events-auto":"pl-pointer-events-none"}`,children:jsxs("div",{className:"pl-flex pl-justify-center pl-gap-8 pl-items-center pl-w-max",style:{zIndex:3},children:[!$("isFirstPlay")&&jsx(a$3,{type:"forward"}),jsx(at,{}),!$("isFirstPlay")&&jsx(a$3,{type:"backward"})]})})})})},ft=Oo;e();e();e();e();var we=e=>{let{videoElementSizeInfo:o}=L.getState().videoData,{duration:l}=L.getState().controller,i=e.clientX!==void 0?e.clientX:e.touches[0].clientX;if(i<=o.right&&i>0)return (i-o.left)/o.width*l},R=e=>{let{videoElementSizeInfo:o}=L.getState().videoData,l=e.clientX!==void 0?e.clientX:e.touches[0].clientX;if(l<=o.right&&l>0)return l-o.left},ee=e=>{e&&(e.style.opacity="0.0",e.style.pointerEvents="none",e.style.zIndex=-2);},zo=e=>{e.style.display="block",e.style.zIndex=5,e.style.opacity=L.getState().videoData.details.vtt?"1.0":"0.6",e.style.pointerEvents="auto",e.style.transition="opacity 1s ease-out";},Xo=(e,o)=>{let{videoElementSizeInfo:l}=L.getState().videoData,i=document.getElementsByClassName("pl-progressTooltip")[0],r=document.getElementById("parent-player");i&&r&&(R(e)>i.getBoundingClientRect().width/2&&R(e)<l.right-l.left-i.getBoundingClientRect().width/2?o.style.left=`${R(e)-i.offsetWidth/2}px`:R(e)<(r.offsetLeft===0?i.offsetWidth:r.offsetLeft)?o.style.left="0px":ca().offsetLeft+ca().offsetWidth<R(e)+i.offsetWidth&&(o.style.left=`${ca().offsetWidth-i.offsetWidth}px`));},Ro=(e,o,l)=>{o&&zo(o),L.getState().videoData.details.vtt?Xo(e,o):o.style.left=`${R(e)-30}px`,L.dispatch(q(Number(we(e)))),l.textContent=`${O(we(e))}`;},Te=(e,o=!1)=>{let{videoElementSizeInfo:l}=L.getState().videoData,i=document.querySelector(".pl-progressTooltip"),r=document.querySelector(".pl-progressTimeTooltip"),p=e.clientX!==void 0?e.clientX:e.touches[0].clientX;i&&r&&p<=l.right&&p>l.left?(Ro(e,i,r),o&&setTimeout(()=>ee(i),2e3)):ee(i);},vt=e=>{let o=e.clientX!==void 0?e.clientX:e.touches[0].clientX;ea()&&(o<=e.view.innerWidth&&o>0?ea().style.width=`${R(e)}px`:o<=e.view.innerWidth?ea().style.width=0:o>0&&(ea().style.width="100%"));},gt=(e,o,l$1)=>{e.preventDefault(),e.stopPropagation(),l$1(!0);let i=L.dispatch,r=e.clientX!==void 0?e.clientX:e.touches[0].clientX;r<=e.view.innerWidth&&r>0&&(i(k(!0)),i(l(!0)),sessionStorage.setItem("previousVideoTime",String(ca().currentTime)),e.target.setPointerCapture(e.pointerId),o.length>0&&o.map(p=>clearTimeout(p)));},Pe=e=>{e.preventDefault(),e.stopPropagation();let o=L.dispatch,{activePointerProgressBar:l$1}=L.getState().controller,{left:i}=L.getState().videoData.videoElementSizeInfo,r=e.clientX!==void 0?e.clientX:e.touches[0].clientX,p=document.querySelector(".pl-progressTooltip");r>i?(p&&(p.style.display="block !important",p.style.pointerEvents="auto"),l$1&&(o(l(!0)),Te(e),vt(e),ca().pause())):p&&(p.style.display="none !important",p.style.pointerEvents="none");},St=(e,o,l$1,i)=>{i(!1),e.preventDefault(),e.stopPropagation();let r=L.dispatch,{duration:p}=L.getState().controller,{left:c,right:a}=L.getState().videoData.videoElementSizeInfo;e.target.removeEventListener("pointermove",Pe);let d=e.clientX!==void 0?e.clientX:e.touches[0].clientX,m=0;d>c&&d<a?m=we(e):d<c?m=0:d>0&&(m=p),$("isStaticFormat")||h$1(ca().currentTime,m),ca().currentTime=m,L.getState().controller.activePointerProgressBar&&(r(k(!1)),r(l(!1)),ca().play(),Te(e,!0),sessionStorage.setItem("current-time",String(m)),vt(e),Ho(e,r,o,l$1));},Ho=(e,o,l,i)=>{let r=i,p=setTimeout(()=>{let{settingPopover:c}=L.getState().popovers,{delayTurnOffControlbar:a}=L.getState().controller;e.pointerType==="touch"&&!c&&a&&o(f(!1));},a$4);r.push(p),l(r);},xt=()=>{let e=Date.now();ca().play().then(()=>xa(ka(Date.now()-e)));},yt=e=>Te(e),bt=()=>{let e=document.querySelector(".pl-progressTooltip");ee(e);},Vo=e=>{let o=e.split("."),i=o[0].split(":");return {milliseconds:parseInt(o[1],10)||0,seconds:parseInt(i.pop(),10)||0,minutes:parseInt(i.pop(),10)||0,hours:parseInt(i.pop(),10)||0}},ht=e=>{let o=Vo(e);return parseInt(o.hours*(60*60)+o.minutes*60+o.seconds+o.milliseconds/1e3,10)},Uo=e=>{let o=e.split(/#xywh=/i),l=o[0],r=o[1].match(/[0-9]+/gi);return {x:r[0],y:r[1],w:r[2],h:r[3],image:l}},Qo=(e,o)=>e.indexOf("//")>=0?e:o.indexOf("//")===0?[o.replace(/\/$/gi,""),e.trim()].join("/"):o.indexOf("//")>0?[o.trim(),e.trim()].join("/"):e,Wo=(e,o)=>{let l={},i=o.split(/\/\w+\.vtt\s?/)[0];if(e=Qo(e,i),!e.match(/#xywh=/i))return l.background='url("'+e+o.split(/\/\w+\.vtt\s?/)[1]+'")',l;let r=Uo(e);return l.background='url("'+r.image+o.split(/\/\w+\.vtt\s?/)[1]+'") no-repeat -'+r.x+"px -"+r.y+"px",l.width=r.w+"px",l.height=r.h+"px",l.url=r.image,l},wt=(e,o)=>{fetch(e).then(l=>{if(!l.ok)throw L.dispatch(r({...L.getState().videoData.details,vtt:void 0,vtt_mobile:void 0})),new Error("Network response was not ok");return l.text()}).then(l=>{let i=[];l.split(/[\r\n][\r\n]/i).forEach(p=>{if(p.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3}).*/gi)){let c=p.split(/[\r\n]/i),d=c[0].split(/ ?--> ?/i),m=d[0],w=d[1],u=c[1],S=Wo(u,e);i.push({start:ht(m),end:ht(w),css:S});}}),o(i);}).catch(l=>{console.error("Error fetching file:",l);});},Tt=(e,o,l)=>{for(let i=0;i<o.length;++i){let r=o[i];if(e>=r.start&&e<r.end){if(r.css.url&&!l[r.css.url]){let p={background:r.css.background,width:r.css.width,height:r.css.height};return l[r.css.url]=p,p}else if(r.css.url)return l[r.css.url]}}};var Zo=()=>{let{details:e}=ba(({videoData:{details:a}})=>({details:a}),shallowEqual),{tooltipTime:o}=ba(({controller:{tooltipTime:a,activeElements:d,isFullScreen:m}})=>({tooltipTime:a,activeElements:d,isFullScreen:m}),shallowEqual),l={},[i,r]=useState(void 0),[p,c]=useState($("isTouchScreen")?e.vtt_mobile:e.vtt);return useEffect(()=>{c(e.vtt_mobile);},[e.vtt_mobile]),useEffect(()=>{p&&wt(e.vtt_mobile,r);},[p]),$("isActiveElements")?jsxs("div",{className:`pl-flex pl-flex-col pl-progressTooltip pl-absolute pl-bottom-[calc(100%+10px)] pl-px-[10px] pl-pt-[5px] pl-mr-[-25px] pl-text-white pl-text-[14px] ${p&&i?"":"pl-bg-z-gray-700"} pl-rounded-[6px] pl-opacity-0`,children:[p&&!!i&&jsx("div",{className:"pl-flex-1 pl-border pl-border-white pl-rounded-[8px] pl-mb-2",children:jsx("div",{className:"pl-rounded-[8px]",style:Tt(o,i,l)})}),jsx("div",{className:"pl-flex pl-items-center pl-justify-center pl-progressTimeTooltip pl-text-white !pl-opacity-100"})]}):jsx(Fragment,{})},Ct=memo(Zo);var jo=()=>{let[e,o]=useState(!1);useEffect(()=>{ee(document.querySelector(".progressTooltip"));},[]);let{duration:l,currentTime:i,bufferedTimeWidth:r}=ba(({controller:{duration:a,currentTime:d,bufferedTimeWidth:m}})=>({duration:a,currentTime:d,bufferedTimeWidth:m}),shallowEqual);ba(({videoData:{params:a,videoElementSizeInfo:d}})=>({params:a,videoElementSizeInfo:d}),shallowEqual);let[p,c]=useState([]);return jsxs("div",{className:`${$("isTouchScreenPortrait")?"pl-order-1":"pl-order-none"} pl-relative`,children:[jsx("div",{className:"pl-relative",children:jsx(Ct,{})}),jsx("div",{className:"pl-w-full pl-flex pl-items-end",onPointerDown:a=>gt(a,p,o),onPointerMove:Pe,onPointerUp:a=>St(a,c,p,o),onMouseMove:yt,onMouseOut:bt,onClick:xt,onDoubleClick:a=>a.stopPropagation(),children:jsxs("div",{id:"progress-area",className:"pl-w-full pl-absolute",children:[jsx("div",{className:"pl-w-full pl-h-[40px]"}),jsxs("div",{id:"time-progress-area",className:"!pl-w-full !pl-h-[5px] pl-transition-transform pl-duration-300 pl-m-auto pl-cursor-pointer !pl-bg-gray-highLight pl-rounded",style:{transform:e?"scaleY(1.8)":"unset"},children:[jsx("div",{id:"time-progress-buffer",className:"pl-absolute pl-h-[5px] pl-bg-z-gray-400/[0.7] pl-rounded",style:{width:`${r}%`}}),jsx("div",{id:"time-progress-bar",className:`pl-h-[5px] pl-rounded pl-relative pl-cursor-pointer pl-bg-primary before:pl-bg-primary before:pl-inline-block before:pl-w-4 before:pl-h-4 ${e&&"before:pl-w-7 before:pl-h-3"}`,style:{width:`${i/l*fa()}px`}})]})]})})]})},Lt=jo;e();e();e();var el=({title:e,className:o})=>jsx("span",{className:`pl-absolute pl-w-max pl-bg-paper pl-text-white/[0.9] ${$("isFullScreen")?"pl-bottom-[300%]":"pl-bottom-[270%]"} pl-rounded-[8px] pl-text-[10px] pl-px-4 pl-py-[13px] pl-font-normal ${o}`,children:e}),N=el;var nl=()=>{let{isFullScreen:e}=ba(({controller:{firstPlay:r,isFullScreen:p}})=>({firstPlay:r,isFullScreen:p}),shallowEqual),[o,l]=useState(!1),i=aa();return useEffect(()=>{$("isFirstPlay")||i(f(!1));},[e]),jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(oe,{src:$("isFullScreen")?a.nonFullScreen:a.fullScreen,alt:"fullScreen-icon",className:"pl-cursor-pointer",width:20,height:20,onMouseOver:()=>!$("isTouchScreen")&&l(!0),onMouseLeave:()=>!$("isTouchScreen")&&l(!1),onClick:()=>{e$1(),f$1();}}),o&&jsx(N,{title:`${$("isFullScreen")?"\u062E\u0631\u0648\u062C \u0627\u0632":""} \u062A\u0645\u0627\u0645 \u0635\u0641\u062D\u0647`})]})},At=nl;e();var ml=()=>{let[e,o]=useState(!1),l=aa(),{params:i,details:r}=ba(({videoData:{params:p,details:c}})=>({params:p,details:c}),shallowEqual);return jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(oe,{alt:"",onMouseOver:()=>!$("isTouchScreen")&&o(!0),onMouseLeave:()=>!$("isTouchScreen")&&o(!1),src:a.pictureInPicture,width:20,height:20,className:"pl-flex pl-cursor-pointer",onClick:()=>{console.log(i.id),i.onClickMiniPlayerIcon&&(localStorage.removeItem("close-miniPlayer"),ca().pause(),l(a$2(!1)),i.onClickMiniPlayerIcon({video:r||void 0,id:i.type==="vod"?i.id:window.btoa(i.id),type:i.type,currentTime:ca().currentTime}));}}),e&&jsx(N,{title:"\u062A\u0635\u0648\u06CC\u0631 \u062F\u0631 \u062A\u0635\u0648\u06CC\u0631"})]})},$t=ml;e();var gl=()=>{let[e,o]=useState(!1),l=aa(),{settings:i}=ba(({user:{settings:a}})=>({settings:a}),shallowEqual),r=useRef(i.volume),p=()=>{if(r.current!==i.volume){let{settings:a}=L.getState().user;xa(oa(r.current,a.volume)),r.current=a.volume,l(F({...a,volume:a.volume}));}},c$1=a=>{let{settings:d}=L.getState().user;a==="mute"?(c(0),xa(oa(d.volume,0))):(xa(oa(d.volume,100)),c(100));};return jsxs("div",{className:"pl-relative pl-inline-flex pl-items-center pl-gap-2 pl-sound-icon",children:[!$("isTouchScreen")&&jsx("input",{onMouseUp:p,type:"range",min:"0",max:"100",value:i.volume,onChange:a=>c(+a.target.value),className:"pl-soundVolume pl-cursor-pointer rounded-full",style:{background:`linear-gradient(to right, white ${i.volume}%, rgba(255,255,255,0.3) 0)`}}),jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(oe,{src:$("hasSound")?a.unMute:a.mute,alt:$("hasSound")?"unmute-icon":"mute-icon",className:"pl-flex pl-items-center pl-cursor-pointer",width:20,height:20,onClick:()=>$("hasSound")?c$1("mute"):c$1("unmute"),onDoubleClick:a=>a.stopPropagation(),onMouseOver:()=>!$("isTouchScreen")&&o(!0),onMouseLeave:()=>!$("isTouchScreen")&&o(!1)}),e&&jsx(N,{className:"pl-left-0",title:"\u0635\u062F\u0627"})]})]})},_t=gl;e();e();var Bt=forwardRef(({children:e,status:o,onClose:l,type:i,classNames:r,parentClassNames:p,styles:c,isBlurBackground:a,isFullHeight:d=!1,isHeader:m,isHasCatchUpLineOnTop:w=!1,animation:u,scrollbar:S=!1,isFocusOnInput:M=!1},q)=>{let[$$1,_]=useState(o),[O,Be]=useState(0),[xo,yo]=useState(0),{videoElementSizeInfo:qe}=ba(({videoData:{videoElementSizeInfo:F}})=>({videoElementSizeInfo:F}),shallowEqual),Se=useRef(0);useEffect(()=>{let F;return o?_(!0):F=setTimeout(()=>{l(!1),Be(0),_(!1);},500),()=>clearTimeout(F)},[o]);let bo=F=>{let To=document.getElementById("popover-content");Se.current||(Se.current=window.innerHeight-qe.top-To?.getBoundingClientRect().top),F.stopPropagation(),window.innerHeight-qe.top-F.touches[0].clientY<Se.current&&Be(window.innerHeight-F.touches[0].clientY),yo(1000005);},wo=()=>{l();},ze=jsxs(Fragment,{children:[a&&jsx("div",{className:`pl-bg-black/[0.5] pl-w-screen pl-h-screen pl-fixed pl-top-0 pl-right-0 animate__animated animate__faster ${o?"animate__fadeIn":"animate__fadeOut"}`,style:{zIndex:1000001}}),jsx("div",{className:`${i==="modal"&&"pl-fixed pl-top-0 pl-left-0 pl-flex pl-w-full pl-h-full pl-justify-center pl-items-end sm:pl-items-center"} ${p}`,style:{zIndex:d&&!M?xo:1000004},children:jsx("div",{className:`pl-flex pl-flex-col pl-rounded-[8px] animate__animated animate__faster pl-bg-white/[0.9]
16
+ ${d&&"pl-h-full"}
17
+ ${u||(window.innerWidth>768&&i==="modal"?o?"animate__fadeIn":"animate__fadeOut":o?"animate__fadeInUp":"animate__fadeOutDown")}
18
+ ${$("isTouchScreenPortrait")?"!pl-fixed !pl-right-0 !pl-left-0 !pl-bottom-0 !pl-w-full !pl-mb-0 pl-rounded-[12px] !pl-rounded-b-none !pl-bg-white":"before:pl-hidden"}
19
+ ${i!=="modal"&&"pl-absolute pl-bottom-[130%] pl-overflow-auto no-scrollbar"}
20
+ ${r}
21
+ `,style:{height:O||"max-content",maxHeight:"80vh",zIndex:1000004,...c},ref:q,id:"popover-content",children:jsxs(Fragment,{children:[m&&jsx("div",{onTouchMove:w?bo:()=>{},onTouchEndCapture:w?wo:()=>{},className:"pl-py-4",children:w&&jsx("div",{className:"pl-absolute pl-top-[10px] pl-right-[50%] pl-mr-[-25px] pl-text-center pl-w-8 pl-h-1 pl-rounded-[20px] pl-bg-gray-highLight"})}),jsx("div",{className:`pl-overflow-y-auto pl-h-full pl-w-full ${!S&&"no-scrollbar"}`,onTouchMove:F=>F.stopPropagation(),children:e})]})})})]});return jsx(Fragment,{children:$$1&&jsx(Fragment,{children:i==="modal"?createPortal(jsx(Fragment,{children:ze}),document.getElementById("dialog-react-root-videoPlayer")):jsx("div",{children:ze})})})});Bt.displayName="popover";var W=Bt;e();e();var Pl=(e,o)=>{useEffect(()=>{let l=i=>{!e.current||e.current.contains(i.target)||o(i);};return document.addEventListener("mousedown",l),document.addEventListener("touchstart",l),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l);}},[e,o]);},G=Pl;var Il=({setSection:e,showQualityLevelsIcon:o})=>{let l=aa(),{qualityLevels:i}=ba(({controller:{qualityLevels:u,manualQuality:S,autoQuality:M}})=>({qualityLevels:u,manualQuality:S,autoQuality:M}),shallowEqual),{settings:r}=ba(({user:{settings:u}})=>({settings:u}),shallowEqual),{qualityLevelsPopover:p}=ba(({popovers:{qualityLevelsPopover:u}})=>({qualityLevelsPopover:u}),shallowEqual);ba(({videoData:{params:u,videoElementSizeInfo:S}})=>({params:u,videoElementSizeInfo:S}),shallowEqual);let[c,a$1]=useState(!1);i=[-1,...i];let d=(u,S)=>$("isAutoQuality")&&S===-1?!0:!$("isAutoQuality")&&r.quality===u,m=useRef(null);G(m,()=>l(D(!1)));let w=jsx("div",{id:"qualityLevels",className:"animate__animated animate__fadeIn pl-py-2",children:jsx("ul",{className:"pl-flex pl-flex-col pl-gap-2",children:i.map((u,S)=>jsxs("li",{className:`pl-flex pl-items-center pl-ps-[24.2px] pl-text-[14px] pl-font-medium pl-rounded-[4px] pl-relative pl-cursor-pointer ${d(S-1,u)&&"pl-bg-primary/[0.12] !pl-cursor-default"} ${$("isTouchScreen")?"pl-py-[13.5px]":"pl-py-[9.5px]"}`,onClick:d(S-1,u)?()=>{}:()=>{xa(ja(u===-1?"auto":`${u}P`)),l(f(!1)),l(B(!1)),l(D(!1)),l(F({...r,quality:u===-1?-1:S-1})),e&&e("main");},children:[!$("isTouchScreen")&&d(S-1,u)&&jsx("div",{className:"pl-absolute pl-right-[11.8px]",children:jsx(oe,{src:a.tick,alt:"",width:12,height:9})}),$("isTouchScreen")&&jsx("div",{className:`pl-w-5 pl-h-5 pl-rounded-full pl-border pl-border-black/[0.5] pl-p-0.5 ${d(S-1,u)&&"pl-border-primary"}`,children:d(S-1,u)&&jsx("div",{className:"pl-w-full pl-h-full pl-rounded-full pl-bg-primary"})}),jsx("span",{className:`pl-w-full pl-text-[14px] pl-text-black/[0.87] ${$("isTouchScreen")?"pl-pr-[21px]":"pl-pr-[10px]"}`,children:u===-1?jsxs("span",{children:[jsx("span",{children:"\u062E\u0648\u062F\u06A9\u0627\u0631 "}),jsx("span",{className:"pl-text-[10px] pl-font-normal pl-text-black/[0.5]",children:"(\u0628\u0631 \u0627\u0633\u0627\u0633 \u0633\u0631\u0639\u062A \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0634\u0645\u0627)"})]}):`${u}p`})]},S))})});return jsx(Fragment,{children:o?jsxs("div",{className:"pl-relative pl-flex pl-items-center",ref:m,children:[jsx(oe,{src:a.qualitySetting1,alt:"speed-icon",width:20,height:20,onClick:()=>l(D(!p)),onMouseOver:()=>!$("isTouchScreen")&&!$("showQualityLevelsPopover")&&a$1(!0),onMouseLeave:()=>!$("isTouchScreen")&&a$1(!1),className:"pl-cursor-pointer"}),c&&jsx(N,{title:"\u06A9\u06CC\u0641\u06CC\u062A"}),jsx(W,{classNames:`!pl-p-0 pl-overflow-hidden !pl-bg-white ${$("isTouchScreen")?"!pl-fixed !pl-bottom-0 !pl-rounded-t-[20px] pl-rounded-b-none":"pl-right-0 pl-mb-[33px] !pl-rounded-[12px] pl-w-[230px]"} ${$("isTouchScreenPortrait")&&"!pl-w-screen tablet:pl-max-w-[440px]"} ${$("isTouchScreenLandscape")&&"pl-w-full pl-max-w-[440px]"}`,status:p,onClose:()=>l(D(!1)),type:$("isTouchScreen")?"modal":"popover",isBlurBackground:$("isTouchScreenPortrait"),ref:$("isTouchScreenPortrait")?m:void 0,isHeader:$("isTouchScreen"),customHeader:jsx(Fragment,{}),isHasCatchUpLineOnTop:$("isTouchScreen"),children:w})]}):jsx(Fragment,{children:w})})},ue=memo(Il);e();e();var kl=({className:e,onClick:o,onMouseOver:l,onMouseLeave:i})=>jsxs("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,onClick:o,onMouseOver:l,onMouseLeave:i,children:[jsx("path",{d:"M10.5488 1.53559C8.20532 1.02852 5.66339 1.68608 3.84359 3.50588C1.15649 6.19298 1.00481 10.4572 3.39041 13.3215C3.55135 13.5148 3.8176 13.6347 4.13036 13.6347H13.8687C14.1816 13.6347 14.4476 13.5149 14.6085 13.3217C16.0815 11.5533 16.5884 9.25027 16.1258 7.11249C16.0528 6.77512 16.2671 6.44245 16.6045 6.36945C16.9418 6.29645 17.2745 6.51077 17.3475 6.84814C17.8886 9.34866 17.2968 12.0474 15.569 14.1217C15.1326 14.6455 14.489 14.8847 13.8687 14.8847H4.13036C3.50995 14.8847 2.86616 14.6453 2.42991 14.1215C-0.36559 10.765 -0.188583 5.77029 2.95971 2.622C5.09241 0.489299 8.07189 -0.279272 10.8132 0.31386C11.1505 0.386857 11.3648 0.719527 11.2918 1.0569C11.2188 1.39427 10.8862 1.60859 10.5488 1.53559Z"}),jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.9976 2.66523C15.2417 2.9093 15.2417 3.30503 14.9976 3.54911L10.7129 7.83399C10.8469 8.09798 10.9225 8.39667 10.9225 8.713C10.9225 9.78688 10.0519 10.6574 8.97805 10.6574C7.90417 10.6574 7.03362 9.78688 7.03362 8.713C7.03362 7.63912 7.90417 6.76856 8.97805 6.76856C9.27953 6.76856 9.56498 6.83718 9.81965 6.95963C9.82222 6.95697 9.82483 6.95432 9.82746 6.95168L14.1137 2.66525C14.3578 2.42116 14.7535 2.42115 14.9976 2.66523ZM9.67249 8.713C9.67249 9.09652 9.36158 9.40743 8.97805 9.40743C8.59453 9.40743 8.28362 9.09652 8.28362 8.713C8.28362 8.32947 8.59453 8.01856 8.97805 8.01856C9.36158 8.01856 9.67249 8.32947 9.67249 8.713Z"})]}),fe=kl;var Dl=[.5,.75,1,1.25,1.5,1.75,2],_l=({setSection:e,showSpeedIcon:o})=>{let l=aa();ba(({videoData:{videoElementSizeInfo:m,params:w}})=>({videoElementSizeInfo:m,params:w}),shallowEqual);let{speedPopover:i}=ba(({popovers:{speedPopover:m}})=>({speedPopover:m}),shallowEqual),{settings:r}=ba(({user:{settings:m}})=>({settings:m}),shallowEqual),p=useRef(null),[c,a$1]=useState(!1);G(p,()=>l(C(!1))),useEffect(()=>{ca()&&(ca().playbackRate=r.speed);},[]);let d=jsx("div",{id:"speed",className:"animate__animated animate__fadeIn pl-py-2",children:jsx("ul",{className:"pl-flex pl-flex-col pl-gap-2",children:Dl.map((m,w)=>jsxs("li",{className:`pl-flex pl-items-center pl-ps-[24.2px] pl-text-[14px] pl-font-medium pl-rounded-[4px] pl-relative pl-cursor-pointer ${r.speed===m&&"pl-bg-primary/[0.12] !pl-cursor-default"} ${$("isTouchScreen")?"pl-py-[13.5px]":"pl-py-[9.5px]"}`,onClick:r.speed===m?()=>{}:()=>{$("isStaticFormat")||xa(ia(m)),l(f(!1)),l(B(!1)),l(C(!1)),l(F({...r,speed:m})),ca().playbackRate=m,e&&e("main");},children:[!$("isTouchScreen")&&r.speed===m&&jsx("div",{className:"pl-absolute pl-right-[11.8px]",children:jsx(oe,{src:a.tick,alt:"",width:12,height:9})}),$("isTouchScreen")&&jsx("div",{className:`pl-w-5 pl-h-5 pl-rounded-full pl-border pl-border-black/[0.5] pl-p-0.5 ${r.speed===m&&"pl-border-primary"}`,children:r.speed===m&&jsx("div",{className:"pl-w-full pl-h-full pl-rounded-full pl-bg-primary"})}),jsx("p",{className:`pl-w-full pl-flex pl-items-center pl-gap-2 pl-text-black/[0.87] ${$("isTouchScreen")?"pl-pr-[21px]":"pl-pr-[10px]"}`,children:m})]},w))})});return jsx(Fragment,{children:o?jsxs("div",{className:"pl-relative pl-flex pl-items-center",ref:p,children:[jsx(fe,{className:"pl-size-5 pl-cursor-pointer size-5 pl-fill-white",onClick:()=>l(C(!i)),onMouseOver:()=>!$("isTouchScreen")&&!$("showSpeedPopover")&&a$1(!0),onMouseLeave:()=>!$("isTouchScreen")&&a$1(!1)}),c&&jsx(N,{title:"\u0633\u0631\u0639\u062A"}),jsx(W,{classNames:`!pl-p-0 pl-overflow-hidden !pl-bg-white ${$("isTouchScreen")?"!pl-fixed !pl-bottom-0 !pl-rounded-t-[20px] pl-rounded-b-none":"!pl-w-[230px] pl-right-0 pl-mb-[33px] !pl-rounded-[12px]"} ${$("isTouchScreenPortrait")&&"!pl-w-screen tablet:!pl-max-w-[440px] tablet:!pl-mx-auto"} ${$("isTouchScreenLandscape")&&"pl-w-full pl-max-w-[440px]"}`,status:i,onClose:()=>l(C(!1)),type:$("isTouchScreen")?"modal":"popover",isBlurBackground:$("isTouchScreenPortrait"),ref:$("isTouchScreenPortrait")?p:void 0,isHeader:$("isTouchScreen"),customHeader:jsx(Fragment,{}),isHasCatchUpLineOnTop:$("isTouchScreen"),children:d})]}):jsx(Fragment,{children:d})})},he=_l;e();var Ol=({enabled:e,setEnabled:o})=>jsx("div",{className:`pl-relative pl-h-[22px] pl-w-[37px] pl-cursor-pointer pl-rounded-[15px] pl-transition-colors pl-duration-150 pl-ease-linear ${e?"pl-bg-primary pl-border pl-border-transparent":"pl-bg-secondary-200 pl-border pl-border-gray-highLight"}`,onClick:o,children:jsx("div",{className:`pl-absolute pl-left-1 pl-top-[2px] pl-w-[16px] pl-h-[16px] pl-rounded-full pl-transition-transform pl-duration-150 pl-ease-linear ${e?"pl-bg-white pl-translate-x-[13px]":"pl-bg-black/[0.16] -pl-translate-x-0.5"}`})}),Vt=Ol;var zl=()=>{let e=aa(),{selectedSubtitle:o}=ba(({videoData:{params:d,subtitles:m,selectedSubtitle:w}})=>({params:d,subtitles:m,selectedSubtitle:w}),shallowEqual),{settingPopover:l}=ba(({popovers:{settingPopover:d}})=>({settingPopover:d}),shallowEqual),[i,r]=useState("main"),[p,c]=useState(!1),a$1=useRef(null);return G(a$1,()=>{e(B(!1)),setTimeout(()=>r("main"),500);}),jsxs("div",{className:`pl-inline-flex ${$("isLandscape")&&"pl-relative"}`,ref:a$1,children:[jsxs("div",{className:"pl-flex pl-items-center pl-relative pl-cursor-pointer",onClick:()=>e(B(!l)),onMouseOver:()=>!$("isTouchScreen")&&!$("showSettingPopover")&&c(!0),onMouseLeave:()=>!$("isTouchScreen")&&c(!1),children:[jsx(oe,{src:a.settings,alt:"",width:20,height:20}),p&&jsx(N,{title:"\u062A\u0646\u0638\u06CC\u0645\u0627\u062A"})]}),jsx(W,{classNames:`!pl-p-0 pl-overflow-hidden !pl-bg-white ${$("isTouchScreen")?"!pl-fixed !pl-bottom-0 !pl-rounded-t-[20px] pl-rounded-b-none":"!pl-w-[230px] pl-right-0 pl-mb-[33px] !pl-rounded-[12px]"} ${$("isTouchScreenPortrait")&&"!pl-w-screen tablet:!pl-max-w-[285px] tablet:!pl-mx-auto"} ${$("isTouchScreenLandscape")&&"pl-w-full pl-max-w-[285px]"}`,status:l,onClose:()=>{e(B(!1)),setTimeout(()=>r("main"),500);},type:$("isTouchScreen")?"modal":"popover",isBlurBackground:$("isTouchScreenPortrait"),ref:$("isTouchScreenPortrait")?a$1:void 0,isHeader:$("isTouchScreen"),customHeader:jsx(Fragment,{}),isHasCatchUpLineOnTop:$("isTouchScreen"),children:jsxs(Fragment,{children:[i==="main"&&jsxs("div",{id:"main",className:"pl-p-4 pl-rounded-[10px] pl-flex pl-flex-col pl-gap-5 animate__animated animate__fadeIn",children:[!$("isStaticFormat")&&jsx(Fragment,{children:jsxs("div",{className:"pl-flex pl-items-center pl-gap-[10px] pl-cursor-pointer",onClick:()=>r("qualityLevels"),children:[jsx(oe,{src:a.qualitySetting,alt:"",width:16,height:16}),jsx("p",{className:"pl-ml-auto pl-text-[12px] pl-font-medium pl-text-black/[0.87]",children:"\u06A9\u06CC\u0641\u06CC\u062A \u067E\u062E\u0634"}),jsx(oe,{src:a.chevronLeft,alt:"",width:16,height:16})]})}),jsxs("div",{className:"pl-flex pl-items-center pl-gap-[10px] pl-cursor-pointer",onClick:()=>r("speed"),children:[jsx(fe,{className:"size-5 pl-fill-black/[0.5]"}),jsx("p",{className:"pl-ml-auto pl-text-[12px] pl-font-medium pl-text-black/[0.87]",children:"\u0633\u0631\u0639\u062A"}),jsx(oe,{src:a.chevronLeft,alt:"",width:16,height:16})]}),$("hasSubtitles")&&$("isTouchScreenPortrait")&&jsxs("div",{className:"pl-flex pl-items-center pl-gap-[10px] pl-cursor-pointer",children:[jsx(oe,{src:a.subtitleOutlineGray,alt:"subtitle-icon",width:20,height:20}),jsx("p",{className:"pl-ml-auto pl-text-[12px] pl-font-medium pl-text-black/[0.87]",children:"\u0632\u06CC\u0631\u0646\u0648\u06CC\u0633"}),jsx(Vt,{enabled:!!o,setEnabled:b})]})]}),i==="qualityLevels"&&jsx(ue,{setSection:r}),i==="speed"&&jsx(he,{setSection:r})]})})]})},Wt=memo(zl);e();var Xl=()=>{let{duration:e,currentTime:o}=ba(({controller:{duration:l,currentTime:i}})=>({duration:l,currentTime:i}),shallowEqual);return ba(({videoData:{videoElementSizeInfo:l,params:i}})=>({videoElementSizeInfo:l,params:i}),shallowEqual),jsx(Fragment,{children:jsxs("div",{className:`pl-mr-auto !pl-text-white pl-w-full pl-max-w-max pl-text-[12px] pl-font-bold ${$("isFullScreen")?"pl-ml-8":"pl-ml-4"} ${$("isTouchScreenPortrait")?"!pl-ml-0":"pl-absolute pl-left-0 pl-bottom-full pl-mb-[33px]"}`,children:[jsx("span",{children:O(e)}),jsx("span",{children:" / "}),jsx("span",{children:O(o)})]})})},ge=Xl;e();var Ul=()=>jsx(oe,{src:a.unlock,alt:"unlock-icon",width:20,height:20,onClick:()=>g("lock")}),Zt=Ul;e();var Yl=()=>{let[e,o]=useState(!1);return ba(({videoData:{selectedSubtitle:l,videoElementSizeInfo:i,params:r}})=>({selectedSubtitle:l,videoElementSizeInfo:i,params:r}),shallowEqual),jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(oe,{alt:"subtitle-icon",src:$("isSelectedSubtitle")?a.subtitleFill:a.subtitleOutline,className:"pl-cursor-pointer",width:20,height:20,onClick:b,onDoubleClick:l=>l.stopPropagation(),onMouseOver:()=>!$("isTouchScreen")&&o(!0),onMouseLeave:()=>!$("isTouchScreen")&&o(!1)}),e&&jsx(N,{title:"\u0632\u06CC\u0631\u0646\u0648\u06CC\u0633"})]})},Jt=Yl;var jl=()=>{ba(({controller:{isFullScreen:o}})=>({isFullScreen:o}),shallowEqual),ba(({videoData:{videoElementSizeInfo:o,params:l}})=>({videoElementSizeInfo:o,params:l}),shallowEqual);let e="";return $("isTouchScreen")?$("isFullScreen")?e="pl-mx-6":e="pl-mx-4":$("isFullScreen")?e="pl-mx-8":e="pl-mx-4",jsxs("div",{id:"player-controllbar",className:`pl-flex pl-justify-between pl-items-center ${e}`,children:[jsxs("div",{className:"pl-flex pl-items-center pl-gap-5",children:[jsx(At,{}),$("isTouchScreenLandscape")&&jsx(Zt,{}),$("showPictureInPicture")&&jsx($t,{}),$("showSettingIcon")&&jsx(Wt,{}),$("isFullScreen")&&!$("isStaticFormat")&&jsx(ue,{showQualityLevelsIcon:!0}),($("isFullScreen")||$("isStaticFormat"))&&jsx(he,{showSpeedIcon:!0}),$("hasSubtitles")&&!$("isTouchScreenPortrait")&&jsx(Jt,{})]}),jsxs("div",{className:"pl-flex pl-items-center pl-gap-5",children:[$("isTouchScreenPortrait")&&jsx(ge,{}),!$("isIOS")&&jsx(_t,{})]})]})},jt=memo(jl);e();var ei=()=>{let{subtitleText:e}=ba(({videoData:{subtitleText:l,selectedSubtitle:i}})=>({subtitleText:l,selectedSubtitle:i}),shallowEqual);ba(({controller:{isFullScreen:l}})=>({isFullScreen:l}),shallowEqual);let o=()=>{let l="";return $("isLock")?l="pl-bottom-3":$("isActiveElements")?$("isTouchScreenPortrait")?l="pl-bottom-[45px]":$("isFullScreen")?l="pl-bottom-[120px]":l="pl-bottom-[85px]":$("isActiveElements")||(l="pl-bottom-3"),l};return jsx("div",{id:"subtitle-id",style:{direction:"ltr"},className:`pl-absolute pl-w-full pl-px-6 pl-text-center pl-text-[14px] ${$("isFullScreen")&&"pl-text-[16px]"} pl-text-white pl-font-normal ${o()}`,children:_(e).map((l,i)=>jsx("p",{className:"pl-mx-auto",style:{textShadow:"0 0 4px #000000"},children:l},i))})},oo=ei;var ti=()=>{ba(({controller:{lock:o,isFullScreen:l,isLoading:i,activeElements:r}})=>({lock:o,isFullScreen:l,isLoading:i,activeElements:r}),shallowEqual),ba(({videoData:{subtitles:o,selectedSubtitle:l}})=>({subtitles:o,selectedSubtitle:l}),shallowEqual);let e="";return $("isTouchScreen")?$("isFullScreen")?e="pl-gap-6 pl-mb-6":e="pl-gap-6 pl-mb-0":$("isFullScreen")?e="pl-gap-6 pl-mb-8":e="pl-gap-4 pl-mb-3",jsx("div",{id:"footer",className:"pl-relative",style:{zIndex:4},children:jsxs(Fragment,{children:[$("showSubtitle")&&jsx(oo,{}),!$("isLock")&&jsx(Fragment,{children:jsxs("div",{className:`pl-flex pl-flex-col pl-w-full pl-mx-auto animate__animated animate__faster ${e} ${$("isActiveElements")&&!$("isLoading")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,children:[!$("isTouchScreenPortrait")&&jsx(ge,{}),$("showProgressbar")&&jsx(Lt,{}),jsx(jt,{})]})})]})})},no=ti;e();var oi=so(()=>import('./staticVideoTag-IGHEAXZI.mjs')),li=so(()=>import('./nonStaticVideoTag-2NVH2HVY.mjs')),ii=()=>jsx(Fragment,{children:$("isStaticFormat")?jsx(oi,{}):jsx(li,{})}),po=ii;e();var pi=()=>{let e=aa();ba(({videoData:{params:o}})=>({params:o}),shallowEqual),useEffect(()=>{let o=()=>{document.fullscreenElement?e(h(!0)):(e(h(!1)),i(),xa(ma("exitFullScreen")));};document.addEventListener&&(document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),document.addEventListener("fullscreenchange",o,!1),document.addEventListener("MSFullscreenChange",o,!1));},[]);},ao=pi;e();var ci=(e,o)=>{let l=aa(),{activeElements:i}=ba(({controller:{activeElements:a}})=>({activeElements:a}),shallowEqual),r=useRef(null),p=useRef(e),c=useRef(o);useEffect(()=>{p.current=e;},[e]),useEffect(()=>{c.current=o;},[o]),useEffect(()=>{let a=!1,d=u=>{let{activeElements:S,isEnded:M}=L.getState().controller;M?l(f(!0)):u.pointerType==="mouse"&&(clearTimeout(r.current),S?["player-tag","main-content","player-controllbar","video-opacity","playerElements","touchBackward","touchForward"].includes(u.target.id)&&(a=!0):l(f(!0)),r.current=setTimeout(()=>{let{settingPopover:q,speedPopover:$,qualityLevelsPopover:_}=L.getState().popovers,{play:O}=L.getState().controller;!q&&!$&&!_&&O&&a&&l(f(!1));},a$4));},m=u=>{setTimeout(()=>{let{activeElements:S,isEnded:M,firstPlay:q}=L.getState().controller;if(clearTimeout(r.current),M)return l(f(!0));N$1()&&!q&&!p.current&&!c.current&&(["player-tag","main-content","video-opacity","touchBackward","touchForward"].includes(u.target.id)||Q(u,"playerElements")?(l(f(!S)),r.current=setTimeout(()=>{let{settingPopover:$,speedPopover:_,qualityLevelsPopover:O}=L.getState().popovers;!$&&!_&&!O&&l(f(!1));},a$4)):r.current=setTimeout(()=>{let{settingPopover:$,speedPopover:_,qualityLevelsPopover:O}=L.getState().popovers;!$&&!_&&!O&&l(f(!1));},a$4));},200);},w=()=>{clearTimeout(r.current),r.current=setTimeout(()=>{let{activeElements:u,isEnded:S}=L.getState().controller,{settingPopover:M,speedPopover:q,qualityLevelsPopover:$}=L.getState().popovers;S?l(f(!0)):!M&&!q&&!$&&u&&!S&&l(f(!u));},a$4);};return document.getElementById("video-area").addEventListener("touchstart",m),document.getElementById("video-area").addEventListener("touchmove",w),document.getElementById("video-area").addEventListener("pointermove",d),()=>{let u=document.getElementById("video-area");u&&(u.removeEventListener("touchstart",m),u.removeEventListener("touchmove",w),u.removeEventListener("pointermove",d));}},[i,e,o]);},co=ci;e();var ui=()=>{let{firstPlay:e,isFullScreen:o}=ba(({controller:{firstPlay:l,isFullScreen:i}})=>({firstPlay:l,isFullScreen:i}),shallowEqual);useEffect(()=>{if(ca()){let l,i$1=()=>{l=setTimeout(()=>{i();},N$1()?0:300);};return i$1(),window.addEventListener("resize",i$1),()=>{window.removeEventListener("resize",i$1),clearTimeout(l);}}},[e,o,ca()]);},mo=ui;e();var hi=()=>{let{firstPlay:e}=ba(({controller:{firstPlay:o}})=>({firstPlay:o}),shallowEqual);ba(({videoData:{details:o}})=>({details:o}),shallowEqual),useEffect(()=>{$("setSubtitleFirstPlay")&&b();},[e]);},fo=hi;var gi=so(()=>import('./touchVolumeBrightness-G7XRXNO5.mjs')),go=so(()=>import('./backwardForward-LEAH3F4W.mjs')),Si=()=>{let[e,o]=useState(!1),[l,i]=useState(!1),{details:r,params:p}=ba(({videoData:{details:c,params:a,videoElementSizeInfo:d}})=>({details:c,params:a,videoElementSizeInfo:d}),shallowEqual);return ba(({controller:{firstPlay:c,isFullScreen:a,isLoading:d,canPlayVideo:m}})=>({firstPlay:c,isFullScreen:a,isLoading:d,canPlayVideo:m}),shallowEqual),ao(),mo(),co(e,l),fo(),jsx(Fragment,{children:jsxs("div",{id:"video-area",style:{zIndex:$("isFullScreen")?1e6:"unset"},onClick:c=>$("isFirstPlay")&&a$1(c),onDoubleClick:c=>j(c),className:`!pl-bg-contain !pl-bg-center !pl-bg-no-repeat pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-items-center ${!$("isTouchScreen")&&!$("isFullScreen")&&"!pl-rounded-[12px]"} ${$("isFullScreen")&&"!pl-fixed !pl-w-screen dvh"} pl-w-full pl-relative ${!$("isActiveElements")&&"pl-cursor-none"}`,children:[jsx("div",{id:"video-opacity",className:`pl-absolute pl-w-full pl-aspect-video pl-transition-all pl-duration-500 pl-bg-black ${!$("isTouchScreen")&&!$("isFullScreen")&&"!pl-rounded-[12px]"} ${$("isActiveElements")?"pl-bg-opacity-50":"pl-bg-opacity-0"}`}),$("showBanner")&&jsx("div",{className:"pl-absolute pl-w-full pl-h-full pl-flex pl-justify-center",children:jsx(oe,{src:$("isStaticFormat")?p.banner:r.banner,layout:"fill",alt:p.bannerAlt?p.bannerAlt:$("isStaticFormat")?"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648":r.title,objectFit:"contain",className:`${!$("isTouchScreen")&&!$("isFullScreen")&&"pl-rounded-[12px]"}`})}),$("showTouchVolumeBrightness")&&jsx(gi,{}),$("showBackwardForward")&&jsxs("div",{className:"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-overflow-hidden pl-flex pl-items-center",style:{zIndex:l||e?1000002:1},children:[jsx(go,{type:"touchForward",isRightDoubleTouched:e,setIsRightDoubleTouched:o}),jsx(go,{type:"touchBackward",isLeftDoubleTouched:l,setIsLeftDoubleTouched:i})]}),jsx(po,{}),jsx("div",{id:"playerElements",className:"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full",children:jsxs("div",{className:"pl-flex pl-flex-col pl-justify-between pl-w-full pl-h-full",children:[$("showHeader")&&jsx(nt,{}),$("showMain")&&jsx(ft,{}),$("showFooter")&&jsx(no,{})]})})]})})},Ec=Si;
22
+
23
+ export { Ec as a };
24
+ //# sourceMappingURL=out.js.map
25
+ //# sourceMappingURL=chunk-63ZUB4L2.mjs.map