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.
- package/.eslintrc.json +3 -0
- package/next.config.mjs +12 -0
- package/package.json +1 -1
- package/postcss.config.mjs +8 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +6 -0
- package/src/app/layout.tsx +24 -0
- package/src/app/page.tsx +58 -0
- package/src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx +155 -0
- package/src/videoPlayerLibrary/components/custom-components/elapsedTime/elapsedTime.tsx +30 -0
- package/src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbar.tsx +53 -0
- package/src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbarTooltip.tsx +13 -0
- package/src/videoPlayerLibrary/components/custom-components/footer/footer.tsx +47 -0
- package/src/videoPlayerLibrary/components/custom-components/footer/progressbar/progressbar.tsx +76 -0
- package/src/videoPlayerLibrary/components/custom-components/fullScreen/fullScreen.tsx +47 -0
- package/src/videoPlayerLibrary/components/custom-components/header/header.tsx +19 -0
- package/src/videoPlayerLibrary/components/custom-components/loader/loader.tsx +20 -0
- package/src/videoPlayerLibrary/components/custom-components/lockUnlock/lock.tsx +23 -0
- package/src/videoPlayerLibrary/components/custom-components/lockUnlock/unlock.tsx +18 -0
- package/src/videoPlayerLibrary/components/custom-components/main/main.tsx +64 -0
- package/src/videoPlayerLibrary/components/custom-components/notActive/notActive.tsx +23 -0
- package/src/videoPlayerLibrary/components/custom-components/pictureInPicture/pictureInPicture.tsx +34 -0
- package/src/videoPlayerLibrary/components/custom-components/playPause/playPause.tsx +31 -0
- package/src/videoPlayerLibrary/components/custom-components/popover/popover.tsx +151 -0
- package/src/videoPlayerLibrary/components/custom-components/qualityLevels/qualityLevels.tsx +135 -0
- package/src/videoPlayerLibrary/components/custom-components/settings/settings.tsx +122 -0
- package/src/videoPlayerLibrary/components/custom-components/soundVolume/soundVolume.tsx +83 -0
- package/src/videoPlayerLibrary/components/custom-components/speed/speed.tsx +120 -0
- package/src/videoPlayerLibrary/components/custom-components/subtitles/displaySubtitle.tsx +43 -0
- package/src/videoPlayerLibrary/components/custom-components/subtitles/subtitleIcon.tsx +34 -0
- package/src/videoPlayerLibrary/components/custom-components/title/title.tsx +20 -0
- package/src/videoPlayerLibrary/components/custom-components/toggle/toggle.tsx +14 -0
- package/src/videoPlayerLibrary/components/custom-components/tooltip/tooltip.tsx +43 -0
- package/src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx +176 -0
- package/src/videoPlayerLibrary/components/custom-components/videoArea/videoArea.tsx +138 -0
- package/src/videoPlayerLibrary/components/custom-components/videoAreaShadow.tsx/videoAreaShadow.tsx +19 -0
- package/src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx +181 -0
- package/src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx +57 -0
- package/src/videoPlayerLibrary/components/custom-components/videoTag/videoTag.tsx +12 -0
- package/src/videoPlayerLibrary/components/icon-components/mute.tsx +14 -0
- package/src/videoPlayerLibrary/components/icon-components/unMute.tsx +11 -0
- package/src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx +17 -0
- package/src/videoPlayerLibrary/components/videoPlayer/videoPlayer.tsx +50 -0
- package/src/videoPlayerLibrary/components/videoPlayer/vodPlayer/vodPlayer.tsx +41 -0
- package/src/videoPlayerLibrary/helpers/conditions/conditions.ts +163 -0
- package/src/videoPlayerLibrary/helpers/configs/nextConfigs/next.config.js +4 -0
- package/src/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage.ts +1 -0
- package/src/videoPlayerLibrary/helpers/configs/npmPackage/npmPackage_lib.ts +1 -0
- package/src/videoPlayerLibrary/helpers/constants.ts +5 -0
- package/src/videoPlayerLibrary/helpers/environment.ts +11 -0
- package/src/videoPlayerLibrary/helpers/getDetailsConfigs.ts +46 -0
- package/src/videoPlayerLibrary/helpers/helpers.ts +212 -0
- package/src/videoPlayerLibrary/helpers/hooks/useActiveInActive.tsx +97 -0
- package/src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx +15 -0
- package/src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx +24 -0
- package/src/videoPlayerLibrary/helpers/hooks/useFullScreen.tsx +41 -0
- package/src/videoPlayerLibrary/helpers/hooks/useGetData/useGetData.tsx +7 -0
- package/src/videoPlayerLibrary/helpers/hooks/useGetData/useGetDetails.tsx +20 -0
- package/src/videoPlayerLibrary/helpers/hooks/useHandleKeyPress.tsx +36 -0
- package/src/videoPlayerLibrary/helpers/hooks/useHandleParams.tsx +66 -0
- package/src/videoPlayerLibrary/helpers/hooks/useHandleResize.tsx +45 -0
- package/src/videoPlayerLibrary/helpers/hooks/useHandleScroll.tsx +34 -0
- package/src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx +33 -0
- package/src/videoPlayerLibrary/helpers/hooks/useKeyPress.tsx +20 -0
- package/src/videoPlayerLibrary/helpers/hooks/useLongPress.tsx +26 -0
- package/src/videoPlayerLibrary/helpers/hooks/useOnClickOutside.tsx +19 -0
- package/src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx +59 -0
- package/src/videoPlayerLibrary/helpers/hooks/useSetSubtitleFirstPlay.tsx +18 -0
- package/src/videoPlayerLibrary/helpers/interfaces/enums.ts +85 -0
- package/src/videoPlayerLibrary/helpers/interfaces/interfaces.ts +217 -0
- package/src/videoPlayerLibrary/helpers/logs/fluentdLogger.ts +21 -0
- package/src/videoPlayerLibrary/helpers/logs/logs.ts +228 -0
- package/src/videoPlayerLibrary/helpers/redux/actions/controller.actions.ts +128 -0
- package/src/videoPlayerLibrary/helpers/redux/actions/playerCore.actions.ts +419 -0
- package/src/videoPlayerLibrary/helpers/redux/actions/progressbar.actions.ts +328 -0
- package/src/videoPlayerLibrary/helpers/redux/actions/user.actions.ts +45 -0
- package/src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts +67 -0
- package/src/videoPlayerLibrary/helpers/redux/hooks.ts +5 -0
- package/src/videoPlayerLibrary/helpers/redux/slices/controllerSlice.ts +115 -0
- package/src/videoPlayerLibrary/helpers/redux/slices/popoversSlice.ts +37 -0
- package/src/videoPlayerLibrary/helpers/redux/slices/userSlice.ts +38 -0
- package/src/videoPlayerLibrary/helpers/redux/slices/videoDataSlice.ts +111 -0
- package/src/videoPlayerLibrary/helpers/redux/store.ts +21 -0
- package/src/videoPlayerLibrary/helpers/services/apiCaller.ts +111 -0
- package/src/videoPlayerLibrary/helpers/services/baseUrl.ts +5 -0
- package/src/videoPlayerLibrary/helpers/services/services.ts +15 -0
- package/src/videoPlayerLibrary/images/importImages.ts +29 -0
- package/src/videoPlayerLibrary/images/svg/ArrowLeft.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/Backward15.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/BigPause.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/BigPlay.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/ChevronLeft.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/CloseSquare.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/Forward15.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/FullScreen.svg +6 -0
- package/src/videoPlayerLibrary/images/svg/Lock.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/Mute.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/NonFullScreen.svg +6 -0
- package/src/videoPlayerLibrary/images/svg/NotFound.svg +34 -0
- package/src/videoPlayerLibrary/images/svg/PictureInPicture.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/QualitySetting.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/QualitySetting1.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/Settings.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/Speed.svg +7 -0
- package/src/videoPlayerLibrary/images/svg/Speed1.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/SubtitleFill.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/SubtitleOutline.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/SubtitleOutlineGray.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/Sun.svg +4 -0
- package/src/videoPlayerLibrary/images/svg/Tick.svg +3 -0
- package/src/videoPlayerLibrary/images/svg/UnMute.svg +5 -0
- package/src/videoPlayerLibrary/images/svg/Unlock.svg +5 -0
- package/src/videoPlayerLibrary/index.ts +1 -0
- package/src/videoPlayerLibrary/styles/custom-styles/index.css +4 -0
- package/src/videoPlayerLibrary/styles/custom-styles/loader.css +78 -0
- package/src/videoPlayerLibrary/styles/custom-styles/progressBar.css +14 -0
- package/src/videoPlayerLibrary/styles/custom-styles/scrollbar.css +32 -0
- package/src/videoPlayerLibrary/styles/custom-styles/soundVolume.css +57 -0
- package/src/videoPlayerLibrary/styles/fonts.css +20 -0
- package/src/videoPlayerLibrary/styles/styles.css +106 -0
- package/src/videoPlayerLibrary/videoPlayerLibrary.tsx +16 -0
- package/tailwind.config.ts +55 -0
- package/tsconfig.json +23 -0
- package/tsconfig.library.json +23 -0
- package/tsup.config.ts +18 -0
- package/backwardForward-OQJYFAQ4.mjs +0 -7
- package/backwardForward-OQJYFAQ4.mjs.map +0 -1
- package/backwardForward-P3P4S2ZE.js +0 -13
- package/backwardForward-P3P4S2ZE.js.map +0 -1
- package/chunk-6NSC465P.js +0 -37
- package/chunk-6NSC465P.js.map +0 -1
- package/chunk-7LB4RAGD.js +0 -11
- package/chunk-7LB4RAGD.js.map +0 -1
- package/chunk-BJ4CIJKZ.js +0 -90
- package/chunk-BJ4CIJKZ.js.map +0 -1
- package/chunk-CWMVHGXS.mjs +0 -9
- package/chunk-CWMVHGXS.mjs.map +0 -1
- package/chunk-CY73TBOJ.mjs +0 -8
- package/chunk-CY73TBOJ.mjs.map +0 -1
- package/chunk-DBPGS72Q.mjs +0 -5
- package/chunk-DBPGS72Q.mjs.map +0 -1
- package/chunk-K2JG5NRS.js +0 -21
- package/chunk-K2JG5NRS.js.map +0 -1
- package/chunk-KCRYSZI6.mjs +0 -9
- package/chunk-KCRYSZI6.mjs.map +0 -1
- package/chunk-LJQ3BDPD.js +0 -16
- package/chunk-LJQ3BDPD.js.map +0 -1
- package/chunk-PEF62RSW.mjs +0 -8
- package/chunk-PEF62RSW.mjs.map +0 -1
- package/chunk-PPTHLXJQ.mjs +0 -7
- package/chunk-PPTHLXJQ.mjs.map +0 -1
- package/chunk-SPUHJYDE.js +0 -11
- package/chunk-SPUHJYDE.js.map +0 -1
- package/chunk-U23ZPGF2.js +0 -9
- package/chunk-U23ZPGF2.js.map +0 -1
- package/chunk-U6HUFFUL.js +0 -18
- package/chunk-U6HUFFUL.js.map +0 -1
- package/chunk-UIPWLWLK.js +0 -32
- package/chunk-UIPWLWLK.js.map +0 -1
- package/chunk-V2LZHMTD.mjs +0 -25
- package/chunk-V2LZHMTD.mjs.map +0 -1
- package/chunk-YB4NYTRZ.mjs +0 -7
- package/chunk-YB4NYTRZ.mjs.map +0 -1
- package/chunk-YRJREWER.mjs +0 -15
- package/chunk-YRJREWER.mjs.map +0 -1
- package/chunk-YZ2YUV52.mjs +0 -10
- package/chunk-YZ2YUV52.mjs.map +0 -1
- package/chunk-Z6CUWQ7X.js +0 -11
- package/chunk-Z6CUWQ7X.js.map +0 -1
- package/index.d.mts +0 -26
- package/index.d.ts +0 -26
- package/index.js +0 -20
- package/index.js.map +0 -1
- package/index.mjs +0 -14
- package/index.mjs.map +0 -1
- package/nonStaticVideoTag-X2LHNAWU.js +0 -24
- package/nonStaticVideoTag-X2LHNAWU.js.map +0 -1
- package/nonStaticVideoTag-X6VPLYIO.mjs +0 -17
- package/nonStaticVideoTag-X6VPLYIO.mjs.map +0 -1
- package/notActive-2FUSVSVU.mjs +0 -10
- package/notActive-2FUSVSVU.mjs.map +0 -1
- package/notActive-E4FZWQIO.js +0 -16
- package/notActive-E4FZWQIO.js.map +0 -1
- package/staticPlayer-N22SKV2E.mjs +0 -15
- package/staticPlayer-N22SKV2E.mjs.map +0 -1
- package/staticPlayer-NVMVGIGQ.js +0 -17
- package/staticPlayer-NVMVGIGQ.js.map +0 -1
- package/staticVideoTag-5ACODYQR.mjs +0 -13
- package/staticVideoTag-5ACODYQR.mjs.map +0 -1
- package/staticVideoTag-6JYTTN5M.js +0 -15
- package/staticVideoTag-6JYTTN5M.js.map +0 -1
- package/touchVolumeBrightness-S4HPNA43.js +0 -19
- package/touchVolumeBrightness-S4HPNA43.js.map +0 -1
- package/touchVolumeBrightness-S7DYCEN7.mjs +0 -13
- package/touchVolumeBrightness-S7DYCEN7.mjs.map +0 -1
- package/videoArea-LJCSMRSQ.mjs +0 -10
- package/videoArea-LJCSMRSQ.mjs.map +0 -1
- package/videoArea-V4TOL4SD.js +0 -16
- package/videoArea-V4TOL4SD.js.map +0 -1
- package/videoPlayerStyles.css +0 -4165
- package/vodPlayer-7LYIUN25.mjs +0 -14
- package/vodPlayer-7LYIUN25.mjs.map +0 -1
- package/vodPlayer-U3MOJUJ5.js +0 -20
- package/vodPlayer-U3MOJUJ5.js.map +0 -1
- /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Bold.woff2 +0 -0
- /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Medium.woff2 +0 -0
- /package/{font → src/videoPlayerLibrary/styles/font}/IRANSansXFaNum-Regular.woff2 +0 -0
package/.eslintrc.json
ADDED
package/next.config.mjs
ADDED
package/package.json
CHANGED
package/public/next.svg
ADDED
|
@@ -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,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
|
+
}
|
package/src/app/page.tsx
ADDED
|
@@ -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
|
+
}
|
package/src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx
ADDED
|
@@ -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;
|
package/src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbar.tsx
ADDED
|
@@ -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;
|
package/src/videoPlayerLibrary/components/custom-components/footer/progressbar/progressbar.tsx
ADDED
|
@@ -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;
|