cafe-video-player 2.8.6 → 3.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 (167) hide show
  1. package/VideoHighLighter-AHM2SNBQ.js +2 -0
  2. package/VideoHighLighter-AHM2SNBQ.js.map +1 -0
  3. package/VideoHighLighter-BYBKAK24.mjs +2 -0
  4. package/VideoHighLighter-BYBKAK24.mjs.map +1 -0
  5. package/backwardForward-FNZM2W73.js +2 -0
  6. package/backwardForward-FNZM2W73.js.map +1 -0
  7. package/backwardForward-QAVC3JUR.mjs +2 -0
  8. package/backwardForward-QAVC3JUR.mjs.map +1 -0
  9. package/chunk-2KHWD37R.js +2 -0
  10. package/{chunk-PYFXHYM2.js.map → chunk-2KHWD37R.js.map} +1 -1
  11. package/chunk-443LJTEX.js +2 -0
  12. package/{chunk-APV3JQFO.js.map → chunk-443LJTEX.js.map} +1 -1
  13. package/chunk-4PVUWYWX.mjs +9 -0
  14. package/chunk-4PVUWYWX.mjs.map +1 -0
  15. package/chunk-4QEMWG7O.js +9 -0
  16. package/chunk-4QEMWG7O.js.map +1 -0
  17. package/chunk-5P3VTPML.js +3 -0
  18. package/{chunk-NC2GTDRQ.js.map → chunk-5P3VTPML.js.map} +1 -1
  19. package/chunk-625O473M.js +2 -0
  20. package/{chunk-OSY2733O.js.map → chunk-625O473M.js.map} +1 -1
  21. package/chunk-6YRPQDCQ.js +3 -0
  22. package/chunk-6YRPQDCQ.js.map +1 -0
  23. package/chunk-7EFML44G.mjs +2 -0
  24. package/{chunk-SIUJSGLY.mjs.map → chunk-7EFML44G.mjs.map} +1 -1
  25. package/chunk-BQFMEVY7.mjs +2 -0
  26. package/{chunk-JN7GGZ4M.mjs.map → chunk-BQFMEVY7.mjs.map} +1 -1
  27. package/chunk-D54C47WZ.js +3 -0
  28. package/chunk-D54C47WZ.js.map +1 -0
  29. package/chunk-ERI7F7XK.mjs +2 -0
  30. package/{chunk-7ETB5HMM.mjs.map → chunk-ERI7F7XK.mjs.map} +1 -1
  31. package/chunk-EZXBN5GP.mjs +2 -0
  32. package/{chunk-EVCVARG4.mjs.map → chunk-EZXBN5GP.mjs.map} +1 -1
  33. package/chunk-GQ5RDDWL.js +2 -0
  34. package/chunk-GQ5RDDWL.js.map +1 -0
  35. package/chunk-LK3SCAXS.mjs +3 -0
  36. package/chunk-LK3SCAXS.mjs.map +1 -0
  37. package/chunk-MBD33X6K.js +2 -0
  38. package/{chunk-QHZJEU27.js.map → chunk-MBD33X6K.js.map} +1 -1
  39. package/chunk-MUO76V7J.mjs +2 -0
  40. package/chunk-MUO76V7J.mjs.map +1 -0
  41. package/chunk-N3GPZUWF.js +2 -0
  42. package/{chunk-YLALZ254.js.map → chunk-N3GPZUWF.js.map} +1 -1
  43. package/chunk-P7PY2UZU.js +2 -0
  44. package/chunk-P7PY2UZU.js.map +1 -0
  45. package/chunk-S7SXQ5YW.js +2 -0
  46. package/chunk-S7SXQ5YW.js.map +1 -0
  47. package/chunk-SVD4N6WD.mjs +2 -0
  48. package/chunk-SVD4N6WD.mjs.map +1 -0
  49. package/chunk-TK36GS4S.mjs +2 -0
  50. package/chunk-TK36GS4S.mjs.map +1 -0
  51. package/chunk-URZAN6FW.mjs +2 -0
  52. package/chunk-URZAN6FW.mjs.map +1 -0
  53. package/chunk-VLK44HNO.js +2 -0
  54. package/chunk-VLK44HNO.js.map +1 -0
  55. package/chunk-WKL5H4H7.mjs +3 -0
  56. package/{chunk-FN4GXMF4.mjs.map → chunk-WKL5H4H7.mjs.map} +1 -1
  57. package/chunk-X7ZT44GS.mjs +3 -0
  58. package/chunk-X7ZT44GS.mjs.map +1 -0
  59. package/chunk-YIIWZSIU.mjs +2 -0
  60. package/chunk-YIIWZSIU.mjs.map +1 -0
  61. package/index.js +1 -1
  62. package/index.js.map +1 -1
  63. package/index.mjs +1 -1
  64. package/index.mjs.map +1 -1
  65. package/nonStaticVideoTag-BZO26CR6.mjs +2 -0
  66. package/nonStaticVideoTag-BZO26CR6.mjs.map +1 -0
  67. package/nonStaticVideoTag-JELPXYMC.js +2 -0
  68. package/nonStaticVideoTag-JELPXYMC.js.map +1 -0
  69. package/notActive-6YGA2KBW.mjs +2 -0
  70. package/notActive-6YGA2KBW.mjs.map +1 -0
  71. package/notActive-OUUHLJZR.js +2 -0
  72. package/notActive-OUUHLJZR.js.map +1 -0
  73. package/package.json +3 -1
  74. package/staticPlayer-7J5RWSHH.js +2 -0
  75. package/{staticPlayer-3W6QCPZ6.js.map → staticPlayer-7J5RWSHH.js.map} +1 -1
  76. package/staticPlayer-XH4LGDPF.mjs +2 -0
  77. package/{staticPlayer-77XXBVBE.mjs.map → staticPlayer-XH4LGDPF.mjs.map} +1 -1
  78. package/staticVideoTag-52O7SA4Z.mjs +2 -0
  79. package/staticVideoTag-52O7SA4Z.mjs.map +1 -0
  80. package/staticVideoTag-PIZCH6BN.js +2 -0
  81. package/staticVideoTag-PIZCH6BN.js.map +1 -0
  82. package/videoArea-UQRRMDPQ.mjs +2 -0
  83. package/{videoArea-YOSYZHQQ.mjs.map → videoArea-UQRRMDPQ.mjs.map} +1 -1
  84. package/videoArea-XFD6PYG5.js +2 -0
  85. package/{videoArea-A6D3HM3U.js.map → videoArea-XFD6PYG5.js.map} +1 -1
  86. package/videoPlayerStyles.css +770 -369
  87. package/vodPlayer-DWFSTDUG.js +2 -0
  88. package/vodPlayer-DWFSTDUG.js.map +1 -0
  89. package/vodPlayer-KWNNVRZ2.mjs +2 -0
  90. package/vodPlayer-KWNNVRZ2.mjs.map +1 -0
  91. package/VideoHighLighter-7ZTDZTLI.js +0 -2
  92. package/VideoHighLighter-7ZTDZTLI.js.map +0 -1
  93. package/VideoHighLighter-AFFHM736.mjs +0 -2
  94. package/VideoHighLighter-AFFHM736.mjs.map +0 -1
  95. package/backwardForward-4MFTG3TO.mjs +0 -2
  96. package/backwardForward-4MFTG3TO.mjs.map +0 -1
  97. package/backwardForward-SU2BYEPF.js +0 -2
  98. package/backwardForward-SU2BYEPF.js.map +0 -1
  99. package/chunk-57JM26ZJ.js +0 -3
  100. package/chunk-57JM26ZJ.js.map +0 -1
  101. package/chunk-5T3RMISU.mjs +0 -2
  102. package/chunk-5T3RMISU.mjs.map +0 -1
  103. package/chunk-7ETB5HMM.mjs +0 -2
  104. package/chunk-AO7ESPGQ.js +0 -3
  105. package/chunk-AO7ESPGQ.js.map +0 -1
  106. package/chunk-APSWLMMW.mjs +0 -2
  107. package/chunk-APSWLMMW.mjs.map +0 -1
  108. package/chunk-APV3JQFO.js +0 -2
  109. package/chunk-C2CARY7S.mjs +0 -3
  110. package/chunk-C2CARY7S.mjs.map +0 -1
  111. package/chunk-EVCVARG4.mjs +0 -2
  112. package/chunk-F6EOQVUS.mjs +0 -3
  113. package/chunk-F6EOQVUS.mjs.map +0 -1
  114. package/chunk-FN4GXMF4.mjs +0 -3
  115. package/chunk-GBOKPFGS.mjs +0 -2
  116. package/chunk-GBOKPFGS.mjs.map +0 -1
  117. package/chunk-ICFZXPSX.mjs +0 -2
  118. package/chunk-ICFZXPSX.mjs.map +0 -1
  119. package/chunk-JN7GGZ4M.mjs +0 -2
  120. package/chunk-NC2GTDRQ.js +0 -3
  121. package/chunk-NXC6LNWJ.mjs +0 -2
  122. package/chunk-NXC6LNWJ.mjs.map +0 -1
  123. package/chunk-OSY2733O.js +0 -2
  124. package/chunk-PQYKJMAJ.js +0 -2
  125. package/chunk-PQYKJMAJ.js.map +0 -1
  126. package/chunk-PYFXHYM2.js +0 -2
  127. package/chunk-QHZJEU27.js +0 -2
  128. package/chunk-S5LQUBEU.js +0 -2
  129. package/chunk-S5LQUBEU.js.map +0 -1
  130. package/chunk-SIUJSGLY.mjs +0 -2
  131. package/chunk-T3642PUS.js +0 -9
  132. package/chunk-T3642PUS.js.map +0 -1
  133. package/chunk-TZLABRRX.js +0 -2
  134. package/chunk-TZLABRRX.js.map +0 -1
  135. package/chunk-U36G6FDJ.mjs +0 -9
  136. package/chunk-U36G6FDJ.mjs.map +0 -1
  137. package/chunk-UXV4E3XX.js +0 -2
  138. package/chunk-UXV4E3XX.js.map +0 -1
  139. package/chunk-WIZGC4ZC.mjs +0 -2
  140. package/chunk-WIZGC4ZC.mjs.map +0 -1
  141. package/chunk-WO4IQUGO.js +0 -2
  142. package/chunk-WO4IQUGO.js.map +0 -1
  143. package/chunk-YLALZ254.js +0 -2
  144. package/nonStaticVideoTag-DL3E22JR.mjs +0 -2
  145. package/nonStaticVideoTag-DL3E22JR.mjs.map +0 -1
  146. package/nonStaticVideoTag-JN2G2XU6.js +0 -2
  147. package/nonStaticVideoTag-JN2G2XU6.js.map +0 -1
  148. package/notActive-GJH44UT4.mjs +0 -2
  149. package/notActive-GJH44UT4.mjs.map +0 -1
  150. package/notActive-NUYPZI3E.js +0 -2
  151. package/notActive-NUYPZI3E.js.map +0 -1
  152. package/staticPlayer-3W6QCPZ6.js +0 -2
  153. package/staticPlayer-77XXBVBE.mjs +0 -2
  154. package/staticVideoTag-NA52BY63.js +0 -2
  155. package/staticVideoTag-NA52BY63.js.map +0 -1
  156. package/staticVideoTag-WY7P5PYR.mjs +0 -2
  157. package/staticVideoTag-WY7P5PYR.mjs.map +0 -1
  158. package/touchVolumeBrightness-7IMZAU3W.mjs +0 -3
  159. package/touchVolumeBrightness-7IMZAU3W.mjs.map +0 -1
  160. package/touchVolumeBrightness-TLA5Z2OU.js +0 -3
  161. package/touchVolumeBrightness-TLA5Z2OU.js.map +0 -1
  162. package/videoArea-A6D3HM3U.js +0 -2
  163. package/videoArea-YOSYZHQQ.mjs +0 -2
  164. package/vodPlayer-LEWG44XX.js +0 -2
  165. package/vodPlayer-LEWG44XX.js.map +0 -1
  166. package/vodPlayer-PTUN2V3I.mjs +0 -2
  167. package/vodPlayer-PTUN2V3I.mjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk625O473M_js=require('./chunk-625O473M.js'),chunkGQ5RDDWL_js=require('./chunk-GQ5RDDWL.js'),chunkD54C47WZ_js=require('./chunk-D54C47WZ.js'),chunk6YRPQDCQ_js=require('./chunk-6YRPQDCQ.js'),chunkS7SXQ5YW_js=require('./chunk-S7SXQ5YW.js'),reactRedux=require('react-redux'),jsxRuntime=require('react/jsx-runtime'),reactCircularProgressbar=require('react-circular-progressbar'),r=require('next/legacy/image');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var r__default=/*#__PURE__*/_interopDefault(r);chunkS7SXQ5YW_js.e();chunkS7SXQ5YW_js.e();var h=()=>jsxRuntime.jsx("div",{role:"status",className:`pl-size-full pl-flex pl-items-center pl-justify-center pl-bg-gray-300 ${!chunk6YRPQDCQ_js.t("isTouchScreen")&&"pl-rounded-lg"} pl-animate-pulse dark:pl-bg-gray-700`,children:jsxRuntime.jsx("span",{className:"pl-sr-only",children:"Loading..."})}),u=h;var y=()=>{let{params:e}=chunkS7SXQ5YW_js.A(({videoData:{params:f}})=>({params:f}),reactRedux.shallowEqual);return chunk625O473M_js.a(),jsxRuntime.jsxs("div",{id:"video-area",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video !pl-overflow-hidden ${chunk6YRPQDCQ_js.t("isTouchScreen")&&"!pl-rounded-none"} ${chunk6YRPQDCQ_js.t("isFullScreen")&&"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none"}`,children:[e.vhl_status&&e.vhl_status!=="skeleton"&&jsxRuntime.jsxs("div",{className:"pl-flex pl-flex-col pl-justify-between pl-gap-2 pl-size-full",children:[e.banner&&jsxRuntime.jsxs("div",{className:"pl-w-full pl-aspect-video pl-absolute",children:[jsxRuntime.jsx(r__default.default,{src:e.banner,alt:"banner",layout:"fill",className:"pl-w-full pl-aspect-video"}),jsxRuntime.jsx("div",{className:"pl-absolute pl-inset-0 pl-bg-black/50"})]}),jsxRuntime.jsx("div",{}),e.vhl_status==="download_start"&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] tablet:!pl-max-w-[305px] desktop:!pl-max-w-[198px] pl-mx-auto pl-py-2 tablet:pl-py-[12.32px] desktop:pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2 tablet:pl-gap-[12.32px] desktop:pl-gap-2",children:[jsxRuntime.jsx("svg",{style:{height:0,position:"absolute"},children:jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"gradientColor",x1:"0",y1:"0",x2:"1",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#FF649D"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#A50C4B"})]})})}),jsxRuntime.jsx(reactCircularProgressbar.CircularProgressbarWithChildren,{value:e.vhl_progress,className:"pl-size-[50px]",styles:reactCircularProgressbar.buildStyles({trailColor:"rgba(0, 0, 0, 0.1)",pathColor:"url(#gradientColor)"}),children:jsxRuntime.jsxs("p",{className:"pl-text-text-primary pl-text-[14px] pl-font-medium",children:["%",e.vhl_progress]})}),jsxRuntime.jsx("p",{className:"pl-text-text-primary pl-text-[10px] pl-font-normal",children:e.vhl_statusText})]})}),e.vhl_status==="download_error"&&jsxRuntime.jsxs("div",{className:"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] pl-mx-auto pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2",children:[jsxRuntime.jsx(r__default.default,{alt:"info-circle-icon",src:chunkD54C47WZ_js.a.infoCircle,width:32,height:32}),jsxRuntime.jsx("p",{className:"pl-text-[10px] pl-font-normal pl-text-text-primary",children:e.vhl_statusText}),jsxRuntime.jsxs("button",{className:"pl-flex pl-items-center pl-gap-2",onClick:()=>e.vhl_onRetry(),children:[jsxRuntime.jsx(r__default.default,{alt:"rotate-red-icon",src:chunkD54C47WZ_js.a.rotateRed,width:14,height:14}),jsxRuntime.jsx("span",{className:"pl-text-primary pl-text-[10px] pl-font-normal",children:"\u062A\u0644\u0627\u0634 \u062F\u0648\u0628\u0627\u0631\u0647"})]})]}),jsxRuntime.jsxs("div",{className:`pl-flex ${chunk6YRPQDCQ_js.t("isTouchScreenPortrait")?"pl-flex-col":`pl-flex-col-reverse pl-mb-3 ${chunk6YRPQDCQ_js.t("isFullScreen")&&"pl-mb-8"}`} pl-gap-[14.58px]`,children:[jsxRuntime.jsxs("div",{className:`pl-flex pl-items-center pl-justify-between ${chunk6YRPQDCQ_js.t("isFullScreen")?"pl-mx-8":"pl-mx-[14.58px]"}`,children:[jsxRuntime.jsx(chunkGQ5RDDWL_js.c,{width:20,height:20}),jsxRuntime.jsxs("div",{className:"pl-flex pl-items-center pl-gap-[14.58px]",children:[e.vhl_duration&&jsxRuntime.jsxs("div",{className:"pl-text-Common-white pl-text-[10.93px] pl-font-normal pl-relative",children:[jsxRuntime.jsx("span",{children:chunk6YRPQDCQ_js.ha(0)}),jsxRuntime.jsx("span",{children:"/"}),jsxRuntime.jsx("span",{children:chunk6YRPQDCQ_js.ha(e.vhl_duration)})]}),jsxRuntime.jsx(chunkGQ5RDDWL_js.b,{width:20,height:20})]})]}),jsxRuntime.jsx("div",{className:"pl-w-full pl-h-[3.64px] pl-bg-gray-highLight pl-animate-pulse"})]})]}),e.vhl_status==="skeleton"&&jsxRuntime.jsx(u,{})]})},R=y;module.exports=R;//# sourceMappingURL=VideoHighLighter-AHM2SNBQ.js.map
2
+ //# sourceMappingURL=VideoHighLighter-AHM2SNBQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/videoHighLighter/VideoHighLighter.tsx","../src/videoPlayerLibrary/components/custom-components/skeleton/Skeleton.tsx"],"names":["init_cjs_shims","Skeleton","jsx","conditions","Skeleton_default","VideoHighLighter","params","useAppSelector","shallowEqual","useFullScreen_default","jsxs","Image","Fragment","CircularProgressbarWithChildren","buildStyles","importImages_default","fullScreen_default","secondsToHMS","soundVolume_default","Video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A,CAAI,GACtC,CAAA,CAAA,CACF,CAAA,CACAhB,eAAC,KAAA,CAAA,CAAI,SAAA,CAAU,gEAAgE,CAAA,CAAA,CACjF,CAAA,CAAA,CACF,EAEDI,CAAAA,CAAO,UAAA,GAAe,YAAcJ,cAAAA,CAACE,CAAAA,CAAA,EAAS,CAAA,CAAA,CACjD,CAEJ,EAEOe,CAAAA,CAAQd","file":"VideoHighLighter-AHM2SNBQ.js","sourcesContent":["import { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport Skeleton from \"../../custom-components/skeleton/Skeleton\";\r\nimport FullScreen from \"../../custom-components/fullScreen/fullScreen\";\r\nimport SoundVolume from \"../../custom-components/soundVolume/soundVolume\";\r\nimport { secondsToHMS } from \"../../../helpers/helpers\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { buildStyles, CircularProgressbarWithChildren } from \"react-circular-progressbar\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/legacy/image\";\r\nimport useFullScreen from \"../../../helpers/hooks/useFullScreen\";\r\n\r\nconst VideoHighLighter = () => {\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n useFullScreen();\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n className={`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video !pl-overflow-hidden ${\r\n conditions(ConditionName.isTouchScreen) && \"!pl-rounded-none\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none\"}`}\r\n >\r\n {params.vhl_status && params.vhl_status !== \"skeleton\" && (\r\n <div className=\"pl-flex pl-flex-col pl-justify-between pl-gap-2 pl-size-full\">\r\n {params.banner && (\r\n <div className=\"pl-w-full pl-aspect-video pl-absolute\">\r\n <Image src={params.banner} alt=\"banner\" layout=\"fill\" className=\"pl-w-full pl-aspect-video\" />\r\n <div className=\"pl-absolute pl-inset-0 pl-bg-black/50\" />\r\n </div>\r\n )}\r\n <div />\r\n {params.vhl_status === \"download_start\" && (\r\n <>\r\n <div className=\"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] tablet:!pl-max-w-[305px] desktop:!pl-max-w-[198px] pl-mx-auto pl-py-2 tablet:pl-py-[12.32px] desktop:pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2 tablet:pl-gap-[12.32px] desktop:pl-gap-2\">\r\n <svg style={{ height: 0, position: \"absolute\" }}>\r\n <defs>\r\n <linearGradient id=\"gradientColor\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stopColor=\"#FF649D\" />\r\n <stop offset=\"100%\" stopColor=\"#A50C4B\" />\r\n </linearGradient>\r\n </defs>\r\n </svg>\r\n <CircularProgressbarWithChildren\r\n value={params.vhl_progress!}\r\n className=\"pl-size-[50px]\"\r\n styles={buildStyles({\r\n trailColor: \"rgba(0, 0, 0, 0.1)\",\r\n pathColor: \"url(#gradientColor)\",\r\n })}\r\n >\r\n <p className=\"pl-text-text-primary pl-text-[14px] pl-font-medium\">%{params.vhl_progress}</p>\r\n </CircularProgressbarWithChildren>\r\n <p className=\"pl-text-text-primary pl-text-[10px] pl-font-normal\">{params.vhl_statusText}</p>\r\n </div>\r\n </>\r\n )}\r\n {params.vhl_status === \"download_error\" && (\r\n <div className=\"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] pl-mx-auto pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2\">\r\n <Image alt=\"info-circle-icon\" src={IMAGES.infoCircle} width={32} height={32} />\r\n <p className=\"pl-text-[10px] pl-font-normal pl-text-text-primary\">{params.vhl_statusText}</p>\r\n <button className=\"pl-flex pl-items-center pl-gap-2\" onClick={() => params.vhl_onRetry!()}>\r\n <Image alt=\"rotate-red-icon\" src={IMAGES.rotateRed} width={14} height={14} />\r\n <span className=\"pl-text-primary pl-text-[10px] pl-font-normal\">تلاش دوباره</span>\r\n </button>\r\n </div>\r\n )}\r\n <div\r\n className={`pl-flex ${\r\n !conditions(ConditionName.isTouchScreenPortrait)\r\n ? `pl-flex-col-reverse pl-mb-3 ${conditions(ConditionName.isFullScreen) && \"pl-mb-8\"}`\r\n : \"pl-flex-col\"\r\n } pl-gap-[14.58px]`}\r\n >\r\n <div className={`pl-flex pl-items-center pl-justify-between ${conditions(ConditionName.isFullScreen) ? \"pl-mx-8\" : \"pl-mx-[14.58px]\"}`}>\r\n <FullScreen width={20} height={20} />\r\n <div className={`pl-flex pl-items-center pl-gap-[14.58px]`}>\r\n {params.vhl_duration && (\r\n <div className=\"pl-text-Common-white pl-text-[10.93px] pl-font-normal pl-relative\">\r\n <span>{secondsToHMS(0)}</span>\r\n <span>/</span>\r\n <span>{secondsToHMS(params.vhl_duration)}</span>\r\n </div>\r\n )}\r\n <SoundVolume width={20} height={20} />\r\n </div>\r\n </div>\r\n <div className=\"pl-w-full pl-h-[3.64px] pl-bg-gray-highLight pl-animate-pulse\" />\r\n </div>\r\n </div>\r\n )}\r\n {params.vhl_status === \"skeleton\" && <Skeleton />}\r\n </div>\r\n );\r\n};\r\n\r\nexport default VideoHighLighter;\r\n","import { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\n\r\nconst Skeleton = () => {\r\n return (\r\n <div\r\n role=\"status\"\r\n className={`pl-size-full pl-flex pl-items-center pl-justify-center pl-bg-gray-300 ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-lg\"\r\n } pl-animate-pulse dark:pl-bg-gray-700`}\r\n >\r\n <span className=\"pl-sr-only\">Loading...</span>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Skeleton;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-BQFMEVY7.mjs';import {c,b}from'./chunk-MUO76V7J.mjs';import {a as a$1}from'./chunk-X7ZT44GS.mjs';import {t,ha}from'./chunk-LK3SCAXS.mjs';import {e,A}from'./chunk-SVD4N6WD.mjs';import {shallowEqual}from'react-redux';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {CircularProgressbarWithChildren,buildStyles}from'react-circular-progressbar';import r from'next/legacy/image';e();e();var g=()=>jsx("div",{role:"status",className:`pl-size-full pl-flex pl-items-center pl-justify-center pl-bg-gray-300 ${!t("isTouchScreen")&&"pl-rounded-lg"} pl-animate-pulse dark:pl-bg-gray-700`,children:jsx("span",{className:"pl-sr-only",children:"Loading..."})}),u=g;var N=()=>{let{params:e}=A(({videoData:{params:f}})=>({params:f}),shallowEqual);return a(),jsxs("div",{id:"video-area",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video !pl-overflow-hidden ${t("isTouchScreen")&&"!pl-rounded-none"} ${t("isFullScreen")&&"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none"}`,children:[e.vhl_status&&e.vhl_status!=="skeleton"&&jsxs("div",{className:"pl-flex pl-flex-col pl-justify-between pl-gap-2 pl-size-full",children:[e.banner&&jsxs("div",{className:"pl-w-full pl-aspect-video pl-absolute",children:[jsx(r,{src:e.banner,alt:"banner",layout:"fill",className:"pl-w-full pl-aspect-video"}),jsx("div",{className:"pl-absolute pl-inset-0 pl-bg-black/50"})]}),jsx("div",{}),e.vhl_status==="download_start"&&jsx(Fragment,{children:jsxs("div",{className:"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] tablet:!pl-max-w-[305px] desktop:!pl-max-w-[198px] pl-mx-auto pl-py-2 tablet:pl-py-[12.32px] desktop:pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2 tablet:pl-gap-[12.32px] desktop:pl-gap-2",children:[jsx("svg",{style:{height:0,position:"absolute"},children:jsx("defs",{children:jsxs("linearGradient",{id:"gradientColor",x1:"0",y1:"0",x2:"1",y2:"1",children:[jsx("stop",{offset:"0%",stopColor:"#FF649D"}),jsx("stop",{offset:"100%",stopColor:"#A50C4B"})]})})}),jsx(CircularProgressbarWithChildren,{value:e.vhl_progress,className:"pl-size-[50px]",styles:buildStyles({trailColor:"rgba(0, 0, 0, 0.1)",pathColor:"url(#gradientColor)"}),children:jsxs("p",{className:"pl-text-text-primary pl-text-[14px] pl-font-medium",children:["%",e.vhl_progress]})}),jsx("p",{className:"pl-text-text-primary pl-text-[10px] pl-font-normal",children:e.vhl_statusText})]})}),e.vhl_status==="download_error"&&jsxs("div",{className:"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] pl-mx-auto pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2",children:[jsx(r,{alt:"info-circle-icon",src:a$1.infoCircle,width:32,height:32}),jsx("p",{className:"pl-text-[10px] pl-font-normal pl-text-text-primary",children:e.vhl_statusText}),jsxs("button",{className:"pl-flex pl-items-center pl-gap-2",onClick:()=>e.vhl_onRetry(),children:[jsx(r,{alt:"rotate-red-icon",src:a$1.rotateRed,width:14,height:14}),jsx("span",{className:"pl-text-primary pl-text-[10px] pl-font-normal",children:"\u062A\u0644\u0627\u0634 \u062F\u0648\u0628\u0627\u0631\u0647"})]})]}),jsxs("div",{className:`pl-flex ${t("isTouchScreenPortrait")?"pl-flex-col":`pl-flex-col-reverse pl-mb-3 ${t("isFullScreen")&&"pl-mb-8"}`} pl-gap-[14.58px]`,children:[jsxs("div",{className:`pl-flex pl-items-center pl-justify-between ${t("isFullScreen")?"pl-mx-8":"pl-mx-[14.58px]"}`,children:[jsx(c,{width:20,height:20}),jsxs("div",{className:"pl-flex pl-items-center pl-gap-[14.58px]",children:[e.vhl_duration&&jsxs("div",{className:"pl-text-Common-white pl-text-[10.93px] pl-font-normal pl-relative",children:[jsx("span",{children:ha(0)}),jsx("span",{children:"/"}),jsx("span",{children:ha(e.vhl_duration)})]}),jsx(b,{width:20,height:20})]})]}),jsx("div",{className:"pl-w-full pl-h-[3.64px] pl-bg-gray-highLight pl-animate-pulse"})]})]}),e.vhl_status==="skeleton"&&jsx(u,{})]})},V=N;export{V as default};//# sourceMappingURL=VideoHighLighter-BYBKAK24.mjs.map
2
+ //# sourceMappingURL=VideoHighLighter-BYBKAK24.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/videoHighLighter/VideoHighLighter.tsx","../src/videoPlayerLibrary/components/custom-components/skeleton/Skeleton.tsx"],"names":["init_esm_shims","Skeleton","jsx","conditions","Skeleton_default","VideoHighLighter","params","useAppSelector","shallowEqual","useFullScreen_default","jsxs","Image","Fragment","CircularProgressbarWithChildren","buildStyles","importImages_default","fullScreen_default","secondsToHMS","soundVolume_default","VideoHighLighter_default"],"mappings":"sZAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAGA,IAAMC,EAAW,IAEbC,GAAAA,CAAC,OACC,IAAA,CAAK,QAAA,CACL,UAAW,CAAA,sEAAA,EACT,CAACC,iBAAsC,CAAA,EAAK,eAC9C,wCAEA,QAAA,CAAAD,GAAAA,CAAC,QAAK,SAAA,CAAU,YAAA,CAAa,sBAAU,CAAA,CACzC,CAAA,CAIGE,EAAQH,CAAAA,CDHf,IAAMI,EAAmB,IAAM,CAC7B,GAAM,CAAE,MAAA,CAAAC,CAAO,CAAA,CAAIC,CAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,MAAA,CAAAD,CAAO,CAAE,CAAA,IAAO,CAAE,OAAAA,CAAO,CAAA,CAAA,CAAIE,YAAY,CAAA,CAC3F,OAAAC,GAAc,CAGZC,IAAAA,CAAC,OACC,EAAA,CAAG,YAAA,CACH,UAAW,CAAA,sFAAA,EACTP,CAAAA,CAAAA,eAAsC,GAAK,kBAC7C,CAAA,CAAA,E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,SAAA,CAAY,iBAAiB,CAAA,CAAA,CAClI,QAAA,CAAA,CAAAD,IAACc,CAAAA,CAAA,CAAW,MAAO,EAAA,CAAI,MAAA,CAAQ,GAAI,CAAA,CACnCN,IAAAA,CAAC,OAAI,SAAA,CAAW,0CAAA,CACb,UAAAJ,CAAAA,CAAO,YAAA,EACNI,KAAC,KAAA,CAAA,CAAI,SAAA,CAAU,oEACb,QAAA,CAAA,CAAAR,GAAAA,CAAC,MAAA,CAAA,CAAM,QAAA,CAAAe,GAAa,CAAC,CAAA,CAAE,EACvBf,GAAAA,CAAC,MAAA,CAAA,CAAK,aAAC,CAAA,CACPA,GAAAA,CAAC,QAAM,QAAA,CAAAe,EAAAA,CAAaX,EAAO,YAAY,CAAA,CAAE,GAC3C,CAAA,CAEFJ,GAAAA,CAACgB,EAAA,CAAY,KAAA,CAAO,GAAI,MAAA,CAAQ,EAAA,CAAI,GACtC,CAAA,CAAA,CACF,CAAA,CACAhB,IAAC,KAAA,CAAA,CAAI,SAAA,CAAU,gEAAgE,CAAA,CAAA,CACjF,CAAA,CAAA,CACF,EAEDI,CAAAA,CAAO,UAAA,GAAe,YAAcJ,GAAAA,CAACE,CAAAA,CAAA,EAAS,CAAA,CAAA,CACjD,CAEJ,EAEOe,CAAAA,CAAQd","file":"VideoHighLighter-BYBKAK24.mjs","sourcesContent":["import { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport Skeleton from \"../../custom-components/skeleton/Skeleton\";\r\nimport FullScreen from \"../../custom-components/fullScreen/fullScreen\";\r\nimport SoundVolume from \"../../custom-components/soundVolume/soundVolume\";\r\nimport { secondsToHMS } from \"../../../helpers/helpers\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { buildStyles, CircularProgressbarWithChildren } from \"react-circular-progressbar\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/legacy/image\";\r\nimport useFullScreen from \"../../../helpers/hooks/useFullScreen\";\r\n\r\nconst VideoHighLighter = () => {\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n useFullScreen();\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n className={`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video !pl-overflow-hidden ${\r\n conditions(ConditionName.isTouchScreen) && \"!pl-rounded-none\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none\"}`}\r\n >\r\n {params.vhl_status && params.vhl_status !== \"skeleton\" && (\r\n <div className=\"pl-flex pl-flex-col pl-justify-between pl-gap-2 pl-size-full\">\r\n {params.banner && (\r\n <div className=\"pl-w-full pl-aspect-video pl-absolute\">\r\n <Image src={params.banner} alt=\"banner\" layout=\"fill\" className=\"pl-w-full pl-aspect-video\" />\r\n <div className=\"pl-absolute pl-inset-0 pl-bg-black/50\" />\r\n </div>\r\n )}\r\n <div />\r\n {params.vhl_status === \"download_start\" && (\r\n <>\r\n <div className=\"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] tablet:!pl-max-w-[305px] desktop:!pl-max-w-[198px] pl-mx-auto pl-py-2 tablet:pl-py-[12.32px] desktop:pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2 tablet:pl-gap-[12.32px] desktop:pl-gap-2\">\r\n <svg style={{ height: 0, position: \"absolute\" }}>\r\n <defs>\r\n <linearGradient id=\"gradientColor\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stopColor=\"#FF649D\" />\r\n <stop offset=\"100%\" stopColor=\"#A50C4B\" />\r\n </linearGradient>\r\n </defs>\r\n </svg>\r\n <CircularProgressbarWithChildren\r\n value={params.vhl_progress!}\r\n className=\"pl-size-[50px]\"\r\n styles={buildStyles({\r\n trailColor: \"rgba(0, 0, 0, 0.1)\",\r\n pathColor: \"url(#gradientColor)\",\r\n })}\r\n >\r\n <p className=\"pl-text-text-primary pl-text-[14px] pl-font-medium\">%{params.vhl_progress}</p>\r\n </CircularProgressbarWithChildren>\r\n <p className=\"pl-text-text-primary pl-text-[10px] pl-font-normal\">{params.vhl_statusText}</p>\r\n </div>\r\n </>\r\n )}\r\n {params.vhl_status === \"download_error\" && (\r\n <div className=\"pl-relative pl-z-[1000000] pl-bg-Common-white-overlay-1 pl-w-full pl-max-w-[198px] pl-mx-auto pl-py-2 pl-rounded-[8px] pl-flex pl-flex-col pl-items-center pl-gap-2\">\r\n <Image alt=\"info-circle-icon\" src={IMAGES.infoCircle} width={32} height={32} />\r\n <p className=\"pl-text-[10px] pl-font-normal pl-text-text-primary\">{params.vhl_statusText}</p>\r\n <button className=\"pl-flex pl-items-center pl-gap-2\" onClick={() => params.vhl_onRetry!()}>\r\n <Image alt=\"rotate-red-icon\" src={IMAGES.rotateRed} width={14} height={14} />\r\n <span className=\"pl-text-primary pl-text-[10px] pl-font-normal\">تلاش دوباره</span>\r\n </button>\r\n </div>\r\n )}\r\n <div\r\n className={`pl-flex ${\r\n !conditions(ConditionName.isTouchScreenPortrait)\r\n ? `pl-flex-col-reverse pl-mb-3 ${conditions(ConditionName.isFullScreen) && \"pl-mb-8\"}`\r\n : \"pl-flex-col\"\r\n } pl-gap-[14.58px]`}\r\n >\r\n <div className={`pl-flex pl-items-center pl-justify-between ${conditions(ConditionName.isFullScreen) ? \"pl-mx-8\" : \"pl-mx-[14.58px]\"}`}>\r\n <FullScreen width={20} height={20} />\r\n <div className={`pl-flex pl-items-center pl-gap-[14.58px]`}>\r\n {params.vhl_duration && (\r\n <div className=\"pl-text-Common-white pl-text-[10.93px] pl-font-normal pl-relative\">\r\n <span>{secondsToHMS(0)}</span>\r\n <span>/</span>\r\n <span>{secondsToHMS(params.vhl_duration)}</span>\r\n </div>\r\n )}\r\n <SoundVolume width={20} height={20} />\r\n </div>\r\n </div>\r\n <div className=\"pl-w-full pl-h-[3.64px] pl-bg-gray-highLight pl-animate-pulse\" />\r\n </div>\r\n </div>\r\n )}\r\n {params.vhl_status === \"skeleton\" && <Skeleton />}\r\n </div>\r\n );\r\n};\r\n\r\nexport default VideoHighLighter;\r\n","import { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\n\r\nconst Skeleton = () => {\r\n return (\r\n <div\r\n role=\"status\"\r\n className={`pl-size-full pl-flex pl-items-center pl-justify-center pl-bg-gray-300 ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-lg\"\r\n } pl-animate-pulse dark:pl-bg-gray-700`}\r\n >\r\n <span className=\"pl-sr-only\">Loading...</span>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Skeleton;\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkVLK44HNO_js=require('./chunk-VLK44HNO.js'),chunkD54C47WZ_js=require('./chunk-D54C47WZ.js'),chunk6YRPQDCQ_js=require('./chunk-6YRPQDCQ.js'),chunkS7SXQ5YW_js=require('./chunk-S7SXQ5YW.js'),react=require('react'),reactRedux=require('react-redux'),useDoubleTap=require('use-double-tap'),J=require('next/image'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var J__default=/*#__PURE__*/_interopDefault(J);chunkS7SXQ5YW_js.e();var w=1e3,x=10,v=chunk6YRPQDCQ_js.t("isTouchScreen")?x:0,R=({type:e,isRightForward:g,isLeftBackward:P,setIsRightForward:c,setIsLeftBackward:i})=>{let[m,u]=react.useState(v),[A,n]=react.useState(false),a=react.useRef(m),o=react.useRef(null),f=chunkS7SXQ5YW_js.z();chunkS7SXQ5YW_js.A(({controller:{currentTime:r,duration:t}})=>({currentTime:r,duration:t}),reactRedux.shallowEqual);let {videoElementSizeInfo:N}=chunkS7SXQ5YW_js.A(({videoData:{videoElementSizeInfo:r,params:t}})=>({videoElementSizeInfo:r,params:t}),reactRedux.shallowEqual),h=["touchBackward","backward"];react.useEffect(()=>{a.current=m;},[m]);let C;C=useDoubleTap.useDoubleTap(r=>{["touchBackward","touchForward"].includes(e)&&(r.stopPropagation(),e==="touchBackward"&&i?(i(true),f(chunkS7SXQ5YW_js.k(false))):e==="touchForward"&&c&&(c(true),f(chunkS7SXQ5YW_js.k(false))),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));},200),react.useEffect(()=>{A&&(n(false),g&&c?(c(false),chunk6YRPQDCQ_js.u().duration-chunk6YRPQDCQ_js.u().currentTime<=a.current?chunk6YRPQDCQ_js.Y(e,chunk6YRPQDCQ_js.u().duration):chunk6YRPQDCQ_js.Y(e,a.current),u(v)):P&&i&&(i(false),chunk6YRPQDCQ_js.u().currentTime<=a.current?chunk6YRPQDCQ_js.Y(e,0):chunk6YRPQDCQ_js.Y(e,a.current),u(v)));},[A,e]);let G=r=>{u(t=>t+x),chunk6YRPQDCQ_js.t("isTouchScreenLandscape")&&chunk6YRPQDCQ_js.la(r,e),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w);};if(chunkVLK44HNO_js.a("ArrowRight",r=>{chunk6YRPQDCQ_js.t("isPressKeyArrowRight")&&e==="forward"&&(r.stopPropagation(),u(t=>t+x),f(chunkS7SXQ5YW_js.k(true)),c&&c(true),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));}),chunkVLK44HNO_js.a("ArrowLeft",r=>{chunk6YRPQDCQ_js.t("isPressKeyArrowLeft")&&e==="backward"&&(r.stopPropagation(),u(t=>t+x),f(chunkS7SXQ5YW_js.k(true)),i&&i(true),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));}),e)return jsxRuntime.jsx("div",{id:e,className:`pl-relative pl-flex pl-flex-col pl-justify-center ${chunk6YRPQDCQ_js.t("isTouchScreen")?"pl-px-[24px]":"pl-px-[48px]"} ${h.includes(e)?"pl-items-end":"pl-items-start"} pl-gap-2 pl-overflow-hidden`,style:{width:N.width,height:N.width},...C,children:(g||P)&&jsxRuntime.jsxs("div",{className:chunk6YRPQDCQ_js.da(`pl-rounded-full pl-flex pl-justify-center pl-items-center ${h.includes(e)?"":"pl-flex-row-reverse"}`,{desktop:"pl-gap-2",desktopFullScreen:"pl-gap-1",touch:"pl-gap-1",touchFullScreen:"pl-gap-1.5"}),onTouchStart:chunk6YRPQDCQ_js.t("isTouchScreen")?G:void 0,children:[jsxRuntime.jsxs("p",{className:chunk6YRPQDCQ_js.da("pl-text-center pl-text-white ",{desktop:"pl-text-[16px] pl-font-extrabold pl-mt-0.5",desktopFullScreen:"pl-text-[32px] pl-font-bold",touch:"pl-text-base pl-font-extrabold pl-mt-0.5",touchFullScreen:"pl-text-[20px] pl-font-bold"}),children:[m,h.includes(e)?" - ":" + "]}),jsxRuntime.jsx("div",{className:"pl-flex pl-justify-center pl-items-center",children:jsxRuntime.jsx(J__default.default,{src:chunkD54C47WZ_js.a.chevronLeft,width:chunk6YRPQDCQ_js.ea({desktop:20,desktopFullScreen:40,touch:16,touchFullScreen:20}),height:chunk6YRPQDCQ_js.ea({desktop:20,desktopFullScreen:40,touch:16,touchFullScreen:20}),alt:"",className:` pl-object-cover ${h.includes(e)?"":"pl-rotate-180"}`})})]})})},le=R;module.exports=le;//# sourceMappingURL=backwardForward-FNZM2W73.js.map
2
+ //# sourceMappingURL=backwardForward-FNZM2W73.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx"],"names":["init_cjs_shims","hideTime","jump","initialJump","conditions","BackwardForward","type","isRightForward","isLeftBackward","setIsRightForward","setIsLeftBackward","backwardForwardCount","setBackwardForwardCount","useState","hide","setHide","backwardForwardCountRef","useRef","timeoutRef","dispatch","useAppDispatch","useAppSelector","currentTime","duration","shallowEqual","videoElementSizeInfo","params","isLeft","useEffect","doubleTouch","useDoubleTap","event","setActiveElements","mainPlayerVideoTag","handleBackwardForward","handleTouchStart","prev","handleRippleCircle","useK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C,CAC9C,OAAA,CAAS,4CAAA,CACT,iBAAA,CAAmB,6BAAA,CACnB,KAAA,CAAO,0CAAA,CACP,eAAA,CAAiB,6BACnB,CAAC,CAAA,CAEA,QAAA,CAAA,CAAA9B,CAAAA,CACAgB,CAAAA,CAAO,QAAA,CAASrB,CAAI,CAAA,CAAI,KAAA,CAAQ,KAAA,CAAA,CACnC,CAAA,CACAiC,cAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAW,2CAAA,CACd,QAAA,CAAAA,cAAAA,CAACG,kBAAAA,CAAA,CACC,GAAA,CAAKC,kBAAAA,CAAO,WAAA,CACZ,KAAA,CAAOC,mBAAAA,CAAW,CAAE,OAAA,CAAS,EAAA,CAAI,iBAAA,CAAmB,EAAA,CAAI,KAAA,CAAO,EAAA,CAAI,eAAA,CAAiB,EAAG,CAAC,CAAA,CACxF,MAAA,CAAQA,mBAAAA,CAAW,CAAE,OAAA,CAAS,EAAA,CAAI,iBAAA,CAAmB,EAAA,CAAI,KAAA,CAAO,EAAA,CAAI,eAAA,CAAiB,EAAG,CAAC,CAAA,CACzF,GAAA,CAAI,EAAA,CACJ,SAAA,CAAW,CAAA,iBAAA,EAAoBjB,CAAAA,CAAO,QAAA,CAASrB,CAAI,CAAA,CAAI,EAAA,CAAK,eAAe,CAAA,CAAA,CAC7E,CAAA,CAuBF,CAAA,CAAA,CACF,CAAA,CAEJ,CAEN,CAAA,CAEOuC,EAAAA,CAAQxC","file":"backwardForward-FNZM2W73.js","sourcesContent":["import { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useDoubleTap } from \"use-double-tap\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { IBackwardForwardProps } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleBackwardForward } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleRippleCircle, styleMerge, tw } from \"../../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport useKeyPress from \"../../../helpers/hooks/useKeyPress\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/image\";\r\n\r\nconst hideTime = 1000;\r\nconst jump = 10;\r\nconst initialJump = conditions(ConditionName.isTouchScreen) ? jump : 0;\r\n\r\nconst BackwardForward = ({ type, isRightForward, isLeftBackward, setIsRightForward, setIsLeftBackward }: IBackwardForwardProps) => {\r\n const [backwardForwardCount, setBackwardForwardCount] = useState<number>(initialJump);\r\n const [hide, setHide] = useState<boolean>(false);\r\n\r\n const backwardForwardCountRef = useRef<number>(backwardForwardCount);\r\n const timeoutRef = useRef<any>(null);\r\n\r\n const dispatch = useAppDispatch();\r\n\r\n useAppSelector(({ controller: { currentTime, duration } }) => ({ currentTime, duration }), shallowEqual);\r\n\r\n const { videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),\r\n shallowEqual\r\n );\r\n\r\n const isRight = [\"touchForward\", \"forward\"];\r\n const isLeft = [\"touchBackward\", \"backward\"];\r\n\r\n useEffect(() => {\r\n backwardForwardCountRef.current = backwardForwardCount;\r\n }, [backwardForwardCount]);\r\n\r\n let doubleTouch: any = undefined;\r\n\r\n doubleTouch = useDoubleTap((event) => {\r\n if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n event.stopPropagation();\r\n if (type === \"touchBackward\" && setIsLeftBackward) {\r\n setIsLeftBackward(true);\r\n dispatch(setActiveElements(false));\r\n } else if (type === \"touchForward\" && setIsRightForward) {\r\n setIsRightForward(true);\r\n dispatch(setActiveElements(false));\r\n }\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n }, 200);\r\n\r\n useEffect(() => {\r\n if (hide) {\r\n setHide(false);\r\n if (isRightForward && setIsRightForward) {\r\n setIsRightForward(false);\r\n if (mainPlayerVideoTag().duration - mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current)\r\n handleBackwardForward(type, mainPlayerVideoTag().duration);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(initialJump);\r\n } else if (isLeftBackward && setIsLeftBackward) {\r\n setIsLeftBackward(false);\r\n if (mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, 0);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(initialJump);\r\n }\r\n }\r\n }, [hide, type]);\r\n\r\n const handleTouchStart = (event: any) => {\r\n setBackwardForwardCount((prev) => prev + jump);\r\n if (conditions(ConditionName.isTouchScreenLandscape)) handleRippleCircle(event, type);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n };\r\n\r\n useKeyPress(\"ArrowRight\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowRight) && type === \"forward\") {\r\n event.stopPropagation();\r\n setBackwardForwardCount((prev) => prev + jump);\r\n dispatch(setActiveElements(true));\r\n if (setIsRightForward) setIsRightForward(true);\r\n\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n });\r\n\r\n useKeyPress(\"ArrowLeft\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowLeft) && type === \"backward\") {\r\n event.stopPropagation();\r\n setBackwardForwardCount((prev) => prev + jump);\r\n dispatch(setActiveElements(true));\r\n if (setIsLeftBackward) setIsLeftBackward(true);\r\n\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n });\r\n\r\n if (type)\r\n return (\r\n <div\r\n id={type}\r\n className={`pl-relative pl-flex pl-flex-col pl-justify-center ${conditions(ConditionName.isTouchScreen) ? \"pl-px-[24px]\" : \"pl-px-[48px]\"} ${\r\n isLeft.includes(type) ? \"pl-items-end\" : \"pl-items-start\"\r\n } pl-gap-2 pl-overflow-hidden`}\r\n style={{ width: videoElementSizeInfo.width, height: videoElementSizeInfo.width }}\r\n {...doubleTouch}\r\n >\r\n {(isRightForward || isLeftBackward) && (\r\n <div\r\n className={tw(`pl-rounded-full pl-flex pl-justify-center pl-items-center ${isLeft.includes(type) ? \"\" : \"pl-flex-row-reverse\"}`, {\r\n desktop: \"pl-gap-2\",\r\n desktopFullScreen: \"pl-gap-1\",\r\n touch: \"pl-gap-1\",\r\n touchFullScreen: \"pl-gap-1.5\",\r\n })}\r\n onTouchStart={conditions(ConditionName.isTouchScreen) ? handleTouchStart : undefined}\r\n >\r\n <p\r\n className={tw(`pl-text-center pl-text-white `, {\r\n desktop: \"pl-text-[16px] pl-font-extrabold pl-mt-0.5\",\r\n desktopFullScreen: \"pl-text-[32px] pl-font-bold\",\r\n touch: \"pl-text-base pl-font-extrabold pl-mt-0.5\",\r\n touchFullScreen: \"pl-text-[20px] pl-font-bold\",\r\n })}\r\n >\r\n {backwardForwardCount}\r\n {isLeft.includes(type) ? \" - \" : \" + \"}\r\n </p>\r\n <div className={`pl-flex pl-justify-center pl-items-center`}>\r\n <Image\r\n src={IMAGES.chevronLeft}\r\n width={styleMerge({ desktop: 20, desktopFullScreen: 40, touch: 16, touchFullScreen: 20 })}\r\n height={styleMerge({ desktop: 20, desktopFullScreen: 40, touch: 16, touchFullScreen: 20 })}\r\n alt=\"\"\r\n className={` pl-object-cover ${isLeft.includes(type) ? \"\" : \"pl-rotate-180\"}`}\r\n />\r\n\r\n {/* <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n />\r\n <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n />\r\n <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n /> */}\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default BackwardForward;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-TK36GS4S.mjs';import {a as a$1}from'./chunk-X7ZT44GS.mjs';import {t,u,Y,da,ea,la}from'./chunk-LK3SCAXS.mjs';import {e,z,A,k}from'./chunk-SVD4N6WD.mjs';import {useState,useRef,useEffect}from'react';import {shallowEqual}from'react-redux';import {useDoubleTap}from'use-double-tap';import J from'next/image';import {jsx,jsxs}from'react/jsx-runtime';e();var w=1e3,x=10,v=t("isTouchScreen")?x:0,R=({type:e,isRightForward:g,isLeftBackward:P,setIsRightForward:c,setIsLeftBackward:i})=>{let[m,u$1]=useState(v),[A$1,n]=useState(false),a$2=useRef(m),o=useRef(null),f=z();A(({controller:{currentTime:r,duration:t}})=>({currentTime:r,duration:t}),shallowEqual);let {videoElementSizeInfo:N}=A(({videoData:{videoElementSizeInfo:r,params:t}})=>({videoElementSizeInfo:r,params:t}),shallowEqual),h=["touchBackward","backward"];useEffect(()=>{a$2.current=m;},[m]);let C;C=useDoubleTap(r=>{["touchBackward","touchForward"].includes(e)&&(r.stopPropagation(),e==="touchBackward"&&i?(i(true),f(k(false))):e==="touchForward"&&c&&(c(true),f(k(false))),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));},200),useEffect(()=>{A$1&&(n(false),g&&c?(c(false),u().duration-u().currentTime<=a$2.current?Y(e,u().duration):Y(e,a$2.current),u$1(v)):P&&i&&(i(false),u().currentTime<=a$2.current?Y(e,0):Y(e,a$2.current),u$1(v)));},[A$1,e]);let G=r=>{u$1(t=>t+x),t("isTouchScreenLandscape")&&la(r,e),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w);};if(a("ArrowRight",r=>{t("isPressKeyArrowRight")&&e==="forward"&&(r.stopPropagation(),u$1(t=>t+x),f(k(true)),c&&c(true),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));}),a("ArrowLeft",r=>{t("isPressKeyArrowLeft")&&e==="backward"&&(r.stopPropagation(),u$1(t=>t+x),f(k(true)),i&&i(true),clearTimeout(o.current),o.current=setTimeout(()=>n(true),w));}),e)return jsx("div",{id:e,className:`pl-relative pl-flex pl-flex-col pl-justify-center ${t("isTouchScreen")?"pl-px-[24px]":"pl-px-[48px]"} ${h.includes(e)?"pl-items-end":"pl-items-start"} pl-gap-2 pl-overflow-hidden`,style:{width:N.width,height:N.width},...C,children:(g||P)&&jsxs("div",{className:da(`pl-rounded-full pl-flex pl-justify-center pl-items-center ${h.includes(e)?"":"pl-flex-row-reverse"}`,{desktop:"pl-gap-2",desktopFullScreen:"pl-gap-1",touch:"pl-gap-1",touchFullScreen:"pl-gap-1.5"}),onTouchStart:t("isTouchScreen")?G:void 0,children:[jsxs("p",{className:da("pl-text-center pl-text-white ",{desktop:"pl-text-[16px] pl-font-extrabold pl-mt-0.5",desktopFullScreen:"pl-text-[32px] pl-font-bold",touch:"pl-text-base pl-font-extrabold pl-mt-0.5",touchFullScreen:"pl-text-[20px] pl-font-bold"}),children:[m,h.includes(e)?" - ":" + "]}),jsx("div",{className:"pl-flex pl-justify-center pl-items-center",children:jsx(J,{src:a$1.chevronLeft,width:ea({desktop:20,desktopFullScreen:40,touch:16,touchFullScreen:20}),height:ea({desktop:20,desktopFullScreen:40,touch:16,touchFullScreen:20}),alt:"",className:` pl-object-cover ${h.includes(e)?"":"pl-rotate-180"}`})})]})})},ce=R;export{ce as default};//# sourceMappingURL=backwardForward-QAVC3JUR.mjs.map
2
+ //# sourceMappingURL=backwardForward-QAVC3JUR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx"],"names":["init_esm_shims","hideTime","jump","initialJump","conditions","BackwardForward","type","isRightForward","isLeftBackward","setIsRightForward","setIsLeftBackward","backwardForwardCount","setBackwardForwardCount","useState","hide","setHide","backwardForwardCountRef","useRef","timeoutRef","dispatch","useAppDispatch","useAppSelector","currentTime","duration","shallowEqual","videoElementSizeInfo","params","isLeft","useEffect","doubleTouch","useDoubleTap","event","setActiveElements","mainPlayerVideoTag","handleBackwardForward","handleTouchStart","prev","handleRippleCircle","useKeyPress_default","jsx","jsxs","tw","Image","importImages_default","styleMerge","backwardForward_default"],"mappings":"gXAAAA,CAAAA,EAAAA,CAeA,IAAMC,CAAAA,CAAW,GAAA,CACXC,CAAAA,CAAO,EAAA,CACPC,CAAAA,CAAcC,CAAAA,CAAAA,eAAsC,CAAA,CAAIF,CAAAA,CAAO,CAAA,CAE/DG,CAAAA,CAAkB,CAAC,CAAE,IAAA,CAAAC,CAAAA,CAAM,cAAA,CAAAC,CAAAA,CAAgB,cAAA,CAAAC,CAAAA,CAAgB,iBAAA,CAAAC,CAAAA,CAAmB,iBAAA,CAAAC,CAAkB,CAAA,GAA6B,CACjI,GAAM,CAACC,CAAAA,CAAsBC,GAAuB,CAAA,CAAIC,QAAAA,CAAiBV,CAAW,CAAA,CAC9E,CAACW,GAAAA,CAAMC,CAAO,CAAA,CAAIF,QAAAA,CAAkB,KAAK,CAAA,CAEzCG,GAAAA,CAA0BC,MAAAA,CAAeN,CAAoB,CAAA,CAC7DO,CAAAA,CAAaD,MAAAA,CAAY,IAAI,CAAA,CAE7BE,CAAAA,CAAWC,CAAAA,EAAe,CAEhCC,CAAAA,CAAe,CAAC,CAAE,UAAA,CAAY,CAAE,WAAA,CAAAC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AAK,eAAe,CAAA,CAAA,CAC7E,CAAA,CAuBF,CAAA,CAAA,CACF,CAAA,CAEJ,CAEN,CAAA,CAEOuC,EAAAA,CAAQxC","file":"backwardForward-QAVC3JUR.mjs","sourcesContent":["import { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useDoubleTap } from \"use-double-tap\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { IBackwardForwardProps } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleBackwardForward } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleRippleCircle, styleMerge, tw } from \"../../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport useKeyPress from \"../../../helpers/hooks/useKeyPress\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/image\";\r\n\r\nconst hideTime = 1000;\r\nconst jump = 10;\r\nconst initialJump = conditions(ConditionName.isTouchScreen) ? jump : 0;\r\n\r\nconst BackwardForward = ({ type, isRightForward, isLeftBackward, setIsRightForward, setIsLeftBackward }: IBackwardForwardProps) => {\r\n const [backwardForwardCount, setBackwardForwardCount] = useState<number>(initialJump);\r\n const [hide, setHide] = useState<boolean>(false);\r\n\r\n const backwardForwardCountRef = useRef<number>(backwardForwardCount);\r\n const timeoutRef = useRef<any>(null);\r\n\r\n const dispatch = useAppDispatch();\r\n\r\n useAppSelector(({ controller: { currentTime, duration } }) => ({ currentTime, duration }), shallowEqual);\r\n\r\n const { videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),\r\n shallowEqual\r\n );\r\n\r\n const isRight = [\"touchForward\", \"forward\"];\r\n const isLeft = [\"touchBackward\", \"backward\"];\r\n\r\n useEffect(() => {\r\n backwardForwardCountRef.current = backwardForwardCount;\r\n }, [backwardForwardCount]);\r\n\r\n let doubleTouch: any = undefined;\r\n\r\n doubleTouch = useDoubleTap((event) => {\r\n if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n event.stopPropagation();\r\n if (type === \"touchBackward\" && setIsLeftBackward) {\r\n setIsLeftBackward(true);\r\n dispatch(setActiveElements(false));\r\n } else if (type === \"touchForward\" && setIsRightForward) {\r\n setIsRightForward(true);\r\n dispatch(setActiveElements(false));\r\n }\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n }, 200);\r\n\r\n useEffect(() => {\r\n if (hide) {\r\n setHide(false);\r\n if (isRightForward && setIsRightForward) {\r\n setIsRightForward(false);\r\n if (mainPlayerVideoTag().duration - mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current)\r\n handleBackwardForward(type, mainPlayerVideoTag().duration);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(initialJump);\r\n } else if (isLeftBackward && setIsLeftBackward) {\r\n setIsLeftBackward(false);\r\n if (mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, 0);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(initialJump);\r\n }\r\n }\r\n }, [hide, type]);\r\n\r\n const handleTouchStart = (event: any) => {\r\n setBackwardForwardCount((prev) => prev + jump);\r\n if (conditions(ConditionName.isTouchScreenLandscape)) handleRippleCircle(event, type);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n };\r\n\r\n useKeyPress(\"ArrowRight\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowRight) && type === \"forward\") {\r\n event.stopPropagation();\r\n setBackwardForwardCount((prev) => prev + jump);\r\n dispatch(setActiveElements(true));\r\n if (setIsRightForward) setIsRightForward(true);\r\n\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n });\r\n\r\n useKeyPress(\"ArrowLeft\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowLeft) && type === \"backward\") {\r\n event.stopPropagation();\r\n setBackwardForwardCount((prev) => prev + jump);\r\n dispatch(setActiveElements(true));\r\n if (setIsLeftBackward) setIsLeftBackward(true);\r\n\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n });\r\n\r\n if (type)\r\n return (\r\n <div\r\n id={type}\r\n className={`pl-relative pl-flex pl-flex-col pl-justify-center ${conditions(ConditionName.isTouchScreen) ? \"pl-px-[24px]\" : \"pl-px-[48px]\"} ${\r\n isLeft.includes(type) ? \"pl-items-end\" : \"pl-items-start\"\r\n } pl-gap-2 pl-overflow-hidden`}\r\n style={{ width: videoElementSizeInfo.width, height: videoElementSizeInfo.width }}\r\n {...doubleTouch}\r\n >\r\n {(isRightForward || isLeftBackward) && (\r\n <div\r\n className={tw(`pl-rounded-full pl-flex pl-justify-center pl-items-center ${isLeft.includes(type) ? \"\" : \"pl-flex-row-reverse\"}`, {\r\n desktop: \"pl-gap-2\",\r\n desktopFullScreen: \"pl-gap-1\",\r\n touch: \"pl-gap-1\",\r\n touchFullScreen: \"pl-gap-1.5\",\r\n })}\r\n onTouchStart={conditions(ConditionName.isTouchScreen) ? handleTouchStart : undefined}\r\n >\r\n <p\r\n className={tw(`pl-text-center pl-text-white `, {\r\n desktop: \"pl-text-[16px] pl-font-extrabold pl-mt-0.5\",\r\n desktopFullScreen: \"pl-text-[32px] pl-font-bold\",\r\n touch: \"pl-text-base pl-font-extrabold pl-mt-0.5\",\r\n touchFullScreen: \"pl-text-[20px] pl-font-bold\",\r\n })}\r\n >\r\n {backwardForwardCount}\r\n {isLeft.includes(type) ? \" - \" : \" + \"}\r\n </p>\r\n <div className={`pl-flex pl-justify-center pl-items-center`}>\r\n <Image\r\n src={IMAGES.chevronLeft}\r\n width={styleMerge({ desktop: 20, desktopFullScreen: 40, touch: 16, touchFullScreen: 20 })}\r\n height={styleMerge({ desktop: 20, desktopFullScreen: 40, touch: 16, touchFullScreen: 20 })}\r\n alt=\"\"\r\n className={` pl-object-cover ${isLeft.includes(type) ? \"\" : \"pl-rotate-180\"}`}\r\n />\r\n\r\n {/* <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n />\r\n <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n />\r\n <Image\r\n alt=\"arrow-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`pl-shrink-0 ${isLeft.includes(type) && \"pl-rotate-180\"}`}\r\n width={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n height={conditions(ConditionName.isFullScreen) ? 22 : 12}\r\n /> */}\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default BackwardForward;\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk5P3VTPML_js=require('./chunk-5P3VTPML.js'),chunk6YRPQDCQ_js=require('./chunk-6YRPQDCQ.js'),chunkS7SXQ5YW_js=require('./chunk-S7SXQ5YW.js');chunkS7SXQ5YW_js.e();var he=e=>{e.preventDefault();let t=(chunk6YRPQDCQ_js.u()||chunk6YRPQDCQ_js.v()).error;if(t)switch(t.code){case t.MEDIA_ERR_ABORTED:chunk6YRPQDCQ_js.N({type:"videoTagError",message:"You aborted the video playback."});break;case t.MEDIA_ERR_NETWORK:chunk6YRPQDCQ_js.N({type:"videoTagError",message:"A network error caused the video download to fail part-way."});break;case t.MEDIA_ERR_DECODE:chunk6YRPQDCQ_js.N({type:"videoTagError",message:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support."});break;case t.MEDIA_ERR_SRC_NOT_SUPPORTED:chunk6YRPQDCQ_js.N({type:"videoTagError",message:"The video could not be loaded, either because the server or network failed or because the format is not supported."});break;default:chunk6YRPQDCQ_js.N({type:"videoTagError",message:"An unknown error occurred."});break}else chunk6YRPQDCQ_js.N({type:"videoTagError",message:"An error occurred, but the error object is not available."});},G=()=>{let e=chunk6YRPQDCQ_js.za.dispatch,{params:t}=chunk6YRPQDCQ_js.za.getState().videoData,a=n=>{n.requestFullScreen?n.requestFullScreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullScreen&&n.webkitRequestFullScreen();};e(chunk6YRPQDCQ_js.s()),a(document.documentElement),e(chunkS7SXQ5YW_js.m(t.fullscreen==="true"));},ge=()=>{let e=".ts",t=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){arguments[1].endsWith(e)&&(arguments[1]=arguments[1]+"?uuid="+chunk6YRPQDCQ_js.fa()),t.apply(this,arguments);};},J=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch;t.current=setInterval(()=>{let n=e.target;if(n.buffered.length>0&&n.duration>0){let i=n.buffered.end(n.buffered.length-1)/n.duration*100;a(chunkS7SXQ5YW_js.n(i));}else a(chunkS7SXQ5YW_js.n(0));},500);},xe=()=>{let e=chunk6YRPQDCQ_js.ka("mainPlayer");return {xhrSetup:(t,a)=>{a.split("m3u8")[1]||(a=`${a}${e}`),t.open("GET",a,true);},startLevel:-1,debug:false,enableWorker:true,abrBandWidthUpFactor:.7,abrBandWidthFactor:.95,backBufferLength:1/0,maxBufferLength:30,maxMaxBufferLength:60,manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}}}},ve=()=>{let e=chunk6YRPQDCQ_js.ka("miniPlayer");return {xhrSetup:(t,a)=>{a=`${a}${e}`,t.open("GET",a,true);},startLevel:1,debug:false,maxMaxBufferLength:60,playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1e3,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1e3,retryDelayMs:1e3,maxRetryDelayMs:1e3}}}}},Z=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch,n=[],s=[];if(e.levels.map(i=>{n.push(i.attrs.RESOLUTION.split("x")[1].trim()),s.push(i.attrs.RESOLUTION);}),e.autoLevelCapping=chunk6YRPQDCQ_js.qa(s,window.innerWidth,window.innerHeight),a(chunkS7SXQ5YW_js.i(n)),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach(i=>document.addEventListener(i,()=>{chunk6YRPQDCQ_js.t("isAutoQuality")&&(e.autoLevelCapping=chunk6YRPQDCQ_js.qa(s,window.innerWidth,window.innerHeight),e.nextLevel=-1);},false)),t.audioTracks.length>0){let i=t.audioTracks.sort(d=>d.default===true?-1:1);a(chunk6YRPQDCQ_js.l(i));}},Se=(e,t)=>{let{details:a}=chunk6YRPQDCQ_js.za.getState().videoData,n=a.stream_link;t.loadSource(n),t.on(e.Events.MANIFEST_PARSED,(s,i)=>Z(t,i));},X=(e,t,a)=>{if(t.frag.type!=="audio"){let n=chunk6YRPQDCQ_js.za.dispatch,{settings:s}=chunk6YRPQDCQ_js.za.getState().user,{qualityLevels:i,manualQuality:d,autoQuality:g}=chunk6YRPQDCQ_js.za.getState().controller;chunk6YRPQDCQ_js.t("isAutoQuality")?chunk6YRPQDCQ_js.t("isAutoQuality")&&g===void 0?(e.nextLevel=-1,a(i[t.frag.level]),n(chunkS7SXQ5YW_js.j(t.frag.level))):chunk6YRPQDCQ_js.t("isAutoQuality")&&(a(i[t.frag.level]),g!==t.frag.level&&n(chunkS7SXQ5YW_js.j(t.frag.level))):(t.frag.level!==d&&(e.nextLevel=i[s.quality]?s.quality:-1),i[s.quality]?(n(chunkS7SXQ5YW_js.r(s.quality)),n(chunkS7SXQ5YW_js.j(void 0))):(a(i[t.frag.level]),n(chunkS7SXQ5YW_js.j(t.frag.level)),n(chunk6YRPQDCQ_js.xa({...s,quality:-1}))));}},De=e=>{let t=chunk6YRPQDCQ_js.za.dispatch,n=e.mainForwardBufferInfo?.end/chunk6YRPQDCQ_js.u().duration*100;t(chunkS7SXQ5YW_js.n(n));},Te=(e,t,a)=>{let{params:n,multiAudio:s,selectedAudioId:i}=chunk6YRPQDCQ_js.za.getState().videoData;s&&i!==void 0&&i!==e.audioTrack&&(e.audioTrack=i),n.type&&X(e,t,a);},Pe=(e,t,a)=>{let{type:n}=chunk6YRPQDCQ_js.za.getState().videoData.params;n&&X(e,t,a);},be=e=>{if(e.event!=="hlsAudioTrackLoading")return {type:"HLS_"+e.type,message:e.error.message}},Le=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),t.current=Date.now(),a(chunkS7SXQ5YW_js.l(true));},Me=(e,t)=>{if(chunk6YRPQDCQ_js.t("isIOS")&&chunk6YRPQDCQ_js.t("isFirstPlay"))return;let a=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),t.current=0,a(chunkS7SXQ5YW_js.l(true));},Re=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch,{videoSettings:n}=chunk6YRPQDCQ_js.za.getState().user,{params:s}=chunk6YRPQDCQ_js.za.getState().videoData,{currentTime:i}=chunk6YRPQDCQ_js.za.getState().controller;e.preventDefault(),t.current=Date.now(),a(chunkS7SXQ5YW_js.f(true)),chunk6YRPQDCQ_js.t("hasOnPlayParams")&&s.onPlay(i),chunk6YRPQDCQ_js.t("isFirstPlay")&&(chunk6YRPQDCQ_js.t("hasCurrentTimeParams")||(chunk6YRPQDCQ_js.u().currentTime=n.time,a(chunkS7SXQ5YW_js.h(n.time))),chunk6YRPQDCQ_js.t("hasFullScreenParams")&&G(),chunk6YRPQDCQ_js.t("isFullScreen")&&chunk6YRPQDCQ_js._(),a(chunk6YRPQDCQ_js.f([Math.floor(chunk6YRPQDCQ_js.u().currentTime)])),chunk6YRPQDCQ_js.t("hasRawSubtitles")&&chunk5P3VTPML_js.b()),chunk6YRPQDCQ_js.A(chunk6YRPQDCQ_js.I(true)),a(chunk6YRPQDCQ_js.j(""));},Ee=(e,t,a,n,s,i,d,g)=>{let j=chunk6YRPQDCQ_js.za.dispatch,{autoQuality:C,canPlayVideo:K,firstPlay:Y,qualityLevels:V}=chunk6YRPQDCQ_js.za.getState().controller,{settings:A}=chunk6YRPQDCQ_js.za.getState().user,I=A.quality===-1&&C?V[C]:V[A.quality],x=0;d.current&&(x=Date.now()-d.current),Y&&chunk6YRPQDCQ_js.u().played&&chunk6YRPQDCQ_js.A(chunk6YRPQDCQ_js.J(t.current,Date.now()-a.current,n.current-a.current,Date.now()-s.current,s)),j(chunkS7SXQ5YW_js.o(false)),K&&x>0&&I!==void 0&&(i.current=x,d.current=0,chunk6YRPQDCQ_js.A(chunk6YRPQDCQ_js.K(x,I,s,e,g.current)),e.current=e.current+1,s.current=Date.now());},Fe=e=>{let t=chunk6YRPQDCQ_js.za.dispatch,{params:a}=chunk6YRPQDCQ_js.za.getState().videoData;e.preventDefault(),chunk6YRPQDCQ_js.A(chunk6YRPQDCQ_js.I(false)),t(chunkS7SXQ5YW_js.f(false)),chunk6YRPQDCQ_js.t("hasOnPauseParams")&&a.onPause();},we=e=>{let t=chunk6YRPQDCQ_js.za.dispatch,{onChangeCurrentTime:a}=chunk6YRPQDCQ_js.za.getState().videoData.params,{selectedSubtitle:n}=chunk6YRPQDCQ_js.za.getState().videoData;e.preventDefault(),t(chunkS7SXQ5YW_js.h(e.target.currentTime)),chunk6YRPQDCQ_js.t("hasOnChangeCurrentTime")&&a(e.target.currentTime),chunk6YRPQDCQ_js.t("hasActiveCue")&&t(chunk6YRPQDCQ_js.j(n.activeCues[0].text));},ke=e=>{let t=chunk6YRPQDCQ_js.za.dispatch,{settings:a}=chunk6YRPQDCQ_js.za.getState().user;e.preventDefault(),t(chunkS7SXQ5YW_js.l(false)),t(chunkS7SXQ5YW_js.s(true)),chunk6YRPQDCQ_js.u().volume=a.volume/100,t(chunkS7SXQ5YW_js.g(e.target.duration));},Ce=e=>{let t=chunk6YRPQDCQ_js.za.dispatch,{params:a}=chunk6YRPQDCQ_js.za.getState().videoData;e.preventDefault(),t(chunkS7SXQ5YW_js.u(true)),t(chunkS7SXQ5YW_js.k(true)),chunk6YRPQDCQ_js.aa(chunk6YRPQDCQ_js.u().duration),chunk6YRPQDCQ_js.t("hasOnFinishedParams")&&a.onFinished();},Ve=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),t.current=Date.now(),a(chunkS7SXQ5YW_js.o(false));},Ae=()=>{let e=chunk6YRPQDCQ_js.za.dispatch;e(chunkS7SXQ5YW_js.l(false));},Ie=e=>{let{onChangeCurrentTime:t}=chunk6YRPQDCQ_js.za.getState().videoData.params,a=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),chunk6YRPQDCQ_js.t("hasOnChangeCurrentTime")&&t(e.target.currentTime),a(chunkS7SXQ5YW_js.h(e.target.currentTime));},Oe=()=>{let e=chunk6YRPQDCQ_js.za.dispatch,{params:t}=chunk6YRPQDCQ_js.za.getState().videoData;e(chunkS7SXQ5YW_js.u(true)),e(chunkS7SXQ5YW_js.k(true)),chunk6YRPQDCQ_js.t("hasOnFinishedParams")&&t.onFinished();},qe=e=>{let t=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),t(chunkS7SXQ5YW_js.f(false));},Be=(e,t)=>{let a=chunk6YRPQDCQ_js.za.dispatch,{params:n}=chunk6YRPQDCQ_js.za.getState().videoData,{currentTime:s}=chunk6YRPQDCQ_js.za.getState().controller;e.preventDefault(),a(chunkS7SXQ5YW_js.f(true)),t.current=Date.now(),a(chunk6YRPQDCQ_js.j("")),chunk6YRPQDCQ_js.t("hasOnPlayParams")&&n.onPlay(s),chunk6YRPQDCQ_js.t("isFirstPlay")&&(chunk6YRPQDCQ_js.t("hasRawSubtitles")&&chunk5P3VTPML_js.b(),chunk6YRPQDCQ_js.t("hasFullScreenParams")&&(G(),chunk6YRPQDCQ_js.t("isFullScreen")&&chunk6YRPQDCQ_js._()));},_e=(e,t,a)=>{let n=chunk6YRPQDCQ_js.za.dispatch,{firstPlay:s}=chunk6YRPQDCQ_js.za.getState().controller;n(chunkS7SXQ5YW_js.l(false)),s&&chunk6YRPQDCQ_js.u().played&&chunk6YRPQDCQ_js.A(chunk6YRPQDCQ_js.J(Math.round(e.current),Date.now()-t.current,0,Date.now()-a.current,a)),n(chunkS7SXQ5YW_js.o(false));},Ne=e=>{let{onChangeCurrentTime:t}=chunk6YRPQDCQ_js.za.getState().videoData.params,a=chunk6YRPQDCQ_js.za.dispatch,{selectedSubtitle:n}=chunk6YRPQDCQ_js.za.getState().videoData;e.preventDefault(),a(chunkS7SXQ5YW_js.h(e.target.currentTime)),a(chunkS7SXQ5YW_js.g(e.target.duration)),chunk6YRPQDCQ_js.t("hasOnChangeCurrentTime")&&t(e.target.currentTime),chunk6YRPQDCQ_js.t("hasActiveCue")&&a(chunk6YRPQDCQ_js.j(n.activeCues[0].text));},Qe=e=>{let t=chunk6YRPQDCQ_js.za.dispatch;e.preventDefault(),t(chunkS7SXQ5YW_js.l(false)),t(chunkS7SXQ5YW_js.s(true));},Ue=(e,t)=>{e.preventDefault(),J(e,t);};var We=async e=>{let{stream_link:t}=chunk6YRPQDCQ_js.za.getState().miniPlayer.details;e.loadSource(t);},He=()=>{chunk6YRPQDCQ_js.aa(chunk6YRPQDCQ_js.u().currentTime);};exports.A=Qe;exports.B=Ue;exports.C=We;exports.D=He;exports.a=he;exports.b=ge;exports.c=xe;exports.d=ve;exports.e=Z;exports.f=Se;exports.g=De;exports.h=Te;exports.i=Pe;exports.j=be;exports.k=Le;exports.l=Me;exports.m=Re;exports.n=Ee;exports.o=Fe;exports.p=we;exports.q=ke;exports.r=Ce;exports.s=Ve;exports.t=Ae;exports.u=Ie;exports.v=Oe;exports.w=qe;exports.x=Be;exports.y=_e;exports.z=Ne;//# sourceMappingURL=chunk-2KHWD37R.js.map
2
+ //# sourceMappingURL=chunk-2KHWD37R.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/playerCore.actions.ts"],"names":["init_cjs_shims","handleVideoError","event","error","mainPlayerVideoTag","miniPlayerVideoTag","errorLogProvider","handleAutoFullScreen","dispatch","store_default","params","launchFullScreen","element","setClearPopoversSlice","setIsFullScreen","appendQueryParamsToChunksIOS","fragmentExtension","originalOpen","getUUID","handleBufferedTime","intervalRef","video","bufferedTimeWidth","setBufferedTimeWidth","handleHlsConfig","streamLinkParams","splitQueryParamsFromStreamLink","xhr","url","handleMiniPlayerHlsConfig","handleManifestParsed","hls","data","qualityLevels","resolutions","level","highestResolutionSupported","setQualityLevels","eventType","conditions","sortedAudioTracks","a","setMultiAudio","handleMediaAttached","Hls","details","streamLink","_event","handleLevels","setQualityLevel","settings","manualQuality","autoQuality","setAutoQuality","setManualQuality","setUserSettings","handleFragBuffered","handleFragChanged","multiAudio","selectedAudioId","handleFragParsed","type","handleHlsErrors","handleVideoWaiting","waitingTimerRef","setIsLoading","handleVideoSeeking","handleVideoPlay","timerRef","videoSettings","currentTime","setPlay","setCurrentTime","handleLockOrientation","setVideoTimelines","handleSubtitle","sendFluentLog","pausePlayLog","setSubtitleText","handleVideoPlaying","loadingCounterRef","loadingDurationRef","initialWaitingDurationRef","bannerLoadingDurationRef","waitingDurationRef","videoEntranceTimeRef","canPlayVideo","firstPlay","qualityLevel","waitingDuration","initLog","setFirstPlay","loadingLog","handleVideoPause","handleVideoTimeUpdate","onChangeCurrentTime","selectedSubtitle","handleVideoCanPlay","setCanPlayVideo","setDuration","handleVideoEnded","setIsEnded","setActiveElements","handleVideoTimeline","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","handleStaticVideoPause","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoCanPlay","handleStaticVideoLoadedData","handleMiniPlayerMediaAttached","stream_link","handleVideoVisibilityChange"],"mappings":"iNAAAA,kBAAAA,EAAAA,CAwCO,IAAMC,GAAoBC,CAAAA,EAAe,CAC9CA,EAAM,cAAA,EAAe,CAErB,IAAIC,CAAAA,CAAAA,CAASC,mBAAAA,IAAwBC,mBAAAA,EAAmB,EAAG,MAC3D,GAAIF,CAAAA,CACF,OAAQA,CAAAA,CAAM,IAAA,EACZ,KAAKA,CAAAA,CAAM,iBAAA,CACTG,oBAAiB,CACf,IAAA,CAAM,gBACN,OAAA,CAAS,iCACX,CAAC,CAAA,CACD,MACF,KAAKH,CAAAA,CAAM,iBAAA,CACTG,oBAAiB,CACf,IAAA,CAAM,gBACN,OAAA,CACE,6DACJ,CAAC,CAAA,CACD,MACF,KAAKH,CAAAA,CAAM,gBAAA,CACTG,mBAAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,QACE,6HACJ,CAAC,EACD,MACF,KAAKH,EAAM,2BAAA,CACTG,mBAAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,QACE,oHACJ,CA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AAA,CAAIvF,kBAAAA,CAAM,QAAA,GAAW,SAAA,CAC9CP,CAAAA,CAAM,gBAAe,CACrBM,CAAAA,CAASgE,mBAAetE,CAAAA,CAAM,MAAA,CAAO,WAAW,CAAC,CAAA,CACjDM,EAAS2F,kBAAAA,CAAYjG,CAAAA,CAAM,OAAO,QAAQ,CAAC,EACvCqC,mBAAAA,CAAAA,wBAA+C,CAAA,EACjDwD,CAAAA,CAAqB7F,CAAAA,CAAM,MAAA,CAAO,WAAW,EAC3CqC,mBAAAA,CAAAA,cAAqC,CAAA,EACvC/B,EAASsE,kBAAAA,CAAiBkB,CAAAA,CAAkB,WAAY,CAAC,CAAA,CAAU,IAAI,CAAC,EAC5E,EAEagB,EAAAA,CAA4B9G,CAAAA,EAAe,CACtD,IAAMM,CAAAA,CAAWC,mBAAM,QAAA,CACvBP,CAAAA,CAAM,cAAA,EAAe,CACrBM,CAAAA,CAASyD,kBAAAA,CAAa,KAAK,CAAC,CAAA,CAC5BzD,EAAS0F,kBAAAA,CAAgB,IAAI,CAAC,EAChC,CAAA,CAEae,GAA8B,CAAC/G,CAAAA,CAAYkB,IAAqB,CAC3ElB,CAAAA,CAAM,gBAAe,CACrBiB,CAAAA,CAAmBjB,EAAOkB,CAAW,EACvC,EAQO,IAAM8F,EAAAA,CAAgC,MAAOnF,GAAa,CAC/D,GAAM,CAAE,WAAA,CAAAoF,CAAY,EAAI1G,kBAAAA,CAAM,QAAA,EAAS,CAAE,UAAA,CAAW,OAAA,CACpDsB,CAAAA,CAAI,WAAWoF,CAAW,EAC5B,EAEaC,EAAAA,CAA8B,IAAM,CAC/Cb,kBAAAA,CAAoBnG,mBAAAA,EAAmB,CAAE,WAAW,EACtD","file":"chunk-PYFXHYM2.js","sourcesContent":["import { conditions } from \"../../conditions/conditions\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../constants\";\r\nimport { errorLogProvider } from \"../../errorBoundary/errorBoundaryFunctions\";\r\nimport {\r\n getUUID,\r\n highestResolutionSupported,\r\n splitQueryParamsFromStreamLink,\r\n} from \"../../helpers\";\r\nimport { ConditionName } from \"../../interfaces/enums\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { initLog, loadingLog, pausePlayLog } from \"../../logs/logs\";\r\nimport {\r\n setActiveElements,\r\n setAutoQuality,\r\n setBufferedTimeWidth,\r\n setCanPlayVideo,\r\n setCurrentTime,\r\n setDuration,\r\n setFirstPlay,\r\n setIsEnded,\r\n setIsFullScreen,\r\n setIsLoading,\r\n setManualQuality,\r\n setPlay,\r\n setQualityLevels,\r\n} from \"../slices/controllerSlice\";\r\nimport { setClearPopoversSlice } from \"../slices/popoversSlice\";\r\nimport { setUserSettings } from \"../slices/userSlice\";\r\nimport {\r\n setMultiAudio,\r\n setSubtitleText,\r\n setVideoTimelines,\r\n} from \"../slices/videoDataSlice\";\r\nimport store from \"../store\";\r\nimport {\r\n handleLockOrientation,\r\n handleVideoTimeline,\r\n} from \"./controller.actions\";\r\nimport { handleSubtitle } from \"./videoData.actions\";\r\n\r\nexport const handleVideoError = (event: any) => {\r\n event.preventDefault();\r\n // Access the error property from the video element\r\n let error = (mainPlayerVideoTag() || miniPlayerVideoTag()).error;\r\n if (error) {\r\n switch (error.code) {\r\n case error.MEDIA_ERR_ABORTED:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"You aborted the video playback.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_NETWORK:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"A network error caused the video download to fail part-way.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_DECODE:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_SRC_NOT_SUPPORTED:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"The video could not be loaded, either because the server or network failed or because the format is not supported.\",\r\n });\r\n break;\r\n default:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"An unknown error occurred.\",\r\n });\r\n break;\r\n }\r\n } else {\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"An error occurred, but the error object is not available.\",\r\n });\r\n }\r\n};\r\n\r\nexport const handleAutoFullScreen = () => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n const launchFullScreen = (element: any) => {\r\n if (element.requestFullScreen) element.requestFullScreen();\r\n else if (element.mozRequestFullScreen) element.mozRequestFullScreen();\r\n else if (element.webkitRequestFullScreen) element.webkitRequestFullScreen();\r\n };\r\n dispatch(setClearPopoversSlice());\r\n launchFullScreen(document.documentElement);\r\n dispatch(setIsFullScreen(params.fullscreen === \"true\"));\r\n};\r\n\r\nexport const appendQueryParamsToChunksIOS = () => {\r\n let fragmentExtension = \".ts\";\r\n let originalOpen = XMLHttpRequest.prototype.open;\r\n XMLHttpRequest.prototype.open = function () {\r\n if (arguments[1].endsWith(fragmentExtension))\r\n arguments[1] = arguments[1] + \"?uuid=\" + getUUID!();\r\n originalOpen.apply(this, arguments as any);\r\n };\r\n};\r\n\r\nexport const handleBufferedTime = (event: any, intervalRef: any) => {\r\n const dispatch = store.dispatch;\r\n\r\n intervalRef.current = setInterval(() => {\r\n const video = event.target;\r\n\r\n // چک کردن طول buffered قبل از دسترسی\r\n if (video.buffered.length > 0 && video.duration > 0) {\r\n const bufferedTime = video.buffered.end(video.buffered.length - 1); // استفاده از آخرین index برای ایمنی\r\n const bufferedTimeWidth = (bufferedTime / video.duration) * 100;\r\n dispatch(setBufferedTimeWidth(bufferedTimeWidth));\r\n } else {\r\n dispatch(setBufferedTimeWidth(0));\r\n }\r\n }, 500);\r\n};\r\n\r\n// ************* Hls Config Handlers ************* //\r\nexport const handleHlsConfig = () => {\r\n const streamLinkParams = splitQueryParamsFromStreamLink(\"mainPlayer\");\r\n return {\r\n xhrSetup: (xhr: any, url: any) => {\r\n if (!url.split(\"m3u8\")[1]) url = `${url}${streamLinkParams}`;\r\n xhr.open(\"GET\", url, true);\r\n },\r\n startLevel: -1,\r\n debug: false,\r\n enableWorker: true,\r\n abrBandWidthUpFactor: 0.7,\r\n abrBandWidthFactor: 0.95,\r\n backBufferLength: Infinity,\r\n maxBufferLength: 30,\r\n maxMaxBufferLength: 60,\r\n manifestLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: Infinity,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n fragLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 120000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n playlistLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n };\r\n};\r\n\r\nexport const handleMiniPlayerHlsConfig = () => {\r\n const streamLinkParams = splitQueryParamsFromStreamLink(\"miniPlayer\");\r\n return {\r\n xhrSetup: (xhr: any, url: any) => {\r\n url = `${url}${streamLinkParams}`;\r\n xhr.open(\"GET\", url, true);\r\n },\r\n startLevel: 1,\r\n debug: false,\r\n maxMaxBufferLength: 60,\r\n playlistLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 1000,\r\n retryDelayMs: 0,\r\n maxRetryDelayMs: 0,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 1000,\r\n retryDelayMs: 1000,\r\n maxRetryDelayMs: 1000,\r\n },\r\n },\r\n },\r\n };\r\n};\r\n\r\n// ************* Manifest Handlers ************* //\r\n\r\nexport const handleManifestParsed = (hls: any, data: any) => {\r\n const dispatch = store.dispatch;\r\n let qualityLevels: any[] = [];\r\n let resolutions: any[] = [];\r\n hls.levels.map((level: any) => {\r\n qualityLevels.push(level.attrs.RESOLUTION!.split(\"x\")[1].trim());\r\n resolutions.push(level.attrs.RESOLUTION!);\r\n });\r\n hls.autoLevelCapping = highestResolutionSupported(\r\n resolutions,\r\n window.innerWidth,\r\n window.innerHeight\r\n );\r\n dispatch(setQualityLevels(qualityLevels));\r\n [\r\n \"fullscreenchange\",\r\n \"webkitfullscreenchange\",\r\n \"mozfullscreenchange\",\r\n \"msfullscreenchange\",\r\n ].forEach((eventType) =>\r\n document.addEventListener(\r\n eventType,\r\n () => {\r\n if (conditions(ConditionName.isAutoQuality)) {\r\n hls.autoLevelCapping = highestResolutionSupported(\r\n resolutions,\r\n window.innerWidth,\r\n window.innerHeight\r\n );\r\n hls.nextLevel = -1;\r\n }\r\n },\r\n false\r\n )\r\n );\r\n if (data.audioTracks.length > 0) {\r\n const sortedAudioTracks = data.audioTracks.sort((a: any) =>\r\n a.default === true ? -1 : 1\r\n );\r\n dispatch(setMultiAudio(sortedAudioTracks));\r\n }\r\n};\r\n\r\nexport const handleMediaAttached = (Hls: any, hls: any) => {\r\n const { details } = store.getState().videoData;\r\n let streamLink = details.stream_link;\r\n hls.loadSource(streamLink);\r\n hls.on(Hls.Events.MANIFEST_PARSED, (_event: any, data: any) =>\r\n handleManifestParsed(hls, data)\r\n );\r\n};\r\n\r\n// ************* Level Handlers ************* //\r\n\r\nexport const handleLevels = (hls: any, data: any, setQualityLevel: any) => {\r\n if (data.frag.type !== \"audio\") {\r\n const dispatch = store.dispatch;\r\n const { settings } = store.getState().user;\r\n const { qualityLevels, manualQuality, autoQuality } =\r\n store.getState().controller;\r\n if (!conditions(ConditionName.isAutoQuality)) {\r\n if (data.frag.level !== manualQuality)\r\n hls.nextLevel = qualityLevels[settings.quality!]\r\n ? settings.quality\r\n : -1;\r\n if (qualityLevels[settings.quality!]) {\r\n dispatch(setManualQuality(settings.quality!));\r\n dispatch(setAutoQuality(undefined));\r\n } else {\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n dispatch(setAutoQuality(data.frag.level));\r\n dispatch(setUserSettings({ ...settings, quality: -1 }));\r\n }\r\n } else if (\r\n conditions(ConditionName.isAutoQuality) &&\r\n autoQuality === undefined\r\n ) {\r\n hls.nextLevel = -1;\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n dispatch(setAutoQuality(data.frag.level));\r\n } else if (conditions(ConditionName.isAutoQuality)) {\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n if (autoQuality !== data.frag.level)\r\n dispatch(setAutoQuality(data.frag.level));\r\n }\r\n }\r\n};\r\n\r\n// ************* Fragment Handlers ************* //\r\n\r\nexport const handleFragBuffered = (hls: any) => {\r\n const dispatch = store.dispatch;\r\n const bufferedTime = hls.mainForwardBufferInfo?.end;\r\n const bufferedTimeWidth =\r\n (bufferedTime! / mainPlayerVideoTag().duration) * 100;\r\n dispatch(setBufferedTimeWidth(bufferedTimeWidth));\r\n};\r\n\r\nexport const handleFragChanged = (\r\n hls: any,\r\n data: any,\r\n setQualityLevel: any\r\n) => {\r\n const { params, multiAudio, selectedAudioId } = store.getState().videoData;\r\n\r\n if (\r\n multiAudio &&\r\n selectedAudioId !== undefined &&\r\n selectedAudioId !== hls.audioTrack\r\n )\r\n hls.audioTrack = selectedAudioId;\r\n if (params.type) handleLevels(hls, data, setQualityLevel);\r\n};\r\n\r\nexport const handleFragParsed = (hls: any, data: any, setQualityLevel: any) => {\r\n const { type } = store.getState().videoData.params;\r\n if (type) handleLevels(hls, data, setQualityLevel);\r\n};\r\n\r\n// ************* HLS Error Handlers ************* //\r\n\r\nexport const handleHlsErrors = (data: any) => {\r\n if (data.event !== \"hlsAudioTrackLoading\")\r\n return { type: \"HLS_\" + data.type, message: data.error.message };\r\n return undefined;\r\n};\r\n\r\n// ************* Video Tag Handlers ************* //\r\n\r\nexport const handleVideoWaiting = (event: any, waitingTimerRef: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n waitingTimerRef.current = Date.now();\r\n dispatch(setIsLoading(true));\r\n};\r\n\r\nexport const handleVideoSeeking = (event: any, waitingTimerRef: any) => {\r\n if (conditions(ConditionName.isIOS) && conditions(ConditionName.isFirstPlay))\r\n return;\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n waitingTimerRef.current = 0;\r\n dispatch(setIsLoading(true));\r\n};\r\n\r\nexport const handleVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n const { videoSettings } = store.getState().user;\r\n const { params } = store.getState().videoData;\r\n const { currentTime } = store.getState().controller;\r\n event.preventDefault();\r\n timerRef.current = Date.now();\r\n dispatch(setPlay(true));\r\n if (conditions(ConditionName.hasOnPlayParams)) params.onPlay!(currentTime);\r\n if (conditions(ConditionName.isFirstPlay)) {\r\n if (!conditions(ConditionName.hasCurrentTimeParams)) {\r\n mainPlayerVideoTag().currentTime = videoSettings.time;\r\n dispatch(setCurrentTime(videoSettings.time));\r\n }\r\n if (conditions(ConditionName.hasFullScreenParams)) handleAutoFullScreen();\r\n if (conditions(ConditionName.isFullScreen)) handleLockOrientation();\r\n dispatch(setVideoTimelines([Math.floor(mainPlayerVideoTag().currentTime)]));\r\n if (conditions(ConditionName.hasRawSubtitles)) handleSubtitle();\r\n }\r\n sendFluentLog(pausePlayLog(true));\r\n dispatch(setSubtitleText(\"\"));\r\n};\r\n\r\nexport const handleVideoPlaying = (\r\n loadingCounterRef: any,\r\n loadingDurationRef: any,\r\n initialWaitingDurationRef: any,\r\n bannerLoadingDurationRef: any,\r\n timerRef: any,\r\n waitingDurationRef: any,\r\n waitingTimerRef: any,\r\n videoEntranceTimeRef: any\r\n) => {\r\n const dispatch = store.dispatch;\r\n const { autoQuality, canPlayVideo, firstPlay, qualityLevels } =\r\n store.getState().controller;\r\n const { settings } = store.getState().user;\r\n const qualityLevel =\r\n settings.quality === -1 && autoQuality\r\n ? qualityLevels[autoQuality]\r\n : qualityLevels[settings.quality!];\r\n let waitingDuration = 0;\r\n if (!!waitingTimerRef.current)\r\n waitingDuration = Date.now() - waitingTimerRef.current;\r\n if (firstPlay && !!mainPlayerVideoTag().played)\r\n sendFluentLog(\r\n initLog(\r\n loadingDurationRef.current,\r\n Date.now() - initialWaitingDurationRef.current,\r\n bannerLoadingDurationRef.current - initialWaitingDurationRef.current,\r\n Date.now() - timerRef.current,\r\n timerRef\r\n )\r\n );\r\n dispatch(setFirstPlay(false));\r\n if (canPlayVideo && waitingDuration > 0 && qualityLevel !== undefined) {\r\n waitingDurationRef.current = waitingDuration;\r\n waitingTimerRef.current = 0;\r\n sendFluentLog(\r\n loadingLog(\r\n waitingDuration,\r\n qualityLevel,\r\n timerRef,\r\n loadingCounterRef,\r\n videoEntranceTimeRef.current\r\n )\r\n );\r\n loadingCounterRef.current = loadingCounterRef.current + 1;\r\n timerRef.current = Date.now();\r\n }\r\n};\r\n\r\nexport const handleVideoPause = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n event.preventDefault();\r\n sendFluentLog(pausePlayLog(false));\r\n dispatch(setPlay(false));\r\n if (conditions(ConditionName.hasOnPauseParams)) params.onPause!();\r\n};\r\n\r\nexport const handleVideoTimeUpdate = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const { selectedSubtitle } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n if (conditions(ConditionName.hasActiveCue))\r\n dispatch(setSubtitleText((selectedSubtitle!.activeCues![0] as any).text));\r\n};\r\n\r\nexport const handleVideoCanPlay = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { settings } = store.getState().user;\r\n event.preventDefault();\r\n dispatch(setIsLoading(false));\r\n dispatch(setCanPlayVideo(true));\r\n mainPlayerVideoTag().volume = settings.volume / 100;\r\n dispatch(setDuration(event.target.duration));\r\n};\r\n\r\nexport const handleVideoEnded = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setIsEnded(true));\r\n dispatch(setActiveElements(true));\r\n handleVideoTimeline(mainPlayerVideoTag().duration);\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n};\r\n\r\n// ************* IOS Video Tag Handlers ************* //\r\n\r\nexport const handleIosVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n timerRef.current = Date.now();\r\n dispatch(setFirstPlay(false));\r\n};\r\n\r\nexport const handleIosVideoPlaying = () => {\r\n const dispatch = store.dispatch;\r\n dispatch(setIsLoading(false));\r\n};\r\n\r\nexport const handleIosVideoTimeUpdate = (event: any) => {\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n};\r\n\r\nexport const handleIosVideoEnded = () => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n dispatch(setIsEnded(true));\r\n dispatch(setActiveElements(true));\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n};\r\n\r\n// ************* Static Video Tag Handlers ************* //\r\n\r\nexport const handleStaticVideoPause = (event: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n dispatch(setPlay(false));\r\n};\r\n\r\nexport const handleStaticVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n const { currentTime } = store.getState().controller;\r\n event.preventDefault();\r\n dispatch(setPlay(true));\r\n timerRef.current = Date.now();\r\n dispatch(setSubtitleText(\"\"));\r\n if (conditions(ConditionName.hasOnPlayParams)) params.onPlay!(currentTime);\r\n\r\n if (conditions(ConditionName.isFirstPlay)) {\r\n if (conditions(ConditionName.hasRawSubtitles)) handleSubtitle();\r\n if (conditions(ConditionName.hasFullScreenParams)) {\r\n handleAutoFullScreen();\r\n if (conditions(ConditionName.isFullScreen)) handleLockOrientation();\r\n }\r\n }\r\n};\r\n\r\nexport const handleStaticVideoPlaying = (\r\n loadingDurationRef: any,\r\n initialWaitingDurationRef: any,\r\n timerRef: any\r\n) => {\r\n const dispatch = store.dispatch;\r\n const { firstPlay } = store.getState().controller;\r\n dispatch(setIsLoading(false));\r\n if (firstPlay && !!mainPlayerVideoTag().played)\r\n sendFluentLog(\r\n initLog(\r\n Math.round(loadingDurationRef.current),\r\n Date.now() - initialWaitingDurationRef.current,\r\n 0,\r\n Date.now() - timerRef.current,\r\n timerRef\r\n )\r\n );\r\n dispatch(setFirstPlay(false));\r\n};\r\n\r\nexport const handleStaticVideoTimeUpdate = (event: any) => {\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const dispatch = store.dispatch;\r\n const { selectedSubtitle } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n dispatch(setDuration(event.target.duration));\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n if (conditions(ConditionName.hasActiveCue))\r\n dispatch(setSubtitleText((selectedSubtitle!.activeCues![0] as any).text));\r\n};\r\n\r\nexport const handleStaticVideoCanPlay = (event: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n dispatch(setIsLoading(false));\r\n dispatch(setCanPlayVideo(true));\r\n};\r\n\r\nexport const handleStaticVideoLoadedData = (event: any, intervalRef: any) => {\r\n event.preventDefault();\r\n handleBufferedTime(event, intervalRef);\r\n};\r\n\r\nexport const handleStaticVideoEnded = (event: any) => {\r\n const { params } = store.getState().videoData;\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n event.preventDefault();\r\n};\r\n\r\nexport const handleMiniPlayerMediaAttached = async (hls: any) => {\r\n const { stream_link } = store.getState().miniPlayer.details;\r\n hls.loadSource(stream_link);\r\n};\r\n\r\nexport const handleVideoVisibilityChange = () => {\r\n handleVideoTimeline(mainPlayerVideoTag().currentTime);\r\n};\r\n"]}
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/playerCore.actions.ts"],"names":["init_cjs_shims","handleVideoError","event","error","mainPlayerVideoTag","miniPlayerVideoTag","errorLogProvider","handleAutoFullScreen","dispatch","store_default","params","launchFullScreen","element","setClearPopoversSlice","setIsFullScreen","appendQueryParamsToChunksIOS","fragmentExtension","originalOpen","getUUID","handleBufferedTime","intervalRef","video","bufferedTimeWidth","setBufferedTimeWidth","handleHlsConfig","streamLinkParams","splitQueryParamsFromStreamLink","xhr","url","handleMiniPlayerHlsConfig","handleManifestParsed","hls","data","qualityLevels","resolutions","level","highestResolutionSupported","setQualityLevels","eventType","conditions","sortedAudioTracks","a","setMultiAudio","handleMediaAttached","Hls","details","streamLink","_event","handleLevels","setQualityLevel","settings","manualQuality","autoQuality","setAutoQuality","setManualQuality","setUserSettings","handleFragBuffered","handleFragChanged","multiAudio","selectedAudioId","handleFragParsed","type","handleHlsErrors","handleVideoWaiting","waitingTimerRef","setIsLoading","handleVideoSeeking","handleVideoPlay","timerRef","videoSettings","currentTime","setPlay","setCurrentTime","handleLockOrientation","setVideoTimelines","handleSubtitle","sendFluentLog","pausePlayLog","setSubtitleText","handleVideoPlaying","loadingCounterRef","loadingDurationRef","initialWaitingDurationRef","bannerLoadingDurationRef","waitingDurationRef","videoEntranceTimeRef","canPlayVideo","firstPlay","qualityLevel","waitingDuration","initLog","setFirstPlay","loadingLog","handleVideoPause","handleVideoTimeUpdate","onChangeCurrentTime","selectedSubtitle","handleVideoCanPlay","setCanPlayVideo","setDuration","handleVideoEnded","setIsEnded","setActiveElements","handleVideoTimeline","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","handleStaticVideoPause","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoCanPlay","handleStaticVideoLoadedData","handleMiniPlayerMediaAttached","stream_link","handleVideoVisibilityChange"],"mappings":"iKAAAA,kBAAAA,EAAAA,CAwCO,IAAMC,GAAoBC,CAAAA,EAAe,CAC9CA,EAAM,cAAA,EAAe,CAErB,IAAIC,CAAAA,CAAAA,CAASC,kBAAAA,IAAwBC,kBAAAA,EAAmB,EAAG,MAC3D,GAAIF,CAAAA,CACF,OAAQA,CAAAA,CAAM,IAAA,EACZ,KAAKA,CAAAA,CAAM,iBAAA,CACTG,mBAAiB,CACf,IAAA,CAAM,gBACN,OAAA,CAAS,iCACX,CAAC,CAAA,CACD,MACF,KAAKH,CAAAA,CAAM,iBAAA,CACTG,mBAAiB,CACf,IAAA,CAAM,gBACN,OAAA,CACE,6DACJ,CAAC,CAAA,CACD,MACF,KAAKH,CAAAA,CAAM,gBAAA,CACTG,kBAAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,QACE,6HACJ,CAAC,EACD,MACF,KAAKH,EAAM,2BAAA,CACTG,kBAAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,QACE,oHACJ,CAAC,EACD,MACF,QACEA,kBAAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,QAAS,4BACX,CAAC,EACD,KACJ,CAAA,KAEAA,mBAAiB,CACf,IAAA,CAAM,gBACN,OAAA,CAAS,2DACX,CAAC,EAEL,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AAAA,CAAYjG,CAAAA,CAAM,OAAO,QAAQ,CAAC,EACvCqC,kBAAAA,CAAAA,wBAA+C,CAAA,EACjDwD,CAAAA,CAAqB7F,CAAAA,CAAM,MAAA,CAAO,WAAW,EAC3CqC,kBAAAA,CAAAA,cAAqC,CAAA,EACvC/B,EAASsE,kBAAAA,CAAiBkB,CAAAA,CAAkB,WAAY,CAAC,CAAA,CAAU,IAAI,CAAC,EAC5E,EAEagB,EAAAA,CAA4B9G,CAAAA,EAAe,CACtD,IAAMM,CAAAA,CAAWC,oBAAM,QAAA,CACvBP,CAAAA,CAAM,cAAA,EAAe,CACrBM,CAAAA,CAASyD,kBAAAA,CAAa,KAAK,CAAC,CAAA,CAC5BzD,EAAS0F,kBAAAA,CAAgB,IAAI,CAAC,EAChC,CAAA,CAEae,GAA8B,CAAC/G,CAAAA,CAAYkB,IAAqB,CAC3ElB,CAAAA,CAAM,gBAAe,CACrBiB,CAAAA,CAAmBjB,EAAOkB,CAAW,EACvC,EAQO,IAAM8F,EAAAA,CAAgC,MAAOnF,GAAa,CAC/D,GAAM,CAAE,WAAA,CAAAoF,CAAY,EAAI1G,mBAAAA,CAAM,QAAA,EAAS,CAAE,UAAA,CAAW,OAAA,CACpDsB,CAAAA,CAAI,WAAWoF,CAAW,EAC5B,EAEaC,EAAAA,CAA8B,IAAM,CAC/Cb,mBAAAA,CAAoBnG,kBAAAA,EAAmB,CAAE,WAAW,EACtD","file":"chunk-2KHWD37R.js","sourcesContent":["import { conditions } from \"../../conditions/conditions\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../constants\";\r\nimport { errorLogProvider } from \"../../errorBoundary/errorBoundaryFunctions\";\r\nimport {\r\n getUUID,\r\n highestResolutionSupported,\r\n splitQueryParamsFromStreamLink,\r\n} from \"../../helpers\";\r\nimport { ConditionName } from \"../../interfaces/enums\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { initLog, loadingLog, pausePlayLog } from \"../../logs/logs\";\r\nimport {\r\n setActiveElements,\r\n setAutoQuality,\r\n setBufferedTimeWidth,\r\n setCanPlayVideo,\r\n setCurrentTime,\r\n setDuration,\r\n setFirstPlay,\r\n setIsEnded,\r\n setIsFullScreen,\r\n setIsLoading,\r\n setManualQuality,\r\n setPlay,\r\n setQualityLevels,\r\n} from \"../slices/controllerSlice\";\r\nimport { setClearPopoversSlice } from \"../slices/popoversSlice\";\r\nimport { setUserSettings } from \"../slices/userSlice\";\r\nimport {\r\n setMultiAudio,\r\n setSubtitleText,\r\n setVideoTimelines,\r\n} from \"../slices/videoDataSlice\";\r\nimport store from \"../store\";\r\nimport {\r\n handleLockOrientation,\r\n handleVideoTimeline,\r\n} from \"./controller.actions\";\r\nimport { handleSubtitle } from \"./videoData.actions\";\r\n\r\nexport const handleVideoError = (event: any) => {\r\n event.preventDefault();\r\n // Access the error property from the video element\r\n let error = (mainPlayerVideoTag() || miniPlayerVideoTag()).error;\r\n if (error) {\r\n switch (error.code) {\r\n case error.MEDIA_ERR_ABORTED:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"You aborted the video playback.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_NETWORK:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"A network error caused the video download to fail part-way.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_DECODE:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.\",\r\n });\r\n break;\r\n case error.MEDIA_ERR_SRC_NOT_SUPPORTED:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message:\r\n \"The video could not be loaded, either because the server or network failed or because the format is not supported.\",\r\n });\r\n break;\r\n default:\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"An unknown error occurred.\",\r\n });\r\n break;\r\n }\r\n } else {\r\n errorLogProvider({\r\n type: \"videoTagError\",\r\n message: \"An error occurred, but the error object is not available.\",\r\n });\r\n }\r\n};\r\n\r\nexport const handleAutoFullScreen = () => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n const launchFullScreen = (element: any) => {\r\n if (element.requestFullScreen) element.requestFullScreen();\r\n else if (element.mozRequestFullScreen) element.mozRequestFullScreen();\r\n else if (element.webkitRequestFullScreen) element.webkitRequestFullScreen();\r\n };\r\n dispatch(setClearPopoversSlice());\r\n launchFullScreen(document.documentElement);\r\n dispatch(setIsFullScreen(params.fullscreen === \"true\"));\r\n};\r\n\r\nexport const appendQueryParamsToChunksIOS = () => {\r\n let fragmentExtension = \".ts\";\r\n let originalOpen = XMLHttpRequest.prototype.open;\r\n XMLHttpRequest.prototype.open = function () {\r\n if (arguments[1].endsWith(fragmentExtension))\r\n arguments[1] = arguments[1] + \"?uuid=\" + getUUID!();\r\n originalOpen.apply(this, arguments as any);\r\n };\r\n};\r\n\r\nexport const handleBufferedTime = (event: any, intervalRef: any) => {\r\n const dispatch = store.dispatch;\r\n\r\n intervalRef.current = setInterval(() => {\r\n const video = event.target;\r\n\r\n // چک کردن طول buffered قبل از دسترسی\r\n if (video.buffered.length > 0 && video.duration > 0) {\r\n const bufferedTime = video.buffered.end(video.buffered.length - 1); // استفاده از آخرین index برای ایمنی\r\n const bufferedTimeWidth = (bufferedTime / video.duration) * 100;\r\n dispatch(setBufferedTimeWidth(bufferedTimeWidth));\r\n } else {\r\n dispatch(setBufferedTimeWidth(0));\r\n }\r\n }, 500);\r\n};\r\n\r\n// ************* Hls Config Handlers ************* //\r\nexport const handleHlsConfig = () => {\r\n const streamLinkParams = splitQueryParamsFromStreamLink(\"mainPlayer\");\r\n return {\r\n xhrSetup: (xhr: any, url: any) => {\r\n if (!url.split(\"m3u8\")[1]) url = `${url}${streamLinkParams}`;\r\n xhr.open(\"GET\", url, true);\r\n },\r\n startLevel: -1,\r\n debug: false,\r\n enableWorker: true,\r\n abrBandWidthUpFactor: 0.7,\r\n abrBandWidthFactor: 0.95,\r\n backBufferLength: Infinity,\r\n maxBufferLength: 30,\r\n maxMaxBufferLength: 60,\r\n manifestLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: Infinity,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n fragLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 120000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n playlistLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 10,\r\n retryDelayMs: 5000,\r\n maxRetryDelayMs: 10000,\r\n },\r\n },\r\n },\r\n };\r\n};\r\n\r\nexport const handleMiniPlayerHlsConfig = () => {\r\n const streamLinkParams = splitQueryParamsFromStreamLink(\"miniPlayer\");\r\n return {\r\n xhrSetup: (xhr: any, url: any) => {\r\n url = `${url}${streamLinkParams}`;\r\n xhr.open(\"GET\", url, true);\r\n },\r\n startLevel: 1,\r\n debug: false,\r\n maxMaxBufferLength: 60,\r\n playlistLoadPolicy: {\r\n default: {\r\n maxTimeToFirstByteMs: 10000,\r\n maxLoadTimeMs: 20000,\r\n timeoutRetry: {\r\n maxNumRetry: 1000,\r\n retryDelayMs: 0,\r\n maxRetryDelayMs: 0,\r\n },\r\n errorRetry: {\r\n maxNumRetry: 1000,\r\n retryDelayMs: 1000,\r\n maxRetryDelayMs: 1000,\r\n },\r\n },\r\n },\r\n };\r\n};\r\n\r\n// ************* Manifest Handlers ************* //\r\n\r\nexport const handleManifestParsed = (hls: any, data: any) => {\r\n const dispatch = store.dispatch;\r\n let qualityLevels: any[] = [];\r\n let resolutions: any[] = [];\r\n hls.levels.map((level: any) => {\r\n qualityLevels.push(level.attrs.RESOLUTION!.split(\"x\")[1].trim());\r\n resolutions.push(level.attrs.RESOLUTION!);\r\n });\r\n hls.autoLevelCapping = highestResolutionSupported(\r\n resolutions,\r\n window.innerWidth,\r\n window.innerHeight\r\n );\r\n dispatch(setQualityLevels(qualityLevels));\r\n [\r\n \"fullscreenchange\",\r\n \"webkitfullscreenchange\",\r\n \"mozfullscreenchange\",\r\n \"msfullscreenchange\",\r\n ].forEach((eventType) =>\r\n document.addEventListener(\r\n eventType,\r\n () => {\r\n if (conditions(ConditionName.isAutoQuality)) {\r\n hls.autoLevelCapping = highestResolutionSupported(\r\n resolutions,\r\n window.innerWidth,\r\n window.innerHeight\r\n );\r\n hls.nextLevel = -1;\r\n }\r\n },\r\n false\r\n )\r\n );\r\n if (data.audioTracks.length > 0) {\r\n const sortedAudioTracks = data.audioTracks.sort((a: any) =>\r\n a.default === true ? -1 : 1\r\n );\r\n dispatch(setMultiAudio(sortedAudioTracks));\r\n }\r\n};\r\n\r\nexport const handleMediaAttached = (Hls: any, hls: any) => {\r\n const { details } = store.getState().videoData;\r\n let streamLink = details.stream_link;\r\n hls.loadSource(streamLink);\r\n hls.on(Hls.Events.MANIFEST_PARSED, (_event: any, data: any) =>\r\n handleManifestParsed(hls, data)\r\n );\r\n};\r\n\r\n// ************* Level Handlers ************* //\r\n\r\nexport const handleLevels = (hls: any, data: any, setQualityLevel: any) => {\r\n if (data.frag.type !== \"audio\") {\r\n const dispatch = store.dispatch;\r\n const { settings } = store.getState().user;\r\n const { qualityLevels, manualQuality, autoQuality } =\r\n store.getState().controller;\r\n if (!conditions(ConditionName.isAutoQuality)) {\r\n if (data.frag.level !== manualQuality)\r\n hls.nextLevel = qualityLevels[settings.quality!]\r\n ? settings.quality\r\n : -1;\r\n if (qualityLevels[settings.quality!]) {\r\n dispatch(setManualQuality(settings.quality!));\r\n dispatch(setAutoQuality(undefined));\r\n } else {\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n dispatch(setAutoQuality(data.frag.level));\r\n dispatch(setUserSettings({ ...settings, quality: -1 }));\r\n }\r\n } else if (\r\n conditions(ConditionName.isAutoQuality) &&\r\n autoQuality === undefined\r\n ) {\r\n hls.nextLevel = -1;\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n dispatch(setAutoQuality(data.frag.level));\r\n } else if (conditions(ConditionName.isAutoQuality)) {\r\n setQualityLevel(qualityLevels[data.frag.level]);\r\n if (autoQuality !== data.frag.level)\r\n dispatch(setAutoQuality(data.frag.level));\r\n }\r\n }\r\n};\r\n\r\n// ************* Fragment Handlers ************* //\r\n\r\nexport const handleFragBuffered = (hls: any) => {\r\n const dispatch = store.dispatch;\r\n const bufferedTime = hls.mainForwardBufferInfo?.end;\r\n const bufferedTimeWidth =\r\n (bufferedTime! / mainPlayerVideoTag().duration) * 100;\r\n dispatch(setBufferedTimeWidth(bufferedTimeWidth));\r\n};\r\n\r\nexport const handleFragChanged = (\r\n hls: any,\r\n data: any,\r\n setQualityLevel: any\r\n) => {\r\n const { params, multiAudio, selectedAudioId } = store.getState().videoData;\r\n\r\n if (\r\n multiAudio &&\r\n selectedAudioId !== undefined &&\r\n selectedAudioId !== hls.audioTrack\r\n )\r\n hls.audioTrack = selectedAudioId;\r\n if (params.type) handleLevels(hls, data, setQualityLevel);\r\n};\r\n\r\nexport const handleFragParsed = (hls: any, data: any, setQualityLevel: any) => {\r\n const { type } = store.getState().videoData.params;\r\n if (type) handleLevels(hls, data, setQualityLevel);\r\n};\r\n\r\n// ************* HLS Error Handlers ************* //\r\n\r\nexport const handleHlsErrors = (data: any) => {\r\n if (data.event !== \"hlsAudioTrackLoading\")\r\n return { type: \"HLS_\" + data.type, message: data.error.message };\r\n return undefined;\r\n};\r\n\r\n// ************* Video Tag Handlers ************* //\r\n\r\nexport const handleVideoWaiting = (event: any, waitingTimerRef: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n waitingTimerRef.current = Date.now();\r\n dispatch(setIsLoading(true));\r\n};\r\n\r\nexport const handleVideoSeeking = (event: any, waitingTimerRef: any) => {\r\n if (conditions(ConditionName.isIOS) && conditions(ConditionName.isFirstPlay))\r\n return;\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n waitingTimerRef.current = 0;\r\n dispatch(setIsLoading(true));\r\n};\r\n\r\nexport const handleVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n const { videoSettings } = store.getState().user;\r\n const { params } = store.getState().videoData;\r\n const { currentTime } = store.getState().controller;\r\n event.preventDefault();\r\n timerRef.current = Date.now();\r\n dispatch(setPlay(true));\r\n if (conditions(ConditionName.hasOnPlayParams)) params.onPlay!(currentTime);\r\n if (conditions(ConditionName.isFirstPlay)) {\r\n if (!conditions(ConditionName.hasCurrentTimeParams)) {\r\n mainPlayerVideoTag().currentTime = videoSettings.time;\r\n dispatch(setCurrentTime(videoSettings.time));\r\n }\r\n if (conditions(ConditionName.hasFullScreenParams)) handleAutoFullScreen();\r\n if (conditions(ConditionName.isFullScreen)) handleLockOrientation();\r\n dispatch(setVideoTimelines([Math.floor(mainPlayerVideoTag().currentTime)]));\r\n if (conditions(ConditionName.hasRawSubtitles)) handleSubtitle();\r\n }\r\n sendFluentLog(pausePlayLog(true));\r\n dispatch(setSubtitleText(\"\"));\r\n};\r\n\r\nexport const handleVideoPlaying = (\r\n loadingCounterRef: any,\r\n loadingDurationRef: any,\r\n initialWaitingDurationRef: any,\r\n bannerLoadingDurationRef: any,\r\n timerRef: any,\r\n waitingDurationRef: any,\r\n waitingTimerRef: any,\r\n videoEntranceTimeRef: any\r\n) => {\r\n const dispatch = store.dispatch;\r\n const { autoQuality, canPlayVideo, firstPlay, qualityLevels } =\r\n store.getState().controller;\r\n const { settings } = store.getState().user;\r\n const qualityLevel =\r\n settings.quality === -1 && autoQuality\r\n ? qualityLevels[autoQuality]\r\n : qualityLevels[settings.quality!];\r\n let waitingDuration = 0;\r\n if (!!waitingTimerRef.current)\r\n waitingDuration = Date.now() - waitingTimerRef.current;\r\n if (firstPlay && !!mainPlayerVideoTag().played)\r\n sendFluentLog(\r\n initLog(\r\n loadingDurationRef.current,\r\n Date.now() - initialWaitingDurationRef.current,\r\n bannerLoadingDurationRef.current - initialWaitingDurationRef.current,\r\n Date.now() - timerRef.current,\r\n timerRef\r\n )\r\n );\r\n dispatch(setFirstPlay(false));\r\n if (canPlayVideo && waitingDuration > 0 && qualityLevel !== undefined) {\r\n waitingDurationRef.current = waitingDuration;\r\n waitingTimerRef.current = 0;\r\n sendFluentLog(\r\n loadingLog(\r\n waitingDuration,\r\n qualityLevel,\r\n timerRef,\r\n loadingCounterRef,\r\n videoEntranceTimeRef.current\r\n )\r\n );\r\n loadingCounterRef.current = loadingCounterRef.current + 1;\r\n timerRef.current = Date.now();\r\n }\r\n};\r\n\r\nexport const handleVideoPause = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n event.preventDefault();\r\n sendFluentLog(pausePlayLog(false));\r\n dispatch(setPlay(false));\r\n if (conditions(ConditionName.hasOnPauseParams)) params.onPause!();\r\n};\r\n\r\nexport const handleVideoTimeUpdate = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const { selectedSubtitle } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n if (conditions(ConditionName.hasActiveCue))\r\n dispatch(setSubtitleText((selectedSubtitle!.activeCues![0] as any).text));\r\n};\r\n\r\nexport const handleVideoCanPlay = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { settings } = store.getState().user;\r\n event.preventDefault();\r\n dispatch(setIsLoading(false));\r\n dispatch(setCanPlayVideo(true));\r\n mainPlayerVideoTag().volume = settings.volume / 100;\r\n dispatch(setDuration(event.target.duration));\r\n};\r\n\r\nexport const handleVideoEnded = (event: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setIsEnded(true));\r\n dispatch(setActiveElements(true));\r\n handleVideoTimeline(mainPlayerVideoTag().duration);\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n};\r\n\r\n// ************* IOS Video Tag Handlers ************* //\r\n\r\nexport const handleIosVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n timerRef.current = Date.now();\r\n dispatch(setFirstPlay(false));\r\n};\r\n\r\nexport const handleIosVideoPlaying = () => {\r\n const dispatch = store.dispatch;\r\n dispatch(setIsLoading(false));\r\n};\r\n\r\nexport const handleIosVideoTimeUpdate = (event: any) => {\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n};\r\n\r\nexport const handleIosVideoEnded = () => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n dispatch(setIsEnded(true));\r\n dispatch(setActiveElements(true));\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n};\r\n\r\n// ************* Static Video Tag Handlers ************* //\r\n\r\nexport const handleStaticVideoPause = (event: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n dispatch(setPlay(false));\r\n};\r\n\r\nexport const handleStaticVideoPlay = (event: any, timerRef: any) => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n const { currentTime } = store.getState().controller;\r\n event.preventDefault();\r\n dispatch(setPlay(true));\r\n timerRef.current = Date.now();\r\n dispatch(setSubtitleText(\"\"));\r\n if (conditions(ConditionName.hasOnPlayParams)) params.onPlay!(currentTime);\r\n\r\n if (conditions(ConditionName.isFirstPlay)) {\r\n if (conditions(ConditionName.hasRawSubtitles)) handleSubtitle();\r\n if (conditions(ConditionName.hasFullScreenParams)) {\r\n handleAutoFullScreen();\r\n if (conditions(ConditionName.isFullScreen)) handleLockOrientation();\r\n }\r\n }\r\n};\r\n\r\nexport const handleStaticVideoPlaying = (\r\n loadingDurationRef: any,\r\n initialWaitingDurationRef: any,\r\n timerRef: any\r\n) => {\r\n const dispatch = store.dispatch;\r\n const { firstPlay } = store.getState().controller;\r\n dispatch(setIsLoading(false));\r\n if (firstPlay && !!mainPlayerVideoTag().played)\r\n sendFluentLog(\r\n initLog(\r\n Math.round(loadingDurationRef.current),\r\n Date.now() - initialWaitingDurationRef.current,\r\n 0,\r\n Date.now() - timerRef.current,\r\n timerRef\r\n )\r\n );\r\n dispatch(setFirstPlay(false));\r\n};\r\n\r\nexport const handleStaticVideoTimeUpdate = (event: any) => {\r\n const { onChangeCurrentTime } = store.getState().videoData.params;\r\n const dispatch = store.dispatch;\r\n const { selectedSubtitle } = store.getState().videoData;\r\n event.preventDefault();\r\n dispatch(setCurrentTime(event.target.currentTime));\r\n dispatch(setDuration(event.target.duration));\r\n if (conditions(ConditionName.hasOnChangeCurrentTime))\r\n onChangeCurrentTime!(event.target.currentTime);\r\n if (conditions(ConditionName.hasActiveCue))\r\n dispatch(setSubtitleText((selectedSubtitle!.activeCues![0] as any).text));\r\n};\r\n\r\nexport const handleStaticVideoCanPlay = (event: any) => {\r\n const dispatch = store.dispatch;\r\n event.preventDefault();\r\n dispatch(setIsLoading(false));\r\n dispatch(setCanPlayVideo(true));\r\n};\r\n\r\nexport const handleStaticVideoLoadedData = (event: any, intervalRef: any) => {\r\n event.preventDefault();\r\n handleBufferedTime(event, intervalRef);\r\n};\r\n\r\nexport const handleStaticVideoEnded = (event: any) => {\r\n const { params } = store.getState().videoData;\r\n if (conditions(ConditionName.hasOnFinishedParams)) params.onFinished!();\r\n event.preventDefault();\r\n};\r\n\r\nexport const handleMiniPlayerMediaAttached = async (hls: any) => {\r\n const { stream_link } = store.getState().miniPlayer.details;\r\n hls.loadSource(stream_link);\r\n};\r\n\r\nexport const handleVideoVisibilityChange = () => {\r\n handleVideoTimeline(mainPlayerVideoTag().currentTime);\r\n};\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk5P3VTPML_js=require('./chunk-5P3VTPML.js'),chunk6YRPQDCQ_js=require('./chunk-6YRPQDCQ.js'),chunkS7SXQ5YW_js=require('./chunk-S7SXQ5YW.js'),react=require('react'),reactRedux=require('react-redux');chunkS7SXQ5YW_js.e();var b=()=>{let a=chunkS7SXQ5YW_js.z(),{params:r}=chunkS7SXQ5YW_js.A(({videoData:{params:o}})=>({params:o}),reactRedux.shallowEqual);react.useEffect(()=>{chunk6YRPQDCQ_js.t("hasCurrentTimeParams")&&(chunk6YRPQDCQ_js.u().currentTime=r.currentTime,a(chunkS7SXQ5YW_js.h(r.currentTime)));},[r.currentTime]);},j=b;chunkS7SXQ5YW_js.e();var w=()=>{let{rawSubtitles:a}=chunkS7SXQ5YW_js.A(({videoData:{rawSubtitles:r}})=>({rawSubtitles:r}),reactRedux.shallowEqual);react.useEffect(()=>{let r=chunk6YRPQDCQ_js.u().getElementsByTagName("track");for(let o=0;o<r.length;o++)r[o].addEventListener("cuechange",u=>{let c=u.target.track,l;c.activeCues&&(l=c.activeCues[0]),l&&(setTimeout(()=>{let n=document.getElementById("subtitle-id");n&&(n.style.display="block");},300),l.onexit=()=>{let n=document.getElementById("subtitle-id");n&&(n.style.display="none");});});},[a]);},R=w;chunkS7SXQ5YW_js.e();var P=()=>{let a=chunkS7SXQ5YW_js.z(),{rawSubtitles:r}=chunkS7SXQ5YW_js.A(({videoData:{rawSubtitles:o}})=>({rawSubtitles:o}),reactRedux.shallowEqual);react.useEffect(()=>{let o=chunk6YRPQDCQ_js.u();if(!o)return;let u=chunk6YRPQDCQ_js.ra(r||[]),c=Array.from(o.querySelectorAll("track")),l=new Map(c.map(t=>[t.srclang,t]));c.forEach(t=>{!u.some(e=>e.lang===t.srclang)&&t.isConnected&&t.remove();}),u.forEach(t=>{let p=l.get(t.lang);if(!p){let e=document.createElement("track");e.kind="subtitles",e.src=t.url,e.srclang=t.lang,e.label=chunk6YRPQDCQ_js.sa(t.lang),e.default=!!t.is_default,o.appendChild(e);return}if(p.src!==t.url){let e=document.createElement("track");e.kind="subtitles",e.src=t.url,e.srclang=t.lang,e.label=chunk6YRPQDCQ_js.sa(t.lang),e.default=!!t.is_default,p.replaceWith(e);}});let n=setTimeout(()=>{let t=Array.from(o.textTracks);a(chunk6YRPQDCQ_js.i(t));},200);return ()=>clearTimeout(n)},[r,a]);},ot=P;chunkS7SXQ5YW_js.e();var L=()=>{let{activeSubtitle:a}=chunkS7SXQ5YW_js.A(({videoData:r})=>({activeSubtitle:r.params?.activeSubtitle}),reactRedux.shallowEqual);react.useEffect(()=>{chunk6YRPQDCQ_js.t("hasActiveSubtitleInParams")&&setTimeout(()=>chunk5P3VTPML_js.b(a),500);},[a]);},pt=L;exports.a=j;exports.b=R;exports.c=ot;exports.d=pt;//# sourceMappingURL=chunk-443LJTEX.js.map
2
+ //# sourceMappingURL=chunk-443LJTEX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/videoPlayerLibrary/helpers/hooks/useJumpToCurrentTime.tsx","../src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx","../src/videoPlayerLibrary/helpers/hooks/useAppendSubtitle.tsx","../src/videoPlayerLibrary/helpers/hooks/useActiveSubtitleAutomatic.tsx"],"names":["init_cjs_shims","useJumpToCurrentTime","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","useEffect","conditions","mainPlayerVideoTag","setCurrentTime","useJumpToCurrentTime_default","useHideSubtitle","rawSubtitles","tracks","i","event","track","activeCue","el","useHideSubtitle_default","useAppendSubtitle","videoEl","newSubtitles","sortLanguages","existingTracks","existingMap","s","subtitle","existing","trackEl","getSubtitleLabel","newTrack","timeoutId","setSubtitles","useAppendSubtitle_default","useActiveSubtitleAutomatic","activeSubtitle","videoData","handleSubtitle","useActiveSubtitleAutomatic_default"],"mappings":"0NAAAA,kBAAAA,EAAAA,CAQA,IAAMC,CAAAA,CAAuB,IAAM,CAC/B,IAAMC,CAAAA,CAAWC,mBAAAA,EAAe,CAC1B,CAAE,MAAA,CAAAC,CAAO,EAAIC,mBAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,MAAA,CAAAD,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAE3FC,eAAAA,CAAU,IAAM,CACRC,mBAAAA,CAAAA,sBAA6C,CAAA,GAC/CC,qBAAmB,CAAE,WAAA,CAAcL,CAAAA,CAAO,WAAA,CAC1CF,CAAAA,CAASQ,kBAAAA,CAAeN,EAAO,WAAY,CAAC,CAAA,EAElD,CAAA,CAAG,CAACA,CAAAA,CAAO,WAAW,CAAC,EAC3B,CAAA,CAEOO,CAAAA,CAAQV,ECpBfD,kBAAAA,EAAAA,CAKA,IAAMY,CAAAA,CAAkB,IAAM,CAC5B,GAAM,CAAE,aAAAC,CAAa,CAAA,CAAIR,mBAAAA,CACvB,CAAC,CAAE,SAAA,CAAW,CAAE,YAAA,CAAAQ,CAAa,CAAE,CAAA,IAAO,CAAE,YAAA,CAAAA,CAAa,CAAA,CAAA,CACrDP,uBACF,CAAA,CAEAC,eAAAA,CAAU,IAAM,CACd,IAAMO,CAAAA,CAASL,mBAAAA,EAAmB,CAAE,oBAAA,CAAqB,OAAO,CAAA,CAChE,QAASM,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAID,CAAAA,CAAO,MAAA,CAAQC,CAAAA,EAAAA,CACjCD,EAAOC,CAAC,CAAA,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,CAED,IAAMC,EAAY,UAAA,CAAW,IAAM,CACjC,IAAMnB,CAAAA,CAAS,KAAA,CAAM,KAAKQ,CAAAA,CAAQ,UAAU,CAAA,CAC5CpB,CAAAA,CAASgC,kBAAAA,CAAapB,CAAM,CAAC,EAC/B,CAAA,CAAG,GAAG,CAAA,CAEN,OAAO,IAAM,aAAamB,CAAS,CACrC,CAAA,CAAG,CAACpB,CAAAA,CAAcX,CAAQ,CAAC,EAC7B,CAAA,CAEOiC,EAAAA,CAAQd,EC1DfrB,kBAAAA,EAAAA,KAOMoC,CAAAA,CAA6B,IAAM,CACvC,GAAM,CAAE,cAAA,CAAAC,CAAe,CAAA,CAAIhC,mBAAAA,CACzB,CAAC,CAAE,SAAA,CAAAiC,CAAU,KAAO,CAClB,cAAA,CAAgBA,CAAAA,CAAU,MAAA,EAAQ,cACpC,CAAA,CAAA,CACAhC,uBACF,CAAA,CAEAC,eAAAA,CAAU,IAAM,CACVC,mBAAAA,CAAAA,2BAAkD,CAAA,EACpD,WAAW,IAAM+B,kBAAAA,CAAeF,CAAc,CAAA,CAAG,GAAG,EACxD,CAAA,CAAG,CAACA,CAAc,CAAC,EACrB,CAAA,CAEOG,EAAAA,CAAQJ","file":"chunk-APV3JQFO.js","sourcesContent":["import { useEffect } from \"react\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { setCurrentTime } from \"../redux/slices/controllerSlice\";\r\nimport { shallowEqual } from \"react-redux\";\r\n\r\nconst useJumpToCurrentTime = () => {\r\n const dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.hasCurrentTimeParams)) {\r\n mainPlayerVideoTag().currentTime = params.currentTime!;\r\n dispatch(setCurrentTime(params.currentTime!));\r\n }\r\n }, [params.currentTime]);\r\n}\r\n\r\nexport default useJumpToCurrentTime;","import { useEffect } from \"react\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\n\r\nconst useHideSubtitle = () => {\r\n const { rawSubtitles } = useAppSelector(\r\n ({ videoData: { rawSubtitles } }) => ({ rawSubtitles }),\r\n shallowEqual\r\n );\r\n\r\n useEffect(() => {\r\n const tracks = mainPlayerVideoTag().getElementsByTagName(\"track\");\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].addEventListener(\"cuechange\", (event) => {\r\n const track = (event.target! as any).track;\r\n let activeCue: any;\r\n if (track.activeCues) activeCue = track.activeCues[0];\r\n if (activeCue) {\r\n setTimeout(() => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"block\";\r\n }, 300);\r\n\r\n activeCue.onexit = () => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"none\";\r\n };\r\n }\r\n });\r\n }\r\n }, [rawSubtitles]);\r\n};\r\n\r\nexport default useHideSubtitle;\r\n","import { useEffect } from \"react\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { getSubtitleLabel, sortLanguages } from \"../helpers\";\r\nimport { setSubtitles } from \"../redux/slices/videoDataSlice\";\r\n\r\nconst useAppendSubtitle = () => {\r\n const dispatch = useAppDispatch();\r\n const { rawSubtitles } = useAppSelector(({ videoData: { rawSubtitles } }) => ({ rawSubtitles }), shallowEqual);\r\n\r\n useEffect(() => {\r\n const videoEl = mainPlayerVideoTag();\r\n if (!videoEl) return;\r\n\r\n const newSubtitles = sortLanguages(rawSubtitles || []);\r\n const existingTracks = Array.from(videoEl.querySelectorAll(\"track\"));\r\n const existingMap = new Map(existingTracks.map((t) => [t.srclang, t]));\r\n existingTracks.forEach((track) => {\r\n const stillExists = newSubtitles.some((s: any) => s.lang === track.srclang);\r\n if (!stillExists && track.isConnected) track.remove();\r\n });\r\n\r\n newSubtitles.forEach((subtitle: any) => {\r\n const existing = existingMap.get(subtitle.lang);\r\n\r\n if (!existing) {\r\n const trackEl = document.createElement(\"track\");\r\n trackEl.kind = \"subtitles\";\r\n trackEl.src = subtitle.url;\r\n trackEl.srclang = subtitle.lang;\r\n trackEl.label = getSubtitleLabel(subtitle.lang) as any;\r\n trackEl.default = !!subtitle.is_default;\r\n videoEl.appendChild(trackEl);\r\n return;\r\n }\r\n\r\n if (existing.src !== subtitle.url) {\r\n const newTrack = document.createElement(\"track\");\r\n newTrack.kind = \"subtitles\";\r\n newTrack.src = subtitle.url;\r\n newTrack.srclang = subtitle.lang;\r\n newTrack.label = getSubtitleLabel(subtitle.lang) as any;\r\n newTrack.default = !!subtitle.is_default;\r\n\r\n existing.replaceWith(newTrack);\r\n }\r\n });\r\n\r\n const timeoutId = setTimeout(() => {\r\n const tracks = Array.from(videoEl.textTracks);\r\n dispatch(setSubtitles(tracks));\r\n }, 200);\r\n\r\n return () => clearTimeout(timeoutId);\r\n }, [rawSubtitles, dispatch]);\r\n};\r\n\r\nexport default useAppendSubtitle;\r\n","import { useEffect } from \"react\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { handleSubtitle } from \"../redux/actions/videoData.actions\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\n\r\nconst useActiveSubtitleAutomatic = () => {\r\n const { activeSubtitle } = useAppSelector(\r\n ({ videoData }) => ({\r\n activeSubtitle: videoData.params?.activeSubtitle,\r\n }),\r\n shallowEqual\r\n );\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.hasActiveSubtitleInParams))\r\n setTimeout(() => handleSubtitle(activeSubtitle), 500);\r\n }, [activeSubtitle]);\r\n};\r\n\r\nexport default useActiveSubtitleAutomatic;\r\n"]}
1
+ {"version":3,"sources":["../src/videoPlayerLibrary/helpers/hooks/useJumpToCurrentTime.tsx","../src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx","../src/videoPlayerLibrary/helpers/hooks/useAppendSubtitle.tsx","../src/videoPlayerLibrary/helpers/hooks/useActiveSubtitleAutomatic.tsx"],"names":["init_cjs_shims","useJumpToCurrentTime","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","useEffect","conditions","mainPlayerVideoTag","setCurrentTime","useJumpToCurrentTime_default","useHideSubtitle","rawSubtitles","tracks","i","event","track","activeCue","el","useHideSubtitle_default","useAppendSubtitle","videoEl","newSubtitles","sortLanguages","existingTracks","existingMap","s","subtitle","existing","trackEl","getSubtitleLabel","newTrack","timeoutId","setSubtitles","useAppendSubtitle_default","useActiveSubtitleAutomatic","activeSubtitle","videoData","handleSubtitle","useActiveSubtitleAutomatic_default"],"mappings":"0NAAAA,kBAAAA,EAAAA,CAQA,IAAMC,CAAAA,CAAuB,IAAM,CAC/B,IAAMC,CAAAA,CAAWC,kBAAAA,EAAe,CAC1B,CAAE,MAAA,CAAAC,CAAO,EAAIC,kBAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,MAAA,CAAAD,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAE3FC,eAAAA,CAAU,IAAM,CACRC,kBAAAA,CAAAA,sBAA6C,CAAA,GAC/CC,oBAAmB,CAAE,WAAA,CAAcL,CAAAA,CAAO,WAAA,CAC1CF,CAAAA,CAASQ,kBAAAA,CAAeN,EAAO,WAAY,CAAC,CAAA,EAElD,CAAA,CAAG,CAACA,CAAAA,CAAO,WAAW,CAAC,EAC3B,CAAA,CAEOO,CAAAA,CAAQV,ECpBfD,kBAAAA,EAAAA,CAKA,IAAMY,CAAAA,CAAkB,IAAM,CAC5B,GAAM,CAAE,aAAAC,CAAa,CAAA,CAAIR,kBAAAA,CACvB,CAAC,CA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CAAA,CAC/CA,CAAAA,CAAS,IAAA,CAAO,WAAA,CAChBA,EAAS,GAAA,CAAMJ,CAAAA,CAAS,GAAA,CACxBI,CAAAA,CAAS,OAAA,CAAUJ,CAAAA,CAAS,KAC5BI,CAAAA,CAAS,KAAA,CAAQD,mBAAAA,CAAiBH,CAAAA,CAAS,IAAI,CAAA,CAC/CI,EAAS,OAAA,CAAU,CAAC,CAACJ,CAAAA,CAAS,UAAA,CAE9BC,CAAAA,CAAS,YAAYG,CAAQ,EAC/B,CACF,CAAC,CAAA,CAED,IAAMC,EAAY,UAAA,CAAW,IAAM,CACjC,IAAMnB,CAAAA,CAAS,KAAA,CAAM,KAAKQ,CAAAA,CAAQ,UAAU,CAAA,CAC5CpB,CAAAA,CAASgC,kBAAAA,CAAapB,CAAM,CAAC,EAC/B,CAAA,CAAG,GAAG,CAAA,CAEN,OAAO,IAAM,aAAamB,CAAS,CACrC,CAAA,CAAG,CAACpB,CAAAA,CAAcX,CAAQ,CAAC,EAC7B,CAAA,CAEOiC,EAAAA,CAAQd,EC1DfrB,kBAAAA,EAAAA,KAOMoC,CAAAA,CAA6B,IAAM,CACvC,GAAM,CAAE,cAAA,CAAAC,CAAe,CAAA,CAAIhC,kBAAAA,CACzB,CAAC,CAAE,SAAA,CAAAiC,CAAU,KAAO,CAClB,cAAA,CAAgBA,CAAAA,CAAU,MAAA,EAAQ,cACpC,CAAA,CAAA,CACAhC,uBACF,CAAA,CAEAC,eAAAA,CAAU,IAAM,CACVC,kBAAAA,CAAAA,2BAAkD,CAAA,EACpD,WAAW,IAAM+B,kBAAAA,CAAeF,CAAc,CAAA,CAAG,GAAG,EACxD,CAAA,CAAG,CAACA,CAAc,CAAC,EACrB,CAAA,CAEOG,EAAAA,CAAQJ","file":"chunk-443LJTEX.js","sourcesContent":["import { useEffect } from \"react\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { setCurrentTime } from \"../redux/slices/controllerSlice\";\r\nimport { shallowEqual } from \"react-redux\";\r\n\r\nconst useJumpToCurrentTime = () => {\r\n const dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.hasCurrentTimeParams)) {\r\n mainPlayerVideoTag().currentTime = params.currentTime!;\r\n dispatch(setCurrentTime(params.currentTime!));\r\n }\r\n }, [params.currentTime]);\r\n}\r\n\r\nexport default useJumpToCurrentTime;","import { useEffect } from \"react\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\n\r\nconst useHideSubtitle = () => {\r\n const { rawSubtitles } = useAppSelector(\r\n ({ videoData: { rawSubtitles } }) => ({ rawSubtitles }),\r\n shallowEqual\r\n );\r\n\r\n useEffect(() => {\r\n const tracks = mainPlayerVideoTag().getElementsByTagName(\"track\");\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].addEventListener(\"cuechange\", (event) => {\r\n const track = (event.target! as any).track;\r\n let activeCue: any;\r\n if (track.activeCues) activeCue = track.activeCues[0];\r\n if (activeCue) {\r\n setTimeout(() => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"block\";\r\n }, 300);\r\n\r\n activeCue.onexit = () => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"none\";\r\n };\r\n }\r\n });\r\n }\r\n }, [rawSubtitles]);\r\n};\r\n\r\nexport default useHideSubtitle;\r\n","import { useEffect } from \"react\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { getSubtitleLabel, sortLanguages } from \"../helpers\";\r\nimport { setSubtitles } from \"../redux/slices/videoDataSlice\";\r\n\r\nconst useAppendSubtitle = () => {\r\n const dispatch = useAppDispatch();\r\n const { rawSubtitles } = useAppSelector(({ videoData: { rawSubtitles } }) => ({ rawSubtitles }), shallowEqual);\r\n\r\n useEffect(() => {\r\n const videoEl = mainPlayerVideoTag();\r\n if (!videoEl) return;\r\n\r\n const newSubtitles = sortLanguages(rawSubtitles || []);\r\n const existingTracks = Array.from(videoEl.querySelectorAll(\"track\"));\r\n const existingMap = new Map(existingTracks.map((t) => [t.srclang, t]));\r\n existingTracks.forEach((track) => {\r\n const stillExists = newSubtitles.some((s: any) => s.lang === track.srclang);\r\n if (!stillExists && track.isConnected) track.remove();\r\n });\r\n\r\n newSubtitles.forEach((subtitle: any) => {\r\n const existing = existingMap.get(subtitle.lang);\r\n\r\n if (!existing) {\r\n const trackEl = document.createElement(\"track\");\r\n trackEl.kind = \"subtitles\";\r\n trackEl.src = subtitle.url;\r\n trackEl.srclang = subtitle.lang;\r\n trackEl.label = getSubtitleLabel(subtitle.lang) as any;\r\n trackEl.default = !!subtitle.is_default;\r\n videoEl.appendChild(trackEl);\r\n return;\r\n }\r\n\r\n if (existing.src !== subtitle.url) {\r\n const newTrack = document.createElement(\"track\");\r\n newTrack.kind = \"subtitles\";\r\n newTrack.src = subtitle.url;\r\n newTrack.srclang = subtitle.lang;\r\n newTrack.label = getSubtitleLabel(subtitle.lang) as any;\r\n newTrack.default = !!subtitle.is_default;\r\n\r\n existing.replaceWith(newTrack);\r\n }\r\n });\r\n\r\n const timeoutId = setTimeout(() => {\r\n const tracks = Array.from(videoEl.textTracks);\r\n dispatch(setSubtitles(tracks));\r\n }, 200);\r\n\r\n return () => clearTimeout(timeoutId);\r\n }, [rawSubtitles, dispatch]);\r\n};\r\n\r\nexport default useAppendSubtitle;\r\n","import { useEffect } from \"react\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { handleSubtitle } from \"../redux/actions/videoData.actions\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\n\r\nconst useActiveSubtitleAutomatic = () => {\r\n const { activeSubtitle } = useAppSelector(\r\n ({ videoData }) => ({\r\n activeSubtitle: videoData.params?.activeSubtitle,\r\n }),\r\n shallowEqual\r\n );\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.hasActiveSubtitleInParams))\r\n setTimeout(() => handleSubtitle(activeSubtitle), 500);\r\n }, [activeSubtitle]);\r\n};\r\n\r\nexport default useActiveSubtitleAutomatic;\r\n"]}