cafe-video-player 1.7.0 → 1.8.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 (209) hide show
  1. package/.eslintrc.json +3 -0
  2. package/next.config.mjs +12 -0
  3. package/package.json +1 -1
  4. package/postcss.config.mjs +8 -0
  5. package/public/next.svg +1 -0
  6. package/public/vercel.svg +1 -0
  7. package/src/app/favicon.ico +0 -0
  8. package/src/app/globals.css +6 -0
  9. package/src/app/layout.tsx +24 -0
  10. package/src/app/page.tsx +58 -0
  11. package/src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx +155 -0
  12. package/src/videoPlayerLibrary/components/custom-components/elapsedTime/elapsedTime.tsx +30 -0
  13. package/src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbar.tsx +53 -0
  14. package/src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbarTooltip.tsx +13 -0
  15. package/src/videoPlayerLibrary/components/custom-components/footer/footer.tsx +47 -0
  16. package/src/videoPlayerLibrary/components/custom-components/footer/progressbar/progressbar.tsx +76 -0
  17. package/src/videoPlayerLibrary/components/custom-components/fullScreen/fullScreen.tsx +47 -0
  18. package/src/videoPlayerLibrary/components/custom-components/header/header.tsx +19 -0
  19. package/src/videoPlayerLibrary/components/custom-components/loader/loader.tsx +20 -0
  20. package/src/videoPlayerLibrary/components/custom-components/lockUnlock/lock.tsx +23 -0
  21. package/src/videoPlayerLibrary/components/custom-components/lockUnlock/unlock.tsx +18 -0
  22. package/src/videoPlayerLibrary/components/custom-components/main/main.tsx +64 -0
  23. package/src/videoPlayerLibrary/components/custom-components/notActive/notActive.tsx +23 -0
  24. package/src/videoPlayerLibrary/components/custom-components/pictureInPicture/pictureInPicture.tsx +34 -0
  25. package/src/videoPlayerLibrary/components/custom-components/playPause/playPause.tsx +31 -0
  26. package/src/videoPlayerLibrary/components/custom-components/popover/popover.tsx +151 -0
  27. package/src/videoPlayerLibrary/components/custom-components/qualityLevels/qualityLevels.tsx +135 -0
  28. package/src/videoPlayerLibrary/components/custom-components/settings/settings.tsx +122 -0
  29. package/src/videoPlayerLibrary/components/custom-components/soundVolume/soundVolume.tsx +83 -0
  30. package/src/videoPlayerLibrary/components/custom-components/speed/speed.tsx +120 -0
  31. package/src/videoPlayerLibrary/components/custom-components/subtitles/displaySubtitle.tsx +43 -0
  32. package/src/videoPlayerLibrary/components/custom-components/subtitles/subtitleIcon.tsx +34 -0
  33. package/src/videoPlayerLibrary/components/custom-components/title/title.tsx +20 -0
  34. package/src/videoPlayerLibrary/components/custom-components/toggle/toggle.tsx +14 -0
  35. package/src/videoPlayerLibrary/components/custom-components/tooltip/tooltip.tsx +43 -0
  36. package/src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx +176 -0
  37. package/src/videoPlayerLibrary/components/custom-components/videoArea/videoArea.tsx +138 -0
  38. package/src/videoPlayerLibrary/components/custom-components/videoAreaShadow.tsx/videoAreaShadow.tsx +19 -0
  39. package/src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx +181 -0
  40. package/src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx +57 -0
  41. package/src/videoPlayerLibrary/components/custom-components/videoTag/videoTag.tsx +12 -0
  42. package/src/videoPlayerLibrary/components/icon-components/mute.tsx +14 -0
  43. package/src/videoPlayerLibrary/components/icon-components/unMute.tsx +11 -0
  44. package/src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx +17 -0
  45. package/src/videoPlayerLibrary/components/videoPlayer/videoPlayer.tsx +50 -0
  46. package/src/videoPlayerLibrary/components/videoPlayer/vodPlayer/vodPlayer.tsx +41 -0
  47. package/src/videoPlayerLibrary/helpers/conditions/conditions.ts +163 -0
  48. package/src/videoPlayerLibrary/helpers/configs/nextConfigs/next.config.js +4 -0
  49. package/src/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage.ts +1 -0
  50. package/src/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage_lib.ts +1 -0
  51. package/src/videoPlayerLibrary/helpers/constants.ts +5 -0
  52. package/src/videoPlayerLibrary/helpers/environment.ts +11 -0
  53. package/src/videoPlayerLibrary/helpers/getDetailsConfigs.ts +46 -0
  54. package/src/videoPlayerLibrary/helpers/helpers.ts +212 -0
  55. package/src/videoPlayerLibrary/helpers/hooks/useActiveInActive.tsx +97 -0
  56. package/src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx +15 -0
  57. package/src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx +24 -0
  58. package/src/videoPlayerLibrary/helpers/hooks/useFullScreen.tsx +41 -0
  59. package/src/videoPlayerLibrary/helpers/hooks/useGetData/useGetData.tsx +7 -0
  60. package/src/videoPlayerLibrary/helpers/hooks/useGetData/useGetDetails.tsx +20 -0
  61. package/src/videoPlayerLibrary/helpers/hooks/useHandleKeyPress.tsx +36 -0
  62. package/src/videoPlayerLibrary/helpers/hooks/useHandleParams.tsx +66 -0
  63. package/src/videoPlayerLibrary/helpers/hooks/useHandleResize.tsx +45 -0
  64. package/src/videoPlayerLibrary/helpers/hooks/useHandleScroll.tsx +34 -0
  65. package/src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx +33 -0
  66. package/src/videoPlayerLibrary/helpers/hooks/useKeyPress.tsx +20 -0
  67. package/src/videoPlayerLibrary/helpers/hooks/useLongPress.tsx +26 -0
  68. package/src/videoPlayerLibrary/helpers/hooks/useOnClickOutside.tsx +19 -0
  69. package/src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx +59 -0
  70. package/src/videoPlayerLibrary/helpers/hooks/useSetSubtitleFirstPlay.tsx +18 -0
  71. package/src/videoPlayerLibrary/helpers/interfaces/enums.ts +85 -0
  72. package/src/videoPlayerLibrary/helpers/interfaces/interfaces.ts +217 -0
  73. package/src/videoPlayerLibrary/helpers/logs/fluentdLogger.ts +21 -0
  74. package/src/videoPlayerLibrary/helpers/logs/logs.ts +228 -0
  75. package/src/videoPlayerLibrary/helpers/redux/actions/controller.actions.ts +128 -0
  76. package/src/videoPlayerLibrary/helpers/redux/actions/playerCore.actions.ts +419 -0
  77. package/src/videoPlayerLibrary/helpers/redux/actions/progressbar.actions.ts +328 -0
  78. package/src/videoPlayerLibrary/helpers/redux/actions/user.actions.ts +45 -0
  79. package/src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts +67 -0
  80. package/src/videoPlayerLibrary/helpers/redux/hooks.ts +5 -0
  81. package/src/videoPlayerLibrary/helpers/redux/slices/controllerSlice.ts +115 -0
  82. package/src/videoPlayerLibrary/helpers/redux/slices/popoversSlice.ts +37 -0
  83. package/src/videoPlayerLibrary/helpers/redux/slices/userSlice.ts +38 -0
  84. package/src/videoPlayerLibrary/helpers/redux/slices/videoDataSlice.ts +111 -0
  85. package/src/videoPlayerLibrary/helpers/redux/store.ts +21 -0
  86. package/src/videoPlayerLibrary/helpers/services/apiCaller.ts +111 -0
  87. package/src/videoPlayerLibrary/helpers/services/baseUrl.ts +5 -0
  88. package/src/videoPlayerLibrary/helpers/services/services.ts +15 -0
  89. package/src/videoPlayerLibrary/images/importImages.ts +29 -0
  90. package/src/videoPlayerLibrary/images/svg/ArrowLeft.svg +3 -0
  91. package/src/videoPlayerLibrary/images/svg/Backward15.svg +5 -0
  92. package/src/videoPlayerLibrary/images/svg/BigPause.svg +4 -0
  93. package/src/videoPlayerLibrary/images/svg/BigPlay.svg +3 -0
  94. package/src/videoPlayerLibrary/images/svg/ChevronLeft.svg +3 -0
  95. package/src/videoPlayerLibrary/images/svg/CloseSquare.svg +5 -0
  96. package/src/videoPlayerLibrary/images/svg/Forward15.svg +5 -0
  97. package/src/videoPlayerLibrary/images/svg/FullScreen.svg +6 -0
  98. package/src/videoPlayerLibrary/images/svg/Lock.svg +5 -0
  99. package/src/videoPlayerLibrary/images/svg/Mute.svg +4 -0
  100. package/src/videoPlayerLibrary/images/svg/NonFullScreen.svg +6 -0
  101. package/src/videoPlayerLibrary/images/svg/NotFound.svg +34 -0
  102. package/src/videoPlayerLibrary/images/svg/PictureInPicture.svg +4 -0
  103. package/src/videoPlayerLibrary/images/svg/QualitySetting.svg +3 -0
  104. package/src/videoPlayerLibrary/images/svg/QualitySetting1.svg +3 -0
  105. package/src/videoPlayerLibrary/images/svg/Settings.svg +4 -0
  106. package/src/videoPlayerLibrary/images/svg/Speed.svg +7 -0
  107. package/src/videoPlayerLibrary/images/svg/Speed1.svg +4 -0
  108. package/src/videoPlayerLibrary/images/svg/SubtitleFill.svg +3 -0
  109. package/src/videoPlayerLibrary/images/svg/SubtitleOutline.svg +5 -0
  110. package/src/videoPlayerLibrary/images/svg/SubtitleOutlineGray.svg +5 -0
  111. package/src/videoPlayerLibrary/images/svg/Sun.svg +4 -0
  112. package/src/videoPlayerLibrary/images/svg/Tick.svg +3 -0
  113. package/src/videoPlayerLibrary/images/svg/UnMute.svg +5 -0
  114. package/src/videoPlayerLibrary/images/svg/Unlock.svg +5 -0
  115. package/src/videoPlayerLibrary/index.ts +1 -0
  116. package/src/videoPlayerLibrary/styles/custom-styles/index.css +4 -0
  117. package/src/videoPlayerLibrary/styles/custom-styles/loader.css +78 -0
  118. package/src/videoPlayerLibrary/styles/custom-styles/progressBar.css +14 -0
  119. package/src/videoPlayerLibrary/styles/custom-styles/scrollbar.css +32 -0
  120. package/src/videoPlayerLibrary/styles/custom-styles/soundVolume.css +57 -0
  121. package/src/videoPlayerLibrary/styles/fonts.css +20 -0
  122. package/src/videoPlayerLibrary/styles/styles.css +106 -0
  123. package/src/videoPlayerLibrary/videoPlayerLibrary.tsx +16 -0
  124. package/tailwind.config.ts +55 -0
  125. package/tsconfig.json +23 -0
  126. package/tsconfig.library.json +23 -0
  127. package/tsup.config.ts +18 -0
  128. package/backwardForward-OQJYFAQ4.mjs +0 -7
  129. package/backwardForward-OQJYFAQ4.mjs.map +0 -1
  130. package/backwardForward-P3P4S2ZE.js +0 -13
  131. package/backwardForward-P3P4S2ZE.js.map +0 -1
  132. package/chunk-6NSC465P.js +0 -37
  133. package/chunk-6NSC465P.js.map +0 -1
  134. package/chunk-7LB4RAGD.js +0 -11
  135. package/chunk-7LB4RAGD.js.map +0 -1
  136. package/chunk-BJ4CIJKZ.js +0 -90
  137. package/chunk-BJ4CIJKZ.js.map +0 -1
  138. package/chunk-CWMVHGXS.mjs +0 -9
  139. package/chunk-CWMVHGXS.mjs.map +0 -1
  140. package/chunk-CY73TBOJ.mjs +0 -8
  141. package/chunk-CY73TBOJ.mjs.map +0 -1
  142. package/chunk-DBPGS72Q.mjs +0 -5
  143. package/chunk-DBPGS72Q.mjs.map +0 -1
  144. package/chunk-K2JG5NRS.js +0 -21
  145. package/chunk-K2JG5NRS.js.map +0 -1
  146. package/chunk-KCRYSZI6.mjs +0 -9
  147. package/chunk-KCRYSZI6.mjs.map +0 -1
  148. package/chunk-LJQ3BDPD.js +0 -16
  149. package/chunk-LJQ3BDPD.js.map +0 -1
  150. package/chunk-PEF62RSW.mjs +0 -8
  151. package/chunk-PEF62RSW.mjs.map +0 -1
  152. package/chunk-PPTHLXJQ.mjs +0 -7
  153. package/chunk-PPTHLXJQ.mjs.map +0 -1
  154. package/chunk-SPUHJYDE.js +0 -11
  155. package/chunk-SPUHJYDE.js.map +0 -1
  156. package/chunk-U23ZPGF2.js +0 -9
  157. package/chunk-U23ZPGF2.js.map +0 -1
  158. package/chunk-U6HUFFUL.js +0 -18
  159. package/chunk-U6HUFFUL.js.map +0 -1
  160. package/chunk-UIPWLWLK.js +0 -32
  161. package/chunk-UIPWLWLK.js.map +0 -1
  162. package/chunk-V2LZHMTD.mjs +0 -25
  163. package/chunk-V2LZHMTD.mjs.map +0 -1
  164. package/chunk-YB4NYTRZ.mjs +0 -7
  165. package/chunk-YB4NYTRZ.mjs.map +0 -1
  166. package/chunk-YRJREWER.mjs +0 -15
  167. package/chunk-YRJREWER.mjs.map +0 -1
  168. package/chunk-YZ2YUV52.mjs +0 -10
  169. package/chunk-YZ2YUV52.mjs.map +0 -1
  170. package/chunk-Z6CUWQ7X.js +0 -11
  171. package/chunk-Z6CUWQ7X.js.map +0 -1
  172. package/index.d.mts +0 -26
  173. package/index.d.ts +0 -26
  174. package/index.js +0 -20
  175. package/index.js.map +0 -1
  176. package/index.mjs +0 -14
  177. package/index.mjs.map +0 -1
  178. package/nonStaticVideoTag-X2LHNAWU.js +0 -24
  179. package/nonStaticVideoTag-X2LHNAWU.js.map +0 -1
  180. package/nonStaticVideoTag-X6VPLYIO.mjs +0 -17
  181. package/nonStaticVideoTag-X6VPLYIO.mjs.map +0 -1
  182. package/notActive-2FUSVSVU.mjs +0 -10
  183. package/notActive-2FUSVSVU.mjs.map +0 -1
  184. package/notActive-E4FZWQIO.js +0 -16
  185. package/notActive-E4FZWQIO.js.map +0 -1
  186. package/staticPlayer-N22SKV2E.mjs +0 -15
  187. package/staticPlayer-N22SKV2E.mjs.map +0 -1
  188. package/staticPlayer-NVMVGIGQ.js +0 -17
  189. package/staticPlayer-NVMVGIGQ.js.map +0 -1
  190. package/staticVideoTag-5ACODYQR.mjs +0 -13
  191. package/staticVideoTag-5ACODYQR.mjs.map +0 -1
  192. package/staticVideoTag-6JYTTN5M.js +0 -15
  193. package/staticVideoTag-6JYTTN5M.js.map +0 -1
  194. package/touchVolumeBrightness-S4HPNA43.js +0 -19
  195. package/touchVolumeBrightness-S4HPNA43.js.map +0 -1
  196. package/touchVolumeBrightness-S7DYCEN7.mjs +0 -13
  197. package/touchVolumeBrightness-S7DYCEN7.mjs.map +0 -1
  198. package/videoArea-LJCSMRSQ.mjs +0 -10
  199. package/videoArea-LJCSMRSQ.mjs.map +0 -1
  200. package/videoArea-V4TOL4SD.js +0 -16
  201. package/videoArea-V4TOL4SD.js.map +0 -1
  202. package/videoPlayerStyles.css +0 -4165
  203. package/vodPlayer-7LYIUN25.mjs +0 -14
  204. package/vodPlayer-7LYIUN25.mjs.map +0 -1
  205. package/vodPlayer-U3MOJUJ5.js +0 -20
  206. package/vodPlayer-U3MOJUJ5.js.map +0 -1
  207. /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Bold.woff2 +0 -0
  208. /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Medium.woff2 +0 -0
  209. /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Regular.woff2 +0 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "next/core-web-vitals"
3
+ }
@@ -0,0 +1,12 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ images: {
4
+ remotePatterns: [
5
+ {
6
+ hostname: "**"
7
+ }
8
+ ]
9
+ }
10
+ };
11
+
12
+ export default nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cafe-video-player",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.cjs",
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
Binary file
@@ -0,0 +1,6 @@
1
+
2
+ @import url(../videoPlayerLibrary/styles/styles.css);
3
+
4
+ @tailwind base;
5
+ @tailwind components;
6
+ @tailwind utilities;
@@ -0,0 +1,24 @@
1
+ import type { Metadata } from "next";
2
+ import { Inter } from "next/font/google";
3
+ import "./globals.css";
4
+
5
+ const inter = Inter({ subsets: ["latin"] });
6
+
7
+ export const metadata: Metadata = {
8
+ title: "Create Next App",
9
+ };
10
+
11
+ export default function RootLayout({
12
+ children,
13
+ }: Readonly<{
14
+ children: React.ReactNode;
15
+ }>) {
16
+ return (
17
+ <html lang="en">
18
+ <body id="alan" className={inter.className}>
19
+ {children}
20
+ <div id="dialog-react-root-videoPlayer"/>
21
+ </body>
22
+ </html>
23
+ );
24
+ }
@@ -0,0 +1,58 @@
1
+ import VideoPlayerLibrary from "../videoPlayerLibrary";
2
+ import { IParams } from "../videoPlayerLibrary/helpers/interfaces/interfaces";
3
+
4
+ export default function Home() {
5
+
6
+ const params: IParams = {
7
+ // type: "mp4",
8
+ // "e-url": "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
9
+ // "e-cover": "aHR0cHM6Ly9zdGF0aWMudmVjdGVlenkuY29tL3N5c3RlbS9yZXNvdXJjZXMvdGh1bWJuYWlscy8wMjUvMDY3Lzc2Mi9zbWFsbC80ay1iZWF1dGlmdWwtY29sb3JmdWwtYWJzdHJhY3Qtd2FsbHBhcGVyLXBob3RvLmpwZw==",
10
+ // bannerAlt: "aaa"
11
+ type: "vod",
12
+ id: "6623",
13
+ scrollElementId: "alan",
14
+ }
15
+
16
+ return (
17
+ <div>
18
+ <div className="pl-flex pl-flex-col desktop:pl-flex-row pl-gap-5 tablet:pl-mt-10">
19
+ <div className="pl-flex pl-flex-col pl-w-full desktop:pl-mr-10">
20
+ <VideoPlayerLibrary params={params} />
21
+ <div>
22
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
23
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
24
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
25
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
26
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
27
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
28
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
29
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
30
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
31
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
32
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
33
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
34
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
35
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
36
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
37
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
38
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
39
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
40
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
41
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
42
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
43
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
44
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
45
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
46
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit sapiente aliquid ut repudiandae corrupti laudantium perspiciatis distinctio reprehenderit adipisci, nemo, obcaecati inventore voluptate natus cum minus, magnam aspernatur alias. Nulla.
47
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsam rem optio consequuntur soluta excepturi culpa minima minus, earum sequi nisi eius aliquid corporis! Labore, ex temporibus! Ducimus nisi eveniet tenetur?
48
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero exercitationem cum nesciunt voluptate at, dolorem doloremque maxime iste expedita ad accusantium animi perferendis odio amet. Quod, vero officia? Optio, laudantium?
49
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Neque ab delectus exercitationem modi, id distinctio! Nam libero itaque ipsam minima, animi illum nostrum dicta quisquam reprehenderit dolore eligendi neque soluta?
50
+ </div>
51
+ </div>
52
+ <aside className="pl-w-[800px]">
53
+ fweafwfwaef
54
+ </aside>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
@@ -0,0 +1,155 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import { shallowEqual } from "react-redux";
3
+ import { useDoubleTap } from "use-double-tap";
4
+ import { useAppDispatch, useAppSelector } from "../../../helpers/redux/hooks";
5
+ import { IBackwardForwardProps } from "../../../helpers/interfaces/interfaces";
6
+ import { setActiveElements } from "../../../helpers/redux/slices/controllerSlice";
7
+ import { videoTag } from "../../../helpers/constants";
8
+ import { handleBackwardForward } from "../../../helpers/redux/actions/controller.actions";
9
+ import { ConditionName } from "../../../helpers/interfaces/enums";
10
+ import { conditions } from "../../../helpers/conditions/conditions";
11
+ import { handleRippleCircle } from "../../../helpers/helpers";
12
+ import IMAGES from "../../../images/importImages";
13
+ import Image from "next/legacy/image";
14
+
15
+ const hideTime = 1000;
16
+
17
+ const BackwardForward = ({
18
+ type,
19
+ isRightDoubleTouched,
20
+ isLeftDoubleTouched,
21
+ setIsRightDoubleTouched,
22
+ setIsLeftDoubleTouched
23
+ }: IBackwardForwardProps) => {
24
+ const [backwardForwardCount, setBackwardForwardCount] = useState<number>(15);
25
+ const [hide, setHide] = useState<boolean>(false);
26
+ const backwardForwardCountRef = useRef<number>(backwardForwardCount);
27
+
28
+ const dispatch = useAppDispatch();
29
+ const { duration } = useAppSelector(({ controller: { currentTime, duration, showMiniPlayer } }) => ({ currentTime, duration, showMiniPlayer }), shallowEqual);
30
+ const { videoElementSizeInfo } = useAppSelector(
31
+ ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),
32
+ shallowEqual
33
+ );
34
+
35
+ const timeoutRef = useRef<any>(null);
36
+
37
+ useEffect(() => {
38
+ backwardForwardCountRef.current = backwardForwardCount;
39
+ }, [backwardForwardCount]);
40
+
41
+ let doubleTouch: any = undefined;
42
+
43
+ doubleTouch = useDoubleTap((event) => {
44
+ if (["touchBackward", "touchForward"].includes(type)) {
45
+ event.stopPropagation();
46
+ if (type === "touchBackward" && setIsLeftDoubleTouched) setIsLeftDoubleTouched(true);
47
+ else if (type === "touchForward" && setIsRightDoubleTouched) setIsRightDoubleTouched(true);
48
+ clearTimeout(timeoutRef.current);
49
+ timeoutRef.current = setTimeout(() => setHide(true), hideTime);
50
+ }
51
+ }, 200);
52
+
53
+ useEffect(() => {
54
+ if (hide) {
55
+ setHide(false);
56
+ dispatch(setActiveElements(false));
57
+ if (isRightDoubleTouched && setIsRightDoubleTouched) {
58
+ setIsRightDoubleTouched(false);
59
+ if (videoTag().duration - videoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, videoTag().duration);
60
+ else handleBackwardForward(type, backwardForwardCountRef.current);
61
+ setBackwardForwardCount(15);
62
+ } else if (isLeftDoubleTouched && setIsLeftDoubleTouched) {
63
+ setIsLeftDoubleTouched(false);
64
+ if (videoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, 0);
65
+ else handleBackwardForward(type, backwardForwardCountRef.current);
66
+ setBackwardForwardCount(15);
67
+ }
68
+ }
69
+ }, [hide]);
70
+
71
+ const handleTouchStart = (event: any) => {
72
+ setBackwardForwardCount((prev) => prev + 15);
73
+ if (conditions(ConditionName.isTouchScreenLandscape)) handleRippleCircle(event, type);
74
+ clearTimeout(timeoutRef.current);
75
+ timeoutRef.current = setTimeout(() => setHide(true), hideTime);
76
+ };
77
+
78
+ let component;
79
+
80
+ if (["backward", "forward"].includes(type)) {
81
+ component = (
82
+ <div
83
+ className={`${
84
+ !conditions(ConditionName.isTouchScreen) && "hover:pl-scale-125"
85
+ } pl-transition-transform pl-ease-in-out pl-cursor-pointer ${
86
+ type === "backward" && (videoTag().currentTime >= 15 ? "pl-opacity-100" : "pl-opacity-30 pl-cursor-default hover:pl-scale-100")
87
+ } ${
88
+ type === "forward" &&
89
+ (duration - videoTag().currentTime >= 15 ? "pl-opacity-100" : "pl-opacity-30 pl-cursor-default hover:pl-scale-100")
90
+ }}`}
91
+ onContextMenu={(event) => event.preventDefault()}
92
+ >
93
+ <Image
94
+ alt={type === "backward" ? "backward-icon" : "forward-icon"}
95
+ src={type === "backward" ? IMAGES.backward15 : IMAGES.forward15}
96
+ width={24}
97
+ height={24}
98
+ onClick={() => handleBackwardForward(type, backwardForwardCount)}
99
+ onDoubleClick={(event: any) => event.stopPropagation()}
100
+ />
101
+ </div>
102
+ );
103
+ } else if (["touchBackward", "touchForward"].includes(type)) {
104
+ component = (
105
+ <div
106
+ id={type}
107
+ className={`pl-relative pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-overflow-hidden ${
108
+ type === "touchBackward" ? "pl-rounded-r-full" : "pl-rounded-l-full"
109
+ }`}
110
+ style={{ width: videoElementSizeInfo.width, height: videoElementSizeInfo.width }}
111
+ {...doubleTouch}
112
+ >
113
+ {(isRightDoubleTouched || isLeftDoubleTouched) && (
114
+ <div
115
+ className={`pl-w-full pl-h-full pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-p-5 pl-bg-secondary-100/[0.3]`}
116
+ onTouchStart={handleTouchStart}
117
+ >
118
+ <div
119
+ className={`${
120
+ type === "touchBackward" ? "pl-arrow-left" : "pl-arrow-right pl-gap-2"
121
+ } pl-flex pl-justify-center pl-items-center`}
122
+ >
123
+ <Image
124
+ alt="arrow-left-icon"
125
+ src={IMAGES.arrowLeft}
126
+ className={`${type === "touchForward" && "pl-rotate-180"}`}
127
+ width={24}
128
+ height={24}
129
+ />
130
+ <Image
131
+ alt="arrow-left-icon"
132
+ src={IMAGES.arrowLeft}
133
+ className={`${type === "touchForward" && "pl-rotate-180"}`}
134
+ width={24}
135
+ height={24}
136
+ />
137
+ <Image
138
+ alt="arrow-left-icon"
139
+ src={IMAGES.arrowLeft}
140
+ className={`${type === "touchForward" && "pl-rotate-180"}`}
141
+ width={24}
142
+ height={24}
143
+ />
144
+ </div>
145
+ <p className="pl-text-center pl-text-[14px] pl-font-normal pl-text-white">{backwardForwardCount} ثانیه</p>
146
+ </div>
147
+ )}
148
+ </div>
149
+ );
150
+ }
151
+
152
+ return <>{component}</>;
153
+ };
154
+
155
+ export default BackwardForward;
@@ -0,0 +1,30 @@
1
+ import { shallowEqual } from "react-redux";
2
+ import { useAppSelector } from "../../../helpers/redux/hooks";
3
+ import { secondsToHMS } from "../../../helpers/helpers";
4
+ import { ConditionName } from "../../../helpers/interfaces/enums";
5
+ import { conditions } from "../../../helpers/conditions/conditions";
6
+
7
+ const ElapsedTime = () => {
8
+ const { duration, currentTime } = useAppSelector(
9
+ ({ controller: { duration, currentTime } }) => ({ duration, currentTime }),
10
+ shallowEqual
11
+ );
12
+ useAppSelector(
13
+ ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),
14
+ shallowEqual
15
+ );
16
+
17
+ return (
18
+ <>
19
+ <div
20
+ className={`pl-mr-auto !pl-text-white pl-w-full pl-max-w-max pl-text-[12px] pl-font-bold ${conditions(ConditionName.isFullScreen) ? "pl-ml-8" : "pl-ml-4"} ${conditions(ConditionName.isTouchScreenPortrait) && "!pl-ml-0"}`}
21
+ >
22
+ <span>{secondsToHMS(duration)}</span>
23
+ <span> / </span>
24
+ <span>{secondsToHMS(currentTime)}</span>
25
+ </div>
26
+ </>
27
+ );
28
+ };
29
+
30
+ export default ElapsedTime;
@@ -0,0 +1,53 @@
1
+ import { memo } from "react";
2
+ import { shallowEqual } from "react-redux";
3
+ import FullScreen from "../../fullScreen/fullScreen";
4
+ import PictureInPicture from "../../pictureInPicture/pictureInPicture";
5
+ import SoundVolume from "../../soundVolume/soundVolume";
6
+ import Settings from "../../settings/settings";
7
+ import { useAppSelector } from "../../../../helpers/redux/hooks";
8
+ import { ConditionName } from "../../../../helpers/interfaces/enums";
9
+ import { conditions } from "../../../../helpers/conditions/conditions";
10
+ import Speed from "../../speed/speed";
11
+ import QualityLevels from "../../qualityLevels/qualityLevels";
12
+ import ElapsedTime from "../../elapsedTime/elapsedTime";
13
+ import Unlock from "../../lockUnlock/unlock";
14
+ import SubtitleIcon from "../../subtitles/subtitleIcon";
15
+
16
+ const Controlbar = () => {
17
+ useAppSelector(({ controller: { isFullScreen, showMiniPlayer } }) => ({ isFullScreen, showMiniPlayer }), shallowEqual);
18
+ useAppSelector(
19
+ ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),
20
+ shallowEqual
21
+ );
22
+
23
+ let styles = "";
24
+ if (conditions(ConditionName.isTouchScreen)) {
25
+ if (conditions(ConditionName.isFullScreen)) styles = "pl-mx-6"
26
+ else styles = "pl-mx-4"
27
+ } else {
28
+ if (conditions(ConditionName.isFullScreen)) styles = "pl-mx-8"
29
+ else styles = "pl-mx-4"
30
+ }
31
+
32
+ return (
33
+ <div id="player-controllbar" className={`pl-flex pl-justify-between pl-items-center ${styles}`}>
34
+ <div
35
+ className={`pl-flex pl-items-center pl-gap-5`}
36
+ >
37
+ {!conditions(ConditionName.showMiniPlayer) && <FullScreen />}
38
+ {conditions(ConditionName.isTouchScreenLandscape) && <Unlock />}
39
+ {conditions(ConditionName.showPictureInPicture) && <PictureInPicture />}
40
+ {conditions(ConditionName.showSettingIcon) && <Settings />}
41
+ {conditions(ConditionName.isFullScreen) && !conditions(ConditionName.isStaticFormat) && <QualityLevels showQualityLevelsIcon={true} />}
42
+ {(conditions(ConditionName.isFullScreen) || conditions(ConditionName.isStaticFormat)) && <Speed showSpeedIcon={true} />}
43
+ {conditions(ConditionName.hasSubtitles) && !conditions(ConditionName.isTouchScreenPortrait) && <SubtitleIcon />}
44
+ </div>
45
+ <div className={`pl-flex pl-items-center pl-gap-5`}>
46
+ {conditions(ConditionName.isTouchScreenPortrait) && <ElapsedTime />}
47
+ {!conditions(ConditionName.isIOS) && <SoundVolume />}
48
+ </div>
49
+ </div>
50
+ );
51
+ };
52
+
53
+ export default memo(Controlbar);
@@ -0,0 +1,13 @@
1
+ import { conditions } from "../../../../helpers/conditions/conditions";
2
+ import { ConditionName } from "../../../../helpers/interfaces/enums";
3
+ import { IControllbarTooltipProps } from "../../../../helpers/interfaces/interfaces";
4
+
5
+ const ControllbarTooltip = ({ title, className }: IControllbarTooltipProps) => (
6
+ <span
7
+ className={`pl-absolute pl-w-max pl-bg-paper pl-text-white/[0.9] ${conditions(ConditionName.isFullScreen) ? "pl-bottom-[300%]" : "pl-bottom-[270%]"} pl-rounded-[8px] pl-px-4 pl-py-3 pl-text-[14px] pl-font-bold ${className}`}
8
+ >
9
+ {title}
10
+ </span>
11
+ );
12
+
13
+ export default ControllbarTooltip;
@@ -0,0 +1,47 @@
1
+ import { shallowEqual } from "react-redux";
2
+ import ProgressBar from "./progressbar/progressbar";
3
+ import Controllbar from "./controllbar/controllbar";
4
+ import ElapsedTime from "../elapsedTime/elapsedTime";
5
+ import { useAppSelector } from "../../../helpers/redux/hooks";
6
+ import { conditions } from "../../../helpers/conditions/conditions";
7
+ import { ConditionName, zIndex } from "../../../helpers/interfaces/enums";
8
+ import DisplaySubtitle from "../subtitles/displaySubtitle";
9
+
10
+ const Footer = () => {
11
+
12
+ useAppSelector(({ controller: { lock, isFullScreen, isLoading, activeElements, showMiniPlayer } }) => ({ lock, isFullScreen, isLoading, activeElements, showMiniPlayer }), shallowEqual);
13
+ useAppSelector(({ videoData: { subtitles, selectedSubtitle } }) => ({ subtitles, selectedSubtitle }), shallowEqual);
14
+
15
+ let styles = "";
16
+ if(conditions(ConditionName.isTouchScreen)) {
17
+ if(conditions(ConditionName.isFullScreen)) styles = "pl-gap-6 pl-mb-6"
18
+ else styles = "pl-gap-6 pl-mb-0"
19
+ } else {
20
+ if (conditions(ConditionName.isFullScreen)) styles = "pl-gap-6 pl-mb-8"
21
+ else styles = "pl-gap-4 pl-mb-3"
22
+ }
23
+
24
+ return (
25
+ <div id="footer" className="pl-relative" style={{ zIndex: zIndex.footer }}>
26
+ <>
27
+ {conditions(ConditionName.showSubtitle) && <DisplaySubtitle />}
28
+ {!conditions(ConditionName.isLock) && (
29
+ <>
30
+ <div
31
+ className={`pl-flex pl-flex-col pl-w-full pl-mx-auto animate__animated animate__faster ${styles} ${conditions(ConditionName.isActiveElements) && !conditions(ConditionName.isLoading)
32
+ ? "animate__fadeIn pl-pointer-events-auto"
33
+ : "animate__fadeOut pl-pointer-events-none"
34
+ }`}
35
+ >
36
+ {!conditions(ConditionName.isTouchScreenPortrait) && <ElapsedTime />}
37
+ {conditions(ConditionName.showProgressbar) && <ProgressBar />}
38
+ <Controllbar />
39
+ </div>
40
+ </>
41
+ )}
42
+ </>
43
+ </div>
44
+ );
45
+ };
46
+
47
+ export default Footer;
@@ -0,0 +1,76 @@
1
+ import { useEffect, useState } from "react";
2
+ import { shallowEqual } from "react-redux";
3
+ import Tooltip from "../../tooltip/tooltip";
4
+ import { handleCatchUpLoadingLog, handleMouseMove, handleMouseOut, handlePointerDown, handlePointerMove, handlePointerUp, hideProgressTooltip } from "../../../../helpers/redux/actions/progressbar.actions";
5
+ import { useAppSelector } from "../../../../helpers/redux/hooks";
6
+ import { progressBarWidth } from "../../../../helpers/constants";
7
+ import { ConditionName } from "../../../../helpers/interfaces/enums";
8
+ import { conditions } from "../../../../helpers/conditions/conditions";
9
+
10
+ const ProgressBar = () => {
11
+ const [isPointerDown, setIsPointerDown] = useState<boolean>(false);
12
+
13
+ useEffect(() => {
14
+ hideProgressTooltip(document.querySelector(".progressTooltip"));
15
+ }, []);
16
+
17
+ const { duration, currentTime, bufferedTimeWidth } = useAppSelector(
18
+ ({ controller: { duration, currentTime, bufferedTimeWidth, showMiniPlayer } }) => ({
19
+ duration,
20
+ currentTime,
21
+ bufferedTimeWidth,
22
+ showMiniPlayer
23
+ }),
24
+ shallowEqual
25
+ );
26
+ useAppSelector(
27
+ ({ videoData: { params, videoElementSizeInfo } }) => ({
28
+ params,
29
+ videoElementSizeInfo,
30
+ }),
31
+ shallowEqual
32
+ );
33
+ const [timeoutIds, setTimeoutIds] = useState<any[]>([]);
34
+
35
+ return (
36
+ <div className={`${conditions(ConditionName.isTouchScreenPortrait) ? "pl-order-1" : "pl-order-none"} pl-relative`}>
37
+ <div className="pl-relative">
38
+ <Tooltip />
39
+ </div>
40
+ <div
41
+ className={`pl-w-full pl-flex pl-items-end`}
42
+ onPointerDown={(event: any) => handlePointerDown(event, timeoutIds, setIsPointerDown)}
43
+ onPointerMove={handlePointerMove}
44
+ onPointerUp={(event: any) => handlePointerUp(event, setTimeoutIds, timeoutIds, setIsPointerDown)}
45
+ onMouseMove={handleMouseMove}
46
+ onMouseOut={handleMouseOut}
47
+ onClick={handleCatchUpLoadingLog}
48
+ onDoubleClick={(event: any) => event.stopPropagation()}
49
+ >
50
+ <div id="progress-area" className="pl-w-full pl-absolute">
51
+ <div className="pl-w-full pl-h-[40px]"/>
52
+ <div
53
+ id="time-progress-area"
54
+ className={`!pl-w-full !pl-h-[5px] pl-transition-transform pl-duration-300 pl-m-auto pl-cursor-pointer !pl-bg-gray-highLight pl-rounded`}
55
+ style={{ transform: isPointerDown ? "scaleY(1.8)" : "unset" }}
56
+ >
57
+ <div
58
+ id="time-progress-buffer"
59
+ className={`pl-absolute pl-h-[5px] pl-bg-z-gray-400/[0.7] pl-rounded`}
60
+ style={{ width: `${bufferedTimeWidth}%` }}
61
+ />
62
+ <div
63
+ id="time-progress-bar"
64
+ className={`pl-h-[5px] pl-rounded pl-relative pl-cursor-pointer pl-bg-primary before:pl-bg-primary before:pl-inline-block before:pl-w-4 before:pl-h-4 ${
65
+ isPointerDown && "before:pl-w-7 before:pl-h-3"
66
+ }`}
67
+ style={{ width: `${(currentTime / duration) * progressBarWidth()}px` }}
68
+ />
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ );
74
+ };
75
+
76
+ export default ProgressBar;
@@ -0,0 +1,47 @@
1
+ import { useEffect, useState } from "react";
2
+ import { shallowEqual } from "react-redux";
3
+ import ControllbarTooltip from "../footer/controllbar/controllbarTooltip";
4
+ import { useAppDispatch, useAppSelector } from "../../../helpers/redux/hooks";
5
+ import { ConditionName } from "../../../helpers/interfaces/enums";
6
+ import { conditions } from "../../../helpers/conditions/conditions";
7
+ import { setActiveElements } from "../../../helpers/redux/slices/controllerSlice";
8
+ import { handleFullScreen, handleLockOrientation } from "../../../helpers/redux/actions/controller.actions";
9
+ import Image from "next/legacy/image";
10
+ import IMAGES from "../../../images/importImages";
11
+
12
+ const FullScreen = () => {
13
+ const { isFullScreen } = useAppSelector(({ controller: { firstPlay, isFullScreen } }) => ({ firstPlay, isFullScreen }), shallowEqual);
14
+
15
+ const [showTooltip, setShowTooltip] = useState<boolean>(false);
16
+
17
+ const dispatch = useAppDispatch();
18
+
19
+ useEffect(() => {
20
+ if (!conditions(ConditionName.isFirstPlay)) dispatch(setActiveElements(false));
21
+ }, [isFullScreen]);
22
+
23
+ return (
24
+ <div className="pl-relative pl-flex pl-items-center">
25
+ <Image
26
+ src={conditions(ConditionName.isFullScreen) ? IMAGES.nonFullScreen : IMAGES.fullScreen}
27
+ alt="fullScreen-icon"
28
+ className={`pl-cursor-pointer`}
29
+ width={20}
30
+ height={20}
31
+ onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}
32
+ onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}
33
+ onClick={() => {
34
+ handleFullScreen();
35
+ handleLockOrientation();
36
+ }}
37
+ />
38
+ {showTooltip && (
39
+ <ControllbarTooltip
40
+ title={`${conditions(ConditionName.isFullScreen) ? "خروج از" : ""} تمام صفحه`}
41
+ />
42
+ )}
43
+ </div>
44
+ );
45
+ };
46
+
47
+ export default FullScreen;
@@ -0,0 +1,19 @@
1
+ import { shallowEqual } from "react-redux";
2
+ import Title from "../title/title";
3
+ import { useAppSelector } from "../../../helpers/redux/hooks";
4
+ import { conditions } from "../../../helpers/conditions/conditions";
5
+ import { ConditionName } from "../../../helpers/interfaces/enums";
6
+ import Lock from "../lockUnlock/lock";
7
+
8
+ const Header = () => {
9
+ useAppSelector(({ controller: { lock, activeElements } }) => ({ lock, activeElements }), shallowEqual);
10
+
11
+ return (
12
+ <div className={`pl-flex pl-items-start pl-justify-end pl-mx-4 pl-mt-5 ${conditions(ConditionName.isTouchScreenPortrait) ? "pl-h-[16px]" : "pl-h-[60px]"}`}>
13
+ {conditions(ConditionName.showTitle) && <Title />}
14
+ {conditions(ConditionName.isLock) && <Lock />}
15
+ </div>
16
+ );
17
+ };
18
+
19
+ export default Header;
@@ -0,0 +1,20 @@
1
+ const Loader = () => {
2
+ return (
3
+ <div className={`loader-spinner pl-absolute pl-top-[50%] pl-left-[50%] pl-mt-[-50px] pl-ml-[-42px] pl-w-screen pl-h-full pl-overflow-hidden`}>
4
+ <div className="pl-bg-white"></div>
5
+ <div className="pl-bg-white"></div>
6
+ <div className="pl-bg-white"></div>
7
+ <div className="pl-bg-white"></div>
8
+ <div className="pl-bg-white"></div>
9
+ <div className="pl-bg-white"></div>
10
+ <div className="pl-bg-white"></div>
11
+ <div className="pl-bg-white"></div>
12
+ <div className="pl-bg-white"></div>
13
+ <div className="pl-bg-white"></div>
14
+ <div className="pl-bg-white"></div>
15
+ <div className="pl-bg-white"></div>
16
+ </div>
17
+ );
18
+ };
19
+
20
+ export default Loader;
@@ -0,0 +1,23 @@
1
+ import Image from "next/legacy/image";
2
+ import IMAGES from "../../../images/importImages";
3
+ import { handleLock } from "../../../helpers/redux/actions/controller.actions";
4
+ import { conditions } from "../../../helpers/conditions/conditions";
5
+ import { ConditionName } from "../../../helpers/interfaces/enums";
6
+
7
+ const Lock = () => {
8
+
9
+ return (
10
+ <div className={`pl-relative pl-z-[1000000] animate__animated animate__faster ${conditions(ConditionName.isActiveElements) ? "animate__fadeIn pl-pointer-events-auto" : "animate__fadeOut pl-pointer-events-none"}`}>
11
+ <Image
12
+ src={IMAGES.lock}
13
+ alt="lock-icon"
14
+ width={20}
15
+ height={20}
16
+ onClick={() => handleLock("unlock")}
17
+ />
18
+ {!localStorage.getItem("unlock-click") && <p className="pl-text-[10px] pl-text-black/[0.87] pl-bg-[#F7F7F7] pl-absolute pl-left-0 pl-px-4 pl-py-3 pl-rounded-[8px] pl-w-max">برای باز کردن قفل، کلیک کنید</p>}
19
+ </div>
20
+ );
21
+ };
22
+
23
+ export default Lock;