cafe-video-player 2.0.21 → 2.0.23
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/backwardForward-3HROPSFK.js +2 -0
- package/{backwardForward-FW25LAUC.js.map → backwardForward-3HROPSFK.js.map} +1 -1
- package/backwardForward-4K2JDYXO.mjs +2 -0
- package/{backwardForward-6U6VETTV.mjs.map → backwardForward-4K2JDYXO.mjs.map} +1 -1
- package/chunk-2UQZ2IND.js +2 -0
- package/{chunk-4AXKM55A.js.map → chunk-2UQZ2IND.js.map} +1 -1
- package/chunk-4WSW2YML.js +2 -0
- package/{chunk-AJG5T24R.js.map → chunk-4WSW2YML.js.map} +1 -1
- package/chunk-5OIS455P.mjs +3 -0
- package/chunk-5OIS455P.mjs.map +1 -0
- package/{chunk-3ZNIRSH3.mjs → chunk-6ZKKSIBV.mjs} +2 -2
- package/{chunk-3ZNIRSH3.mjs.map → chunk-6ZKKSIBV.mjs.map} +1 -1
- package/chunk-AOOXGUAJ.js +2 -0
- package/{chunk-J7CRSGHN.js.map → chunk-AOOXGUAJ.js.map} +1 -1
- package/{chunk-P6UV7U4E.mjs → chunk-AUZAI7ZJ.mjs} +2 -2
- package/{chunk-P6UV7U4E.mjs.map → chunk-AUZAI7ZJ.mjs.map} +1 -1
- package/{chunk-7CZEUDNW.mjs → chunk-BMC7X7BK.mjs} +3 -3
- package/{chunk-7CZEUDNW.mjs.map → chunk-BMC7X7BK.mjs.map} +1 -1
- package/chunk-DQ4YH4BY.mjs +9 -0
- package/chunk-DQ4YH4BY.mjs.map +1 -0
- package/{chunk-LAFBWF7M.js → chunk-G5R3U2OG.js} +2 -2
- package/{chunk-LAFBWF7M.js.map → chunk-G5R3U2OG.js.map} +1 -1
- package/{chunk-NFS5ZBFX.mjs → chunk-IOYUXRGD.mjs} +2 -2
- package/{chunk-NFS5ZBFX.mjs.map → chunk-IOYUXRGD.mjs.map} +1 -1
- package/{chunk-R65WA2TV.mjs → chunk-Q52RFNV3.mjs} +2 -2
- package/{chunk-R65WA2TV.mjs.map → chunk-Q52RFNV3.mjs.map} +1 -1
- package/{chunk-NTINJ2J6.js → chunk-QHLPSV6I.js} +2 -2
- package/{chunk-NTINJ2J6.js.map → chunk-QHLPSV6I.js.map} +1 -1
- package/{chunk-ELG5PCR2.mjs → chunk-TUYGEJVR.mjs} +2 -2
- package/{chunk-ELG5PCR2.mjs.map → chunk-TUYGEJVR.mjs.map} +1 -1
- package/chunk-WG7PYZXW.js +3 -0
- package/chunk-WG7PYZXW.js.map +1 -0
- package/chunk-ZK5BOK4Y.js +3 -0
- package/{chunk-S3ULKQPB.js.map → chunk-ZK5BOK4Y.js.map} +1 -1
- package/chunk-ZPH2HWHV.js +9 -0
- package/chunk-ZPH2HWHV.js.map +1 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/nonStaticVideoTag-I5AI5KU3.js +2 -0
- package/{nonStaticVideoTag-6IOIANAD.js.map → nonStaticVideoTag-I5AI5KU3.js.map} +1 -1
- package/{nonStaticVideoTag-JKZGTEQK.mjs → nonStaticVideoTag-URXCYYXT.mjs} +2 -2
- package/{nonStaticVideoTag-JKZGTEQK.mjs.map → nonStaticVideoTag-URXCYYXT.mjs.map} +1 -1
- package/package.json +1 -1
- package/staticPlayer-GU5RRZIR.js +2 -0
- package/{staticPlayer-L6ZHTYIE.js.map → staticPlayer-GU5RRZIR.js.map} +1 -1
- package/staticPlayer-YU2BZCDF.mjs +2 -0
- package/{staticPlayer-4IVOGXWC.mjs.map → staticPlayer-YU2BZCDF.mjs.map} +1 -1
- package/staticVideoTag-DYKLVJRS.js +2 -0
- package/{staticVideoTag-4I2J2KRA.js.map → staticVideoTag-DYKLVJRS.js.map} +1 -1
- package/{staticVideoTag-GJF26BZ3.mjs → staticVideoTag-ZNZBQ7WW.mjs} +2 -2
- package/{staticVideoTag-GJF26BZ3.mjs.map → staticVideoTag-ZNZBQ7WW.mjs.map} +1 -1
- package/{touchVolumeBrightness-77BH7B3T.js → touchVolumeBrightness-BHL4CXCQ.js} +3 -3
- package/{touchVolumeBrightness-77BH7B3T.js.map → touchVolumeBrightness-BHL4CXCQ.js.map} +1 -1
- package/{touchVolumeBrightness-VSJS4WWO.mjs → touchVolumeBrightness-THRKUQFI.mjs} +3 -3
- package/{touchVolumeBrightness-VSJS4WWO.mjs.map → touchVolumeBrightness-THRKUQFI.mjs.map} +1 -1
- package/videoArea-JBENXGDZ.mjs +2 -0
- package/{videoArea-E7A4UFKZ.mjs.map → videoArea-JBENXGDZ.mjs.map} +1 -1
- package/videoArea-ZU4LKPTL.js +2 -0
- package/{videoArea-AXJIXBW5.js.map → videoArea-ZU4LKPTL.js.map} +1 -1
- package/videoPlayerStyles.css +6 -3
- package/vodPlayer-62FEZN5H.js +2 -0
- package/{vodPlayer-YZ7XNHKT.js.map → vodPlayer-62FEZN5H.js.map} +1 -1
- package/{vodPlayer-LEY3FMUD.mjs → vodPlayer-SQSP4JD5.mjs} +2 -2
- package/{vodPlayer-LEY3FMUD.mjs.map → vodPlayer-SQSP4JD5.mjs.map} +1 -1
- package/backwardForward-6U6VETTV.mjs +0 -2
- package/backwardForward-FW25LAUC.js +0 -2
- package/chunk-4AXKM55A.js +0 -2
- package/chunk-AJG5T24R.js +0 -2
- package/chunk-J7CRSGHN.js +0 -2
- package/chunk-KODWZOFT.js +0 -3
- package/chunk-KODWZOFT.js.map +0 -1
- package/chunk-LHO7HY26.mjs +0 -3
- package/chunk-LHO7HY26.mjs.map +0 -1
- package/chunk-S3ULKQPB.js +0 -3
- package/chunk-UTQQHPIT.mjs +0 -9
- package/chunk-UTQQHPIT.mjs.map +0 -1
- package/chunk-Y3GDFXWU.js +0 -9
- package/chunk-Y3GDFXWU.js.map +0 -1
- package/nonStaticVideoTag-6IOIANAD.js +0 -2
- package/staticPlayer-4IVOGXWC.mjs +0 -2
- package/staticPlayer-L6ZHTYIE.js +0 -2
- package/staticVideoTag-4I2J2KRA.js +0 -2
- package/videoArea-AXJIXBW5.js +0 -2
- package/videoArea-E7A4UFKZ.mjs +0 -2
- package/vodPlayer-YZ7XNHKT.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_esm_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mapp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AA,CAAAA,CAAS,EAKlB,CAEP,CACT,CAAA,CAAA,CAAA,CACJ,CAER,CAAA,CAEOE,EAAQ5D,CAAAA","file":"nonStaticVideoTag-JKZGTEQK.mjs","sourcesContent":["\"use client\";\r\n\r\nimport Hls, { ErrorData, Events } from \"hls.js\";\r\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag().pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_esm_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mappings":"6kBAAAA,CAEA,EAAA,CCFAA,CAAA,EAAA,CAQA,IAAMC,GAAgC,IAAM,CACxC,IAAIC,CAAAA,CAAgB,IAEd,CAAA,CAAE,OAAAC,CAAAA,CAAQ,CAAIC,CAAAA,EAAAA,CAAe,CAAC,CAAE,UAAY,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\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag().pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkZPH2HWHV_js=require('./chunk-ZPH2HWHV.js');require('./chunk-ZK5BOK4Y.js'),require('./chunk-G5R3U2OG.js'),require('./chunk-QHZJEU27.js'),require('./chunk-2UQZ2IND.js');var chunkWG7PYZXW_js=require('./chunk-WG7PYZXW.js');require('./chunk-DQNYU4AM.js');var chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),jsxRuntime=require('react/jsx-runtime');chunkWO4IQUGO_js.e();var l=()=>jsxRuntime.jsx("div",{className:`pl-w-full pl-aspect-video ${!chunkWG7PYZXW_js.ca("isTouchScreen")&&!chunkWG7PYZXW_js.ca("isFullScreen")&&"!pl-rounded-[12px]"}`,children:jsxRuntime.jsx(chunkZPH2HWHV_js.a,{})}),a=l;module.exports=a;//# sourceMappingURL=staticPlayer-GU5RRZIR.js.map
|
|
2
|
+
//# sourceMappingURL=staticPlayer-GU5RRZIR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_cjs_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"4WAAAA,kBAWQ,EAAA,CALFC,IAAAA,CAAAA,CAAe,IAEbC,cAAC,CAAA,KAAA,CAAA,CACD,SAAW,CAAA,CAAA,0BAAA,EAA6B,CAACC,mBAAAA,CAAAA,eAAsC,GAAK,CAACA,mBAAAA,CAAAA,cAAqC,CAAK,EAAA,oBAAoB,CAEnJ,CAAA,CAAA,QAAA,CAAAD,eAACE,kBAAA,CAAA,EAAU,CACf,CAAA,CAAA,CAIGC,CAAQJ,CAAAA","file":"staticPlayer-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_cjs_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"4WAAAA,kBAWQ,EAAA,CALFC,IAAAA,CAAAA,CAAe,IAEbC,cAAC,CAAA,KAAA,CAAA,CACD,SAAW,CAAA,CAAA,0BAAA,EAA6B,CAACC,mBAAAA,CAAAA,eAAsC,GAAK,CAACA,mBAAAA,CAAAA,cAAqC,CAAK,EAAA,oBAAoB,CAEnJ,CAAA,CAAA,QAAA,CAAAD,eAACE,kBAAA,CAAA,EAAU,CACf,CAAA,CAAA,CAIGC,CAAQJ,CAAAA","file":"staticPlayer-GU5RRZIR.js","sourcesContent":["\"use client\";\r\n\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport VideoArea from \"../../custom-components/videoArea/videoArea\";\r\n\r\nconst StaticPlayer = () => {\r\n return (\r\n <div\r\n className={`pl-w-full pl-aspect-video ${!conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"!pl-rounded-[12px]\"}`}\r\n >\r\n <VideoArea />\r\n </div>\r\n )\r\n}\r\n\r\nexport default StaticPlayer;"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-DQ4YH4BY.mjs';import'./chunk-BMC7X7BK.mjs';import'./chunk-IOYUXRGD.mjs';import'./chunk-6R7UYUPZ.mjs';import'./chunk-AUZAI7ZJ.mjs';import {ca}from'./chunk-5OIS455P.mjs';import'./chunk-6567FIPA.mjs';import {e}from'./chunk-DBPGS72Q.mjs';import {jsx}from'react/jsx-runtime';e();var l=()=>jsx("div",{className:`pl-w-full pl-aspect-video ${!ca("isTouchScreen")&&!ca("isFullScreen")&&"!pl-rounded-[12px]"}`,children:jsx(a,{})}),m=l;export{m as default};//# sourceMappingURL=staticPlayer-YU2BZCDF.mjs.map
|
|
2
|
+
//# sourceMappingURL=staticPlayer-YU2BZCDF.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_esm_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"qSAAAA,CAWQ,EAAA,CALFC,IAAAA,CAAAA,CAAe,IAEbC,GAAC,CAAA,KAAA,CAAA,CACD,SAAW,CAAA,CAAA,0BAAA,EAA6B,CAACC,EAAAA,CAAAA,eAAsC,GAAK,CAACA,EAAAA,CAAAA,cAAqC,CAAK,EAAA,oBAAoB,CAEnJ,CAAA,CAAA,QAAA,CAAAD,IAACE,CAAA,CAAA,EAAU,CACf,CAAA,CAAA,CAIGC,CAAQJ,CAAAA","file":"staticPlayer-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_esm_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"qSAAAA,CAWQ,EAAA,CALFC,IAAAA,CAAAA,CAAe,IAEbC,GAAC,CAAA,KAAA,CAAA,CACD,SAAW,CAAA,CAAA,0BAAA,EAA6B,CAACC,EAAAA,CAAAA,eAAsC,GAAK,CAACA,EAAAA,CAAAA,cAAqC,CAAK,EAAA,oBAAoB,CAEnJ,CAAA,CAAA,QAAA,CAAAD,IAACE,CAAA,CAAA,EAAU,CACf,CAAA,CAAA,CAIGC,CAAQJ,CAAAA","file":"staticPlayer-YU2BZCDF.mjs","sourcesContent":["\"use client\";\r\n\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport VideoArea from \"../../custom-components/videoArea/videoArea\";\r\n\r\nconst StaticPlayer = () => {\r\n return (\r\n <div\r\n className={`pl-w-full pl-aspect-video ${!conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"!pl-rounded-[12px]\"}`}\r\n >\r\n <VideoArea />\r\n </div>\r\n )\r\n}\r\n\r\nexport default StaticPlayer;"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkQHLPSV6I_js=require('./chunk-QHLPSV6I.js'),chunk4WSW2YML_js=require('./chunk-4WSW2YML.js');require('./chunk-2UQZ2IND.js');var chunkWG7PYZXW_js=require('./chunk-WG7PYZXW.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),react=require('react'),reactRedux=require('react-redux'),A=require('next/legacy/image'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var A__default=/*#__PURE__*/_interopDefault(A);chunkWO4IQUGO_js.e();var C=()=>{let T=chunkWG7PYZXW_js.da(),{params:a}=chunkWG7PYZXW_js.ea(({videoData:{params:e}})=>({params:e}),reactRedux.shallowEqual);chunkWG7PYZXW_js.ea(({controller:{firstPlay:e}})=>({firstPlay:e}),reactRedux.shallowEqual);let r=react.useRef(0),l=react.useRef(0),d=react.useRef(null),s=react.useRef(null);return react.useEffect(()=>{chunkWG7PYZXW_js.X(r),l.current=Date.now();},[]),react.useEffect(()=>{let e=()=>{let m=chunkWG7PYZXW_js.fa()?.getBoundingClientRect();m&&T(chunkWG7PYZXW_js.t(m));};return chunkWG7PYZXW_js.ca("isFirstPlay")&&e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearInterval(s.current);}},[a.id]),chunkQHLPSV6I_js.b(),chunkQHLPSV6I_js.a(),jsxRuntime.jsxs("video",{poster:a.banner?a.banner:void 0,preload:"metadata",autoPlay:chunkWG7PYZXW_js.ca("hasAutoPlay"),id:"player-tag",crossOrigin:"anonymous",className:"pl-w-full pl-h-full pl-items-center pl-flex-1",onCanPlay:chunk4WSW2YML_js.A,onPause:chunk4WSW2YML_js.w,onPlay:e=>chunk4WSW2YML_js.x(e,d),onPlaying:()=>chunk4WSW2YML_js.y(r,l,d),onTimeUpdate:chunk4WSW2YML_js.z,onLoadedData:e=>chunk4WSW2YML_js.B(e,s),onError:chunk4WSW2YML_js.a,playsInline:!0,children:[a.banner&&jsxRuntime.jsx(A__default.default,{layout:"fill",src:a.banner,alt:a.bannerAlt?a.bannerAlt:"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648"}),jsxRuntime.jsx("source",{src:a.id}),chunkWG7PYZXW_js.ca("hasSubtitlesInParams")&&chunkWG7PYZXW_js.Z(a.subtitles).map(e=>jsxRuntime.jsx("track",{id:`player-tracker-${e.lang}`,src:e.url,label:chunkWG7PYZXW_js._(e.lang),kind:"subtitles",srcLang:e.lang},e.id))]})},M=C;module.exports=M;//# sourceMappingURL=staticVideoTag-DYKLVJRS.js.map
|
|
2
|
+
//# sourceMappingURL=staticVideoTag-DYKLVJRS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx"],"names":["init_cjs_shims","StaticVideoTag","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","firstPlay","loadingDurationRef","useRef","initialWaitingDurationRef","timerRef","intervalRef","useEffect","handlePageLoadTime","handleResize","element","mainPlayerVideoTag","setVideoElementSizeInfo","conditions","useHideSubtitle_default","useJumpToCurrentTime_default","jsxs","handleStaticVideoCanPlay","handleStaticVideoPause","event","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoLoadedData","handleVideoError","jsx","Image","sortLanguages","subtitle","getSubtitleLabel","staticVideoTag_default"],"mappings":"oeAAAA,kBAAAA,EAAAA,CAcA,IAAMC,CAAiB,CAAA,IAAM,CACzB,IAAMC,CAAWC,CAAAA,mBAAAA,EACX,CAAA,CAAE,MAAAC,CAAAA,CAAO,CAAIC,CAAAA,mBAAAA,CAAe,CAAC,CAAE,SAAW,CAAA,CAAE,MAAAD,CAAAA,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAC3FD,mBAAe,CAAA,CAAC,CAAE,UAAA,CAAY,CAAE,SAAA,CAAAE,CAAU,CAAE,CAAO,IAAA,CAAE,SAAAA,CAAAA,CAAU,CAAID,CAAAA,CAAAA,uBAAY,CAC/E,CAAA,IAAME,CAAqBC,CAAAA,YAAAA,CAAY,CAAC,CAAA,CAClCC,CAA4BD,CAAAA,YAAAA,CAAY,CAAC,CAAA,CACzCE,CAAWF,CAAAA,YAAAA,CAA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AAciB,CAAAA,kBAAAA,CACd,YAAeH,CAAAA,CAAAA,EAAUI,kBAA4BJ,CAAAA,CAAAA,CAAOb,CAAW,CAAA,CACvE,OAASkB,CAAAA,kBAAAA,CACT,WAAW,CAAA,CAAA,CAAA,CAEV,QAAA1B,CAAAA,CAAAA,CAAAA,CAAO,MAAU2B,EAAAA,cAAAA,CAACC,kBAAA,CAAA,CAAM,MAAO,CAAA,MAAA,CAAO,GAAK5B,CAAAA,CAAAA,CAAO,MAAQ,CAAA,GAAA,CAAKA,CAAO,CAAA,SAAA,CAAYA,CAAO,CAAA,SAAA,CAAY,oIAA6B,CAAA,CAAA,CACnI2B,cAAC,CAAA,QAAA,CAAA,CAAO,GAAK3B,CAAAA,CAAAA,CAAO,EAAI,CAAA,CAAA,CACvBe,mBAA6C,CAAA,sBAAA,CAAA,EAC1Cc,kBAAc7B,CAAAA,CAAAA,CAAO,SAAS,CAAA,CAAG,GAAK8B,CAAAA,CAAAA,EAE9BH,cAAC,CAAA,OAAA,CAAA,CACG,EAAI,CAAA,CAAA,eAAA,EAAkBG,CAAS,CAAA,IAAI,CAEnC,CAAA,CAAA,GAAA,CAAKA,CAAS,CAAA,GAAA,CACd,KAAOC,CAAAA,kBAAAA,CAAiBD,CAAS,CAAA,IAAI,CACrC,CAAA,IAAA,CAAK,WACL,CAAA,OAAA,CAASA,CAAS,CAAA,IAAA,CAAA,CAJbA,CAAS,CAAA,EAKlB,CAGZ,CAAA,CAAA,CACJ,CAER,CAAA,CAEOE,CAAQnC,CAAAA","file":"staticVideoTag-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx"],"names":["init_cjs_shims","StaticVideoTag","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","firstPlay","loadingDurationRef","useRef","initialWaitingDurationRef","timerRef","intervalRef","useEffect","handlePageLoadTime","handleResize","element","mainPlayerVideoTag","setVideoElementSizeInfo","conditions","useHideSubtitle_default","useJumpToCurrentTime_default","jsxs","handleStaticVideoCanPlay","handleStaticVideoPause","event","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoLoadedData","handleVideoError","jsx","Image","sortLanguages","subtitle","getSubtitleLabel","staticVideoTag_default"],"mappings":"oeAAAA,kBAAAA,EAAAA,CAcA,IAAMC,CAAiB,CAAA,IAAM,CACzB,IAAMC,CAAWC,CAAAA,mBAAAA,EACX,CAAA,CAAE,MAAAC,CAAAA,CAAO,CAAIC,CAAAA,mBAAAA,CAAe,CAAC,CAAE,SAAW,CAAA,CAAE,MAAAD,CAAAA,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAC3FD,mBAAe,CAAA,CAAC,CAAE,UAAA,CAAY,CAAE,SAAA,CAAAE,CAAU,CAAE,CAAO,IAAA,CAAE,SAAAA,CAAAA,CAAU,CAAID,CAAAA,CAAAA,uBAAY,CAC/E,CAAA,IAAME,CAAqBC,CAAAA,YAAAA,CAAY,CAAC,CAAA,CAClCC,CAA4BD,CAAAA,YAAAA,CAAY,CAAC,CAAA,CACzCE,CAAWF,CAAAA,YAAAA,CAAY,IAAI,CAAA,CAC3BG,CAAcH,CAAAA,YAAAA,CAAY,IAAI,CAAA,CAEpC,OAAAI,eAAAA,CAAU,IAAM,CACZC,kBAAmBN,CAAAA,CAAkB,CACrCE,CAAAA,CAAAA,CAA0B,OAAU,CAAA,IAAA,CAAK,GAAI,GAEjD,CAAG,CAAA,EAAE,CAAA,CAELG,eAAU,CAAA,IAAM,CACZ,IAAME,CAAe,CAAA,IAAM,CACvB,IAAMC,CAAeC,CAAAA,mBAAAA,EAAsB,EAAA,qBAAA,EACvCD,CAAAA,CAAAA,EAASd,CAASgB,CAAAA,kBAAAA,CAAwBF,CAAO,CAAC,EAC1D,CAAA,CACA,OAAIG,mBAAAA,CAAAA,aAAoC,CAAGJ,EAAAA,CAAAA,EAC3C,CAAA,MAAA,C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mBAA6C,CAAA,sBAAA,CAAA,EAC1Cc,kBAAc7B,CAAAA,CAAAA,CAAO,SAAS,CAAA,CAAG,GAAK8B,CAAAA,CAAAA,EAE9BH,cAAC,CAAA,OAAA,CAAA,CACG,EAAI,CAAA,CAAA,eAAA,EAAkBG,CAAS,CAAA,IAAI,CAEnC,CAAA,CAAA,GAAA,CAAKA,CAAS,CAAA,GAAA,CACd,KAAOC,CAAAA,kBAAAA,CAAiBD,CAAS,CAAA,IAAI,CACrC,CAAA,IAAA,CAAK,WACL,CAAA,OAAA,CAASA,CAAS,CAAA,IAAA,CAAA,CAJbA,CAAS,CAAA,EAKlB,CAGZ,CAAA,CAAA,CACJ,CAER,CAAA,CAEOE,CAAQnC,CAAAA","file":"staticVideoTag-DYKLVJRS.js","sourcesContent":["import { useEffect, useRef } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { setVideoElementSizeInfo } from \"../../../helpers/redux/slices/videoDataSlice\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleStaticVideoCanPlay, handleStaticVideoLoadedData, handleStaticVideoPause, handleStaticVideoPlay, handleStaticVideoPlaying, handleStaticVideoTimeUpdate, handleVideoError } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport Image from \"next/legacy/image\";\r\n\r\nconst StaticVideoTag = () => {\r\n const dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n useAppSelector(({ controller: { firstPlay } }) => ({ firstPlay }), shallowEqual);\r\n const loadingDurationRef = useRef<any>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const timerRef = useRef<any>(null);\r\n const intervalRef = useRef<any>(null);\r\n\r\n useEffect(() => {\r\n handlePageLoadTime(loadingDurationRef);\r\n initialWaitingDurationRef.current = Date.now();\r\n \r\n }, []);\r\n\r\n useEffect(() => {\r\n const handleResize = () => {\r\n const element: any = mainPlayerVideoTag()?.getBoundingClientRect();\r\n if (element) dispatch(setVideoElementSizeInfo(element));\r\n };\r\n if (conditions(ConditionName.isFirstPlay)) handleResize();\r\n window.addEventListener(\"resize\", handleResize);\r\n \r\n return () => {\r\n window.removeEventListener(\"resize\", handleResize);\r\n clearInterval(intervalRef.current);\r\n };\r\n }, [params.id]);\r\n\r\n useHideSubtitle();\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <video\r\n poster={params.banner ? params.banner : undefined}\r\n preload=\"metadata\"\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n id=\"player-tag\"\r\n crossOrigin=\"anonymous\"\r\n className={`pl-w-full pl-h-full pl-items-center pl-flex-1`}\r\n onCanPlay={handleStaticVideoCanPlay}\r\n onPause={handleStaticVideoPause}\r\n onPlay={(event) => handleStaticVideoPlay(event, timerRef)}\r\n onPlaying={() => handleStaticVideoPlaying(loadingDurationRef, initialWaitingDurationRef, timerRef)}\r\n onTimeUpdate={handleStaticVideoTimeUpdate}\r\n onLoadedData={(event) => handleStaticVideoLoadedData(event, intervalRef)}\r\n onError={handleVideoError}\r\n playsInline\r\n >\r\n {params.banner && <Image layout=\"fill\" src={params.banner} alt={params.bannerAlt ? params.bannerAlt : \"بنر ویدیو پلیر کافه ویدیو\"} />}\r\n <source src={params.id} />\r\n {conditions(ConditionName.hasSubtitlesInParams) &&\r\n sortLanguages(params.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n }\r\n )}\r\n </video>\r\n );\r\n};\r\n\r\nexport default StaticVideoTag;\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=staticVideoTag-
|
|
1
|
+
import {b,a}from'./chunk-TUYGEJVR.mjs';import {A,w,x,y,z,B,a as a$1}from'./chunk-Q52RFNV3.mjs';import'./chunk-AUZAI7ZJ.mjs';import {da,ea,X,ca,Z,_,fa,t}from'./chunk-5OIS455P.mjs';import {e}from'./chunk-DBPGS72Q.mjs';import {useRef,useEffect}from'react';import {shallowEqual}from'react-redux';import A$1 from'next/legacy/image';import {jsxs,jsx}from'react/jsx-runtime';e();var C=()=>{let T=da(),{params:a$2}=ea(({videoData:{params:e}})=>({params:e}),shallowEqual);ea(({controller:{firstPlay:e}})=>({firstPlay:e}),shallowEqual);let r=useRef(0),l=useRef(0),d=useRef(null),s=useRef(null);return useEffect(()=>{X(r),l.current=Date.now();},[]),useEffect(()=>{let e=()=>{let m=fa()?.getBoundingClientRect();m&&T(t(m));};return ca("isFirstPlay")&&e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearInterval(s.current);}},[a$2.id]),b(),a(),jsxs("video",{poster:a$2.banner?a$2.banner:void 0,preload:"metadata",autoPlay:ca("hasAutoPlay"),id:"player-tag",crossOrigin:"anonymous",className:"pl-w-full pl-h-full pl-items-center pl-flex-1",onCanPlay:A,onPause:w,onPlay:e=>x(e,d),onPlaying:()=>y(r,l,d),onTimeUpdate:z,onLoadedData:e=>B(e,s),onError:a$1,playsInline:!0,children:[a$2.banner&&jsx(A$1,{layout:"fill",src:a$2.banner,alt:a$2.bannerAlt?a$2.bannerAlt:"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648"}),jsx("source",{src:a$2.id}),ca("hasSubtitlesInParams")&&Z(a$2.subtitles).map(e=>jsx("track",{id:`player-tracker-${e.lang}`,src:e.url,label:_(e.lang),kind:"subtitles",srcLang:e.lang},e.id))]})},Q=C;export{Q as default};//# sourceMappingURL=staticVideoTag-ZNZBQ7WW.mjs.map
|
|
2
|
+
//# sourceMappingURL=staticVideoTag-ZNZBQ7WW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx"],"names":["init_esm_shims","StaticVideoTag","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","firstPlay","loadingDurationRef","useRef","initialWaitingDurationRef","timerRef","intervalRef","useEffect","handlePageLoadTime","handleResize","element","mainPlayerVideoTag","setVideoElementSizeInfo","conditions","useHideSubtitle_default","useJumpToCurrentTime_default","jsxs","handleStaticVideoCanPlay","handleStaticVideoPause","event","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoLoadedData","handleVideoError","jsx","Image","sortLanguages","subtitle","getSubtitleLabel","staticVideoTag_default"],"mappings":"gXAAAA,CAAAA,EAAAA,CAcA,IAAMC,CAAiB,CAAA,IAAM,CACzB,IAAMC,CAAWC,CAAAA,EAAAA,EACX,CAAA,CAAE,MAAAC,CAAAA,GAAO,CAAIC,CAAAA,EAAAA,CAAe,CAAC,CAAE,SAAW,CAAA,CAAE,MAAAD,CAAAA,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,YAAY,CAAA,CAC3FD,EAAe,CAAA,CAAC,CAAE,UAAA,CAAY,CAAE,SAAA,CAAAE,CAAU,CAAE,CAAO,IAAA,CAAE,SAAAA,CAAAA,CAAU,CAAID,CAAAA,CAAAA,YAAY,CAC/E,CAAA,IAAME,CAAqBC,CAAAA,MAAAA,CAAY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AW,IAAMgB,CAAAA,CAAyBnB,CAAoBE,CAAAA,CAAAA,CAA2BC,CAAQ,CAAA,CACjG,YAAciB,CAAAA,CAAAA,CACd,YAAeH,CAAAA,CAAAA,EAAUI,CAA4BJ,CAAAA,CAAAA,CAAOb,CAAW,CAAA,CACvE,OAASkB,CAAAA,GAAAA,CACT,WAAW,CAAA,CAAA,CAAA,CAEV,QAAA1B,CAAAA,CAAAA,GAAAA,CAAO,MAAU2B,EAAAA,GAAAA,CAACC,GAAA,CAAA,CAAM,MAAO,CAAA,MAAA,CAAO,GAAK5B,CAAAA,GAAAA,CAAO,MAAQ,CAAA,GAAA,CAAKA,GAAO,CAAA,SAAA,CAAYA,GAAO,CAAA,SAAA,CAAY,oIAA6B,CAAA,CAAA,CACnI2B,GAAC,CAAA,QAAA,CAAA,CAAO,GAAK3B,CAAAA,GAAAA,CAAO,EAAI,CAAA,CAAA,CACvBe,EAA6C,CAAA,sBAAA,CAAA,EAC1Cc,CAAc7B,CAAAA,GAAAA,CAAO,SAAS,CAAA,CAAG,GAAK8B,CAAAA,CAAAA,EAE9BH,GAAC,CAAA,OAAA,CAAA,CACG,EAAI,CAAA,CAAA,eAAA,EAAkBG,CAAS,CAAA,IAAI,CAEnC,CAAA,CAAA,GAAA,CAAKA,CAAS,CAAA,GAAA,CACd,KAAOC,CAAAA,CAAAA,CAAiBD,CAAS,CAAA,IAAI,CACrC,CAAA,IAAA,CAAK,WACL,CAAA,OAAA,CAASA,CAAS,CAAA,IAAA,CAAA,CAJbA,CAAS,CAAA,EAKlB,CAGZ,CAAA,CAAA,CACJ,CAER,CAAA,CAEOE,CAAQnC,CAAAA","file":"staticVideoTag-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/staticVideoTag.tsx"],"names":["init_esm_shims","StaticVideoTag","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","firstPlay","loadingDurationRef","useRef","initialWaitingDurationRef","timerRef","intervalRef","useEffect","handlePageLoadTime","handleResize","element","mainPlayerVideoTag","setVideoElementSizeInfo","conditions","useHideSubtitle_default","useJumpToCurrentTime_default","jsxs","handleStaticVideoCanPlay","handleStaticVideoPause","event","handleStaticVideoPlay","handleStaticVideoPlaying","handleStaticVideoTimeUpdate","handleStaticVideoLoadedData","handleVideoError","jsx","Image","sortLanguages","subtitle","getSubtitleLabel","staticVideoTag_default"],"mappings":"gXAAAA,CAAAA,EAAAA,CAcA,IAAMC,CAAiB,CAAA,IAAM,CACzB,IAAMC,CAAWC,CAAAA,EAAAA,EACX,CAAA,CAAE,MAAAC,CAAAA,GAAO,CAAIC,CAAAA,EAAAA,CAAe,CAAC,CAAE,SAAW,CAAA,CAAE,MAAAD,CAAAA,CAAO,CAAE,CAAA,IAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,YAAY,CAAA,CAC3FD,EAAe,CAAA,CAAC,CAAE,UAAA,CAAY,CAAE,SAAA,CAAAE,CAAU,CAAE,CAAO,IAAA,CAAE,SAAAA,CAAAA,CAAU,CAAID,CAAAA,CAAAA,YAAY,CAC/E,CAAA,IAAME,CAAqBC,CAAAA,MAAAA,CAAY,CAAC,CAAA,CAClCC,CAA4BD,CAAAA,MAAAA,CAAY,CAAC,CAAA,CACzCE,CAAWF,CAAAA,MAAAA,CAAY,IAAI,CAAA,CAC3BG,CAAcH,CAAAA,MAAAA,CAAY,IAAI,CAAA,CAEpC,OAAAI,SAAAA,CAAU,IAAM,CACZC,CAAmBN,CAAAA,CAAkB,CACrCE,CAAAA,CAAAA,CAA0B,OAAU,CAAA,IAAA,CAAK,GAAI,GAEjD,CAAG,CAAA,EAAE,CAAA,CAELG,SAAU,CAAA,IAAM,CACZ,IAAME,CAAe,CAAA,IAAM,CACvB,IAAMC,CAAeC,CAAAA,EAAAA,EAAsB,EAAA,qBAAA,EACvCD,CAAAA,CAAAA,EAASd,CAASgB,CAAAA,CAAAA,CAAwBF,CAAO,CAAC,EAC1D,CAAA,CACA,OAAIG,EAAAA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CAAAA,GAAAA,CAAO,EAAI,CAAA,CAAA,CACvBe,EAA6C,CAAA,sBAAA,CAAA,EAC1Cc,CAAc7B,CAAAA,GAAAA,CAAO,SAAS,CAAA,CAAG,GAAK8B,CAAAA,CAAAA,EAE9BH,GAAC,CAAA,OAAA,CAAA,CACG,EAAI,CAAA,CAAA,eAAA,EAAkBG,CAAS,CAAA,IAAI,CAEnC,CAAA,CAAA,GAAA,CAAKA,CAAS,CAAA,GAAA,CACd,KAAOC,CAAAA,CAAAA,CAAiBD,CAAS,CAAA,IAAI,CACrC,CAAA,IAAA,CAAK,WACL,CAAA,OAAA,CAASA,CAAS,CAAA,IAAA,CAAA,CAJbA,CAAS,CAAA,EAKlB,CAGZ,CAAA,CAAA,CACJ,CAER,CAAA,CAEOE,CAAQnC,CAAAA","file":"staticVideoTag-ZNZBQ7WW.mjs","sourcesContent":["import { useEffect, useRef } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { setVideoElementSizeInfo } from \"../../../helpers/redux/slices/videoDataSlice\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleStaticVideoCanPlay, handleStaticVideoLoadedData, handleStaticVideoPause, handleStaticVideoPlay, handleStaticVideoPlaying, handleStaticVideoTimeUpdate, handleVideoError } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport Image from \"next/legacy/image\";\r\n\r\nconst StaticVideoTag = () => {\r\n const dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n useAppSelector(({ controller: { firstPlay } }) => ({ firstPlay }), shallowEqual);\r\n const loadingDurationRef = useRef<any>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const timerRef = useRef<any>(null);\r\n const intervalRef = useRef<any>(null);\r\n\r\n useEffect(() => {\r\n handlePageLoadTime(loadingDurationRef);\r\n initialWaitingDurationRef.current = Date.now();\r\n \r\n }, []);\r\n\r\n useEffect(() => {\r\n const handleResize = () => {\r\n const element: any = mainPlayerVideoTag()?.getBoundingClientRect();\r\n if (element) dispatch(setVideoElementSizeInfo(element));\r\n };\r\n if (conditions(ConditionName.isFirstPlay)) handleResize();\r\n window.addEventListener(\"resize\", handleResize);\r\n \r\n return () => {\r\n window.removeEventListener(\"resize\", handleResize);\r\n clearInterval(intervalRef.current);\r\n };\r\n }, [params.id]);\r\n\r\n useHideSubtitle();\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <video\r\n poster={params.banner ? params.banner : undefined}\r\n preload=\"metadata\"\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n id=\"player-tag\"\r\n crossOrigin=\"anonymous\"\r\n className={`pl-w-full pl-h-full pl-items-center pl-flex-1`}\r\n onCanPlay={handleStaticVideoCanPlay}\r\n onPause={handleStaticVideoPause}\r\n onPlay={(event) => handleStaticVideoPlay(event, timerRef)}\r\n onPlaying={() => handleStaticVideoPlaying(loadingDurationRef, initialWaitingDurationRef, timerRef)}\r\n onTimeUpdate={handleStaticVideoTimeUpdate}\r\n onLoadedData={(event) => handleStaticVideoLoadedData(event, intervalRef)}\r\n onError={handleVideoError}\r\n playsInline\r\n >\r\n {params.banner && <Image layout=\"fill\" src={params.banner} alt={params.bannerAlt ? params.bannerAlt : \"بنر ویدیو پلیر کافه ویدیو\"} />}\r\n <source src={params.id} />\r\n {conditions(ConditionName.hasSubtitlesInParams) &&\r\n sortLanguages(params.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n }\r\n )}\r\n </video>\r\n );\r\n};\r\n\r\nexport default StaticVideoTag;\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
module.exports=fe;//# sourceMappingURL=touchVolumeBrightness-
|
|
3
|
-
//# sourceMappingURL=touchVolumeBrightness-
|
|
1
|
+
'use strict';var chunkWG7PYZXW_js=require('./chunk-WG7PYZXW.js'),chunkDQNYU4AM_js=require('./chunk-DQNYU4AM.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),W=require('next/legacy/image'),react=require('react'),reactRedux=require('react-redux'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var W__default=/*#__PURE__*/_interopDefault(W);chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var $=({className:r,onClick:p})=>jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,onClick:p,children:jsxRuntime.jsxs("g",{opacity:"0.7",children:[jsxRuntime.jsx("path",{d:"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z"}),jsxRuntime.jsx("path",{d:"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z"})]})}),j=$;chunkWO4IQUGO_js.e();var Z=({className:r,onClick:p})=>jsxRuntime.jsx("svg",{width:"13",height:"16",viewBox:"0 0 13 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,onClick:p,children:jsxRuntime.jsx("path",{d:"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z"})}),R=Z;var D=()=>{let[r,p]=react.useState(""),m=chunkWG7PYZXW_js.da(),{settings:l}=chunkWG7PYZXW_js.ea(({user:{settings:s}})=>({settings:s}),reactRedux.shallowEqual),v=react.useRef(l.brightness),g=react.useRef(l.volume),b=react.useRef(r);react.useEffect(()=>{b.current=r;},[r]),react.useEffect(()=>{let s=0,i=e=>{chunkWG7PYZXW_js.ca("hidePopovers")&&!chunkWG7PYZXW_js.R(e,"progress-area")&&(s=e.touches[0].clientY);},u=e=>{chunkWG7PYZXW_js.ca("hidePopovers")&&!chunkWG7PYZXW_js.R(e,"progress-area")&&(e.stopPropagation(),e.touches[0].clientX>window.innerWidth/2?E(e,"volume",s,window.innerHeight):e.touches[0].clientX<window.innerWidth/2&&E(e,"brightness",s,window.innerHeight));},c=()=>{let{settings:e}=chunkWG7PYZXW_js.M.getState().user;b.current==="brightness"&&v.current!==e.brightness?(chunkWG7PYZXW_js.la(chunkWG7PYZXW_js.ra(v.current,e.brightness)),v.current=e.brightness):b.current==="volume"&&g.current!==e.volume&&(chunkWG7PYZXW_js.la(chunkWG7PYZXW_js.sa(g.current,e.volume)),g.current=e.volume),setTimeout(()=>p(""),500);};return document.addEventListener("touchstart",e=>i(e)),document.addEventListener("touchmove",e=>u(e)),document.addEventListener("touchend",()=>c()),()=>{document.removeEventListener("touchstart",e=>i(e)),document.removeEventListener("touchmove",e=>u(e)),document.removeEventListener("touchend",()=>c());}},[]),react.useEffect(()=>{l.volume===0&&!r&&(g.current=0);},[l.volume]);let E=(s,i,u,c)=>{let{settings:e}=chunkWG7PYZXW_js.M.getState().user,{activePointerProgressBar:A}=chunkWG7PYZXW_js.M.getState().controller;try{A||m(chunkWG7PYZXW_js.f(!1)),s.stopPropagation(),p(i);let{height:x}=document.getElementsByClassName("pl-bar")[0].getBoundingClientRect();if(i==="volume"){let o=e.volume+(u-s.touches[0].clientY)/40*x/c,d;o>100?d=100:o<0?d=0:d=Math.ceil(Math.abs(o)),m(chunkWG7PYZXW_js.G({...e,volume:d})),chunkWG7PYZXW_js.fa().volume=d/100;}else if(i==="brightness"){let o=e.brightness+(u-s.touches[0].clientY)/40*x/c;o>100?m(chunkWG7PYZXW_js.G({...e,brightness:100})):o<0?m(chunkWG7PYZXW_js.G({...e,brightness:0})):m(chunkWG7PYZXW_js.G({...e,brightness:Math.ceil(Math.abs(o))}));}}catch{return !1}};return jsxRuntime.jsxs("div",{id:"volume-brightness",children:[jsxRuntime.jsx("div",{className:"pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black",style:{opacity:l.brightness<10?.9:1-l.brightness/100}}),jsxRuntime.jsxs("div",{className:"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center",children:[jsxRuntime.jsx("div",{className:"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6",children:jsxRuntime.jsx("div",{id:"volume-progressbar",className:`pl-bar pl-relative pl-w-6 pl-h-[200px] ${r==="volume"&&"pl-bg-gray-300"} pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`,children:r==="volume"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]",style:{height:`${l.volume}%`}}),jsxRuntime.jsxs("div",{className:"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center",children:[jsxRuntime.jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[l.volume>0&&jsxRuntime.jsx("div",{className:"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"}),l.volume>33&&jsxRuntime.jsx("div",{className:"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"}),l.volume>66&&jsxRuntime.jsx("div",{className:"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"})]}),l.volume===0?jsxRuntime.jsx(j,{className:"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7"}):jsxRuntime.jsx(R,{className:"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7"})]})]})})}),r&&jsxRuntime.jsx("div",{className:"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white",children:r==="volume"?l.volume:l.brightness}),jsxRuntime.jsx("div",{className:"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6",children:jsxRuntime.jsx("div",{id:"brightness-progressbar",className:`pl-bar pl-relative pl-w-6 pl-h-[200px] ${r==="brightness"&&"pl-bg-gray-300"} pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`,children:r==="brightness"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]",style:{height:`${l.brightness}%`}}),jsxRuntime.jsx("div",{className:"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center",style:{opacity:l.brightness/100},children:jsxRuntime.jsx(W__default.default,{alt:"",src:chunkDQNYU4AM_js.a.sun,className:"pl-flex-1",width:20,height:20})})]})})})]})]})},fe=D;
|
|
2
|
+
module.exports=fe;//# sourceMappingURL=touchVolumeBrightness-BHL4CXCQ.js.map
|
|
3
|
+
//# sourceMappingURL=touchVolumeBrightness-BHL4CXCQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx","../src/videoPlayerLibrary/components/icon-components/mute.tsx","../src/videoPlayerLibrary/components/icon-components/unMute.tsx"],"names":["init_cjs_shims","Mute","className","onClick","jsx","jsxs","mute_default","UnMute","unMute_default","TouchVolumeBrightness","type","setType","useState","dispatch","useAppDispatch","settings","useAppSelector","shallowEqual","primaryBrightnessValueRef","useRef","primaryVolumeValueRef","typeRef","useEffect","startPositionY","handleTouchStartScreen","event","conditions","checkParentTarget","handleTouchMoveScreen","handleTouchMove","handleTouchEndScreen","store_default","sendFluentLog","brightnessLog","volumeLog","area","activePointerProgressBar","setActiveElements","height","value","volumeCount","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":["import Image from \"next/legacy/image\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport Mute from \"../../icon-components/mute\";\r\nimport UnMute from \"../../icon-components/unMute\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { checkParentTarget } from \"../../../helpers/helpers\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { brightnessLog, volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst TouchVolumeBrightness = () => {\r\n const [type, setType] = useState<string>(\"\");\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryBrightnessValueRef = useRef<number>(settings.brightness);\r\n const primaryVolumeValueRef = useRef<number>(settings.volume);\r\n const typeRef = useRef<string>(type);\r\n\r\n useEffect(() => {\r\n typeRef.current = type;\r\n }, [type]);\r\n\r\n useEffect(() => {\r\n let startPositionY = 0;\r\n\r\n const handleTouchStartScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) startPositionY = event.touches[0].clientY;\r\n };\r\n\r\n const handleTouchMoveScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) {\r\n event.stopPropagation();\r\n if (event.touches[0].clientX > window.innerWidth / 2) handleTouchMove(event, \"volume\", startPositionY, window.innerHeight);\r\n else if (event.touches[0].clientX < window.innerWidth / 2) handleTouchMove(event, \"brightness\", startPositionY, window.innerHeight);\r\n }\r\n };\r\n\r\n const handleTouchEndScreen = () => {\r\n const { settings } = store.getState().user;\r\n if (typeRef.current === \"brightness\" && primaryBrightnessValueRef.current !== settings.brightness) {\r\n sendFluentLog(brightnessLog(primaryBrightnessValueRef.current, settings.brightness));\r\n primaryBrightnessValueRef.current = settings.brightness;\r\n } else if (typeRef.current === \"volume\" && primaryVolumeValueRef.current !== settings.volume) {\r\n sendFluentLog(volumeLog(primaryVolumeValueRef.current, settings.volume));\r\n primaryVolumeValueRef.current = settings.volume;\r\n }\r\n setTimeout(() => setType(\"\"), 500);\r\n };\r\n\r\n document.addEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.addEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.addEventListener(\"touchend\", () => handleTouchEndScreen());\r\n\r\n return () => {\r\n document.removeEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.removeEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.removeEventListener(\"touchend\", () => handleTouchEndScreen());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (settings.volume === 0 && !type) primaryVolumeValueRef.current = 0;\r\n }, [settings.volume]);\r\n\r\n const handleTouchMove = (event: any, type: string, startPositionY: number, area: number) => {\r\n const { settings } = store.getState().user;\r\n const { activePointerProgressBar } = store.getState().controller;\r\n try {\r\n if (!activePointerProgressBar) dispatch(setActiveElements(false));\r\n event.stopPropagation();\r\n setType(type);\r\n const { height } = document.getElementsByClassName(\"pl-bar\")[0].getBoundingClientRect();\r\n if (type === \"volume\") {\r\n const value = settings.volume + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n let volumeCount: number;\r\n if (value > 100) volumeCount = 100;\r\n else if (value < 0) volumeCount = 0;\r\n else volumeCount = Math.ceil(Math.abs(value));\r\n dispatch(setUserSettings({ ...settings, volume: volumeCount }));\r\n mainPlayerVideoTag().volume = volumeCount / 100;\r\n } else if (type === \"brightness\") {\r\n const value = settings.brightness + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n if (value > 100) dispatch(setUserSettings({ ...settings, brightness: 100 }));\r\n else if (value < 0) dispatch(setUserSettings({ ...settings, brightness: 0 }));\r\n else dispatch(setUserSettings({ ...settings, brightness: Math.ceil(Math.abs(value)) }));\r\n }\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n return (\r\n <div id=\"volume-brightness\">\r\n <div\r\n className={`pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black`}\r\n style={{ opacity: settings.brightness < 10 ? 0.9 : 1 - settings.brightness / 100 }}\r\n ></div>\r\n <div className=\"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center\">\r\n <div className=\"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6\">\r\n <div\r\n id={\"volume-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"volume\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"volume\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.volume}%` }}\r\n />\r\n <div className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\">\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n {settings.volume > 0 && (\r\n <div className=\"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 33 && (\r\n <div className=\"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 66 && (\r\n <div className=\"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n </div>\r\n {settings.volume === 0 ? (\r\n <Mute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n ) : (\r\n <UnMute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n )}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n {type && (\r\n <div className=\"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white\">\r\n {type === \"volume\" ? settings.volume : settings.brightness}\r\n </div>\r\n )}\r\n <div className=\"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6\">\r\n <div\r\n id={\"brightness-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"brightness\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"brightness\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.brightness}%` }}\r\n />\r\n <div\r\n className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\"\r\n style={{ opacity: settings.brightness / 100 }}\r\n >\r\n <Image alt=\"\" src={IMAGES.sun} className=\"pl-flex-1\" width={20} height={20} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default TouchVolumeBrightness;\r\n","import { IMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst Mute = ({ className, onClick }: IMuteProps) => {\r\n return (\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <g opacity=\"0.7\">\r\n <path d=\"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z\" />\r\n <path d=\"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z\" />\r\n </g>\r\n </svg>\r\n );\r\n};\r\n\r\nexport default Mute;\r\n","import { IUnMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst UnMute = ({ className, onClick }: IUnMuteProps) => {\r\n return (\r\n <svg width=\"13\" height=\"16\" viewBox=\"0 0 13 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <path d=\"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z\" />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default UnMute;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx","../src/videoPlayerLibrary/components/icon-components/mute.tsx","../src/videoPlayerLibrary/components/icon-components/unMute.tsx"],"names":["init_cjs_shims","Mute","className","onClick","jsx","jsxs","mute_default","UnMute","unMute_default","TouchVolumeBrightness","type","setType","useState","dispatch","useAppDispatch","settings","useAppSelector","shallowEqual","primaryBrightnessValueRef","useRef","primaryVolumeValueRef","typeRef","useEffect","startPositionY","handleTouchStartScreen","event","conditions","checkParentTarget","handleTouchMoveScreen","handleTouchMove","handleTouchEndScreen","store_default","sendFluentLog","brightnessLog","volumeLog","area","activePointerProgressBar","setActiveElements","height","value","volumeCount","setUserSettings","mainPlayerVideoTag","Fragment","Image","importImages_default","touchVolumeBrightness_default"],"mappings":"iZAAAA,kBAAAA,EAAAA,CCAAA,kBAKY,EAAA,CAHZ,IAAMC,CAAO,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAQ,CAAA,GAE3BC,eAAC,KAAI,CAAA,CAAA,KAAA,CAAM,KAAK,MAAO,CAAA,IAAA,CAAK,QAAQ,WAAY,CAAA,IAAA,CAAK,OAAO,KAAM,CAAA,4BAAA,CAA6B,SAAWF,CAAAA,CAAAA,CAAW,QAASC,CAC1H,CAAA,QAAA,CAAAE,gBAAC,GAAE,CAAA,CAAA,OAAA,CAAQ,MACP,QAAAD,CAAAA,CAAAA,cAAAA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,SAAU,CAAA,oEAAA,CACX,SAAAA,cAAC,CAAA,KAAA,CAAA,CACG,GAAI,wBACJ,CAAA,SAAA,CAAW,0CACPM,CAAS,GAAA,YAAA,EAAgB,gBAC7B,CAEC,yFAAA,CAAA,CAAA,QAAA,CAAAA,IAAS,YACNL,EAAAA,eAAAA,CAAAsC,oBAAA,CACI,QAAA,CAAA,CAAAvC,eAAC,KACG,CAAA,CAAA,SAAA,CAAU,6DACV,CAAA,KAAA,CAAO,CAAE,MAAQ,CAAA,CAAA,EAAGW,EAAS,UAAU,CAAA,CAAA,CAAI,EAC/C,CACAX,CAAAA,cAAAA,CAAC,OACG,SAAU,CAAA,wDAAA,CACV,MAAO,CAAE,OAAA,CAASW,EAAS,UAAa,CAAA,GAAI,EAE5C,QAAAX,CAAAA,cAAAA,CAACwC,kBAAA,CAAA,CAAM,IAAI,EAAG,CAAA,GAAA,CAAKC,mBAAO,GAAK,CAAA,SAAA,CAAU,YAAY,KAAO,CAAA,EAAA,CAAI,OAAQ,EAAI,CAAA,CAAA,CAChF,GACJ,CAER,CAAA,CAAA,CACJ,GACJ,CACJ,CAAA,CAAA,CAER,EAEOC,EAAQrC,CAAAA","file":"touchVolumeBrightness-BHL4CXCQ.js","sourcesContent":["import Image from \"next/legacy/image\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport Mute from \"../../icon-components/mute\";\r\nimport UnMute from \"../../icon-components/unMute\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { checkParentTarget } from \"../../../helpers/helpers\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { brightnessLog, volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst TouchVolumeBrightness = () => {\r\n const [type, setType] = useState<string>(\"\");\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryBrightnessValueRef = useRef<number>(settings.brightness);\r\n const primaryVolumeValueRef = useRef<number>(settings.volume);\r\n const typeRef = useRef<string>(type);\r\n\r\n useEffect(() => {\r\n typeRef.current = type;\r\n }, [type]);\r\n\r\n useEffect(() => {\r\n let startPositionY = 0;\r\n\r\n const handleTouchStartScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) startPositionY = event.touches[0].clientY;\r\n };\r\n\r\n const handleTouchMoveScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) {\r\n event.stopPropagation();\r\n if (event.touches[0].clientX > window.innerWidth / 2) handleTouchMove(event, \"volume\", startPositionY, window.innerHeight);\r\n else if (event.touches[0].clientX < window.innerWidth / 2) handleTouchMove(event, \"brightness\", startPositionY, window.innerHeight);\r\n }\r\n };\r\n\r\n const handleTouchEndScreen = () => {\r\n const { settings } = store.getState().user;\r\n if (typeRef.current === \"brightness\" && primaryBrightnessValueRef.current !== settings.brightness) {\r\n sendFluentLog(brightnessLog(primaryBrightnessValueRef.current, settings.brightness));\r\n primaryBrightnessValueRef.current = settings.brightness;\r\n } else if (typeRef.current === \"volume\" && primaryVolumeValueRef.current !== settings.volume) {\r\n sendFluentLog(volumeLog(primaryVolumeValueRef.current, settings.volume));\r\n primaryVolumeValueRef.current = settings.volume;\r\n }\r\n setTimeout(() => setType(\"\"), 500);\r\n };\r\n\r\n document.addEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.addEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.addEventListener(\"touchend\", () => handleTouchEndScreen());\r\n\r\n return () => {\r\n document.removeEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.removeEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.removeEventListener(\"touchend\", () => handleTouchEndScreen());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (settings.volume === 0 && !type) primaryVolumeValueRef.current = 0;\r\n }, [settings.volume]);\r\n\r\n const handleTouchMove = (event: any, type: string, startPositionY: number, area: number) => {\r\n const { settings } = store.getState().user;\r\n const { activePointerProgressBar } = store.getState().controller;\r\n try {\r\n if (!activePointerProgressBar) dispatch(setActiveElements(false));\r\n event.stopPropagation();\r\n setType(type);\r\n const { height } = document.getElementsByClassName(\"pl-bar\")[0].getBoundingClientRect();\r\n if (type === \"volume\") {\r\n const value = settings.volume + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n let volumeCount: number;\r\n if (value > 100) volumeCount = 100;\r\n else if (value < 0) volumeCount = 0;\r\n else volumeCount = Math.ceil(Math.abs(value));\r\n dispatch(setUserSettings({ ...settings, volume: volumeCount }));\r\n mainPlayerVideoTag().volume = volumeCount / 100;\r\n } else if (type === \"brightness\") {\r\n const value = settings.brightness + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n if (value > 100) dispatch(setUserSettings({ ...settings, brightness: 100 }));\r\n else if (value < 0) dispatch(setUserSettings({ ...settings, brightness: 0 }));\r\n else dispatch(setUserSettings({ ...settings, brightness: Math.ceil(Math.abs(value)) }));\r\n }\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n return (\r\n <div id=\"volume-brightness\">\r\n <div\r\n className={`pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black`}\r\n style={{ opacity: settings.brightness < 10 ? 0.9 : 1 - settings.brightness / 100 }}\r\n ></div>\r\n <div className=\"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center\">\r\n <div className=\"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6\">\r\n <div\r\n id={\"volume-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"volume\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"volume\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.volume}%` }}\r\n />\r\n <div className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\">\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n {settings.volume > 0 && (\r\n <div className=\"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 33 && (\r\n <div className=\"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 66 && (\r\n <div className=\"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n </div>\r\n {settings.volume === 0 ? (\r\n <Mute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n ) : (\r\n <UnMute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n )}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n {type && (\r\n <div className=\"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white\">\r\n {type === \"volume\" ? settings.volume : settings.brightness}\r\n </div>\r\n )}\r\n <div className=\"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6\">\r\n <div\r\n id={\"brightness-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"brightness\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"brightness\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.brightness}%` }}\r\n />\r\n <div\r\n className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\"\r\n style={{ opacity: settings.brightness / 100 }}\r\n >\r\n <Image alt=\"\" src={IMAGES.sun} className=\"pl-flex-1\" width={20} height={20} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default TouchVolumeBrightness;\r\n","import { IMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst Mute = ({ className, onClick }: IMuteProps) => {\r\n return (\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <g opacity=\"0.7\">\r\n <path d=\"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z\" />\r\n <path d=\"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z\" />\r\n </g>\r\n </svg>\r\n );\r\n};\r\n\r\nexport default Mute;\r\n","import { IUnMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst UnMute = ({ className, onClick }: IUnMuteProps) => {\r\n return (\r\n <svg width=\"13\" height=\"16\" viewBox=\"0 0 13 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <path d=\"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z\" />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default UnMute;\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {da,ea,ca,R,M,la,ra,sa,f,G,fa}from'./chunk-
|
|
2
|
-
export{ve as default};//# sourceMappingURL=touchVolumeBrightness-
|
|
3
|
-
//# sourceMappingURL=touchVolumeBrightness-
|
|
1
|
+
import {da,ea,ca,R,M,la,ra,sa,f,G,fa}from'./chunk-5OIS455P.mjs';import {a}from'./chunk-6567FIPA.mjs';import {e}from'./chunk-DBPGS72Q.mjs';import X from'next/legacy/image';import {useState,useRef,useEffect}from'react';import {shallowEqual}from'react-redux';import {jsxs,jsx,Fragment}from'react/jsx-runtime';e();e();var Y=({className:r,onClick:p})=>jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,onClick:p,children:jsxs("g",{opacity:"0.7",children:[jsx("path",{d:"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z"}),jsx("path",{d:"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z"})]})}),z=Y;e();var W=({className:r,onClick:p})=>jsx("svg",{width:"13",height:"16",viewBox:"0 0 13 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,onClick:p,children:jsx("path",{d:"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z"})}),U=W;var F=()=>{let[r,p]=useState(""),m=da(),{settings:l}=ea(({user:{settings:s}})=>({settings:s}),shallowEqual),v=useRef(l.brightness),g=useRef(l.volume),b=useRef(r);useEffect(()=>{b.current=r;},[r]),useEffect(()=>{let s=0,i=e=>{ca("hidePopovers")&&!R(e,"progress-area")&&(s=e.touches[0].clientY);},u=e=>{ca("hidePopovers")&&!R(e,"progress-area")&&(e.stopPropagation(),e.touches[0].clientX>window.innerWidth/2?E(e,"volume",s,window.innerHeight):e.touches[0].clientX<window.innerWidth/2&&E(e,"brightness",s,window.innerHeight));},c=()=>{let{settings:e}=M.getState().user;b.current==="brightness"&&v.current!==e.brightness?(la(ra(v.current,e.brightness)),v.current=e.brightness):b.current==="volume"&&g.current!==e.volume&&(la(sa(g.current,e.volume)),g.current=e.volume),setTimeout(()=>p(""),500);};return document.addEventListener("touchstart",e=>i(e)),document.addEventListener("touchmove",e=>u(e)),document.addEventListener("touchend",()=>c()),()=>{document.removeEventListener("touchstart",e=>i(e)),document.removeEventListener("touchmove",e=>u(e)),document.removeEventListener("touchend",()=>c());}},[]),useEffect(()=>{l.volume===0&&!r&&(g.current=0);},[l.volume]);let E=(s,i,u,c)=>{let{settings:e}=M.getState().user,{activePointerProgressBar:$}=M.getState().controller;try{$||m(f(!1)),s.stopPropagation(),p(i);let{height:x}=document.getElementsByClassName("pl-bar")[0].getBoundingClientRect();if(i==="volume"){let o=e.volume+(u-s.touches[0].clientY)/40*x/c,d;o>100?d=100:o<0?d=0:d=Math.ceil(Math.abs(o)),m(G({...e,volume:d})),fa().volume=d/100;}else if(i==="brightness"){let o=e.brightness+(u-s.touches[0].clientY)/40*x/c;o>100?m(G({...e,brightness:100})):o<0?m(G({...e,brightness:0})):m(G({...e,brightness:Math.ceil(Math.abs(o))}));}}catch{return !1}};return jsxs("div",{id:"volume-brightness",children:[jsx("div",{className:"pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black",style:{opacity:l.brightness<10?.9:1-l.brightness/100}}),jsxs("div",{className:"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center",children:[jsx("div",{className:"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6",children:jsx("div",{id:"volume-progressbar",className:`pl-bar pl-relative pl-w-6 pl-h-[200px] ${r==="volume"&&"pl-bg-gray-300"} pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`,children:r==="volume"&&jsxs(Fragment,{children:[jsx("div",{className:"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]",style:{height:`${l.volume}%`}}),jsxs("div",{className:"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center",children:[jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[l.volume>0&&jsx("div",{className:"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"}),l.volume>33&&jsx("div",{className:"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"}),l.volume>66&&jsx("div",{className:"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light"})]}),l.volume===0?jsx(z,{className:"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7"}):jsx(U,{className:"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7"})]})]})})}),r&&jsx("div",{className:"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white",children:r==="volume"?l.volume:l.brightness}),jsx("div",{className:"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6",children:jsx("div",{id:"brightness-progressbar",className:`pl-bar pl-relative pl-w-6 pl-h-[200px] ${r==="brightness"&&"pl-bg-gray-300"} pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`,children:r==="brightness"&&jsxs(Fragment,{children:[jsx("div",{className:"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]",style:{height:`${l.brightness}%`}}),jsx("div",{className:"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center",style:{opacity:l.brightness/100},children:jsx(X,{alt:"",src:a.sun,className:"pl-flex-1",width:20,height:20})})]})})})]})]})},ve=F;
|
|
2
|
+
export{ve as default};//# sourceMappingURL=touchVolumeBrightness-THRKUQFI.mjs.map
|
|
3
|
+
//# sourceMappingURL=touchVolumeBrightness-THRKUQFI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx","../src/videoPlayerLibrary/components/icon-components/mute.tsx","../src/videoPlayerLibrary/components/icon-components/unMute.tsx"],"names":["init_esm_shims","Mute","className","onClick","jsx","jsxs","mute_default","UnMute","unMute_default","TouchVolumeBrightness","type","setType","useState","dispatch","useAppDispatch","settings","useAppSelector","shallowEqual","primaryBrightnessValueRef","useRef","primaryVolumeValueRef","typeRef","useEffect","startPositionY","handleTouchStartScreen","event","conditions","checkParentTarget","handleTouchMoveScreen","handleTouchMove","handleTouchEndScreen","store_default","sendFluentLog","brightnessLog","volumeLog","area","activePointerProgressBar","setActiveElements","height","value","volumeCount","setUserSettings","mainPlayerVideoTag","Fragment","Image","importImages_default","touchVolumeBrightness_default"],"mappings":"kTAAAA,CAAAA,EAAAA,CCAAA,CAKY,EAAA,CAHZ,IAAMC,CAAO,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAQ,CAAA,GAE3BC,IAAC,KAAI,CAAA,CAAA,KAAA,CAAM,KAAK,MAAO,CAAA,IAAA,CAAK,QAAQ,WAAY,CAAA,IAAA,CAAK,OAAO,KAAM,CAAA,4BAAA,CAA6B,SAAWF,CAAAA,CAAAA,CAAW,QAASC,CAC1H,CAAA,QAAA,CAAAE,KAAC,GAAE,CAAA,CAAA,OAAA,CAAQ,MACP,QAAAD,CAAAA,CAAAA,GAAAA,CAAC,QAAK,CAAE,CAAA,sSAAA,CAAuS,EAC/SA,GAAC,CAAA,MAAA,CAAA,CAAK,EAAE,8kBAA+kB,CAAA,CAAA,CAAA,CAC3lB,EACJ,CAIDE,CAAAA,CAAAA,CAAQL,CCbfD,CAAAA,CAAAA,EAAAA,CAEA,IAAMO,CAAS,CAAA,CAAC,CAAE,SAAAL,CAAAA,CAAAA,CAAW,QAAAC,CAAQ,CAAA,GAE7BC,IAAC,KAAI,CAAA,CAAA,KAAA,CAAM,KAAK,MAAO,CAAA,IAAA,CAAK,QAAQ,WAAY,CAAA,IAAA,CAAK,MAAO,CAAA,KAAA,CAAM,6BAA6B,SAAWF,CAAAA,CAAAA,CAAW,QAASC,CAC1H,CAAA,QAAA,CAAAC,IAAC,MAAK,CAAA,CAAA,CAAA,CAAE,4hBAA4hB,CACxiB,CAAA,CAAA,CAIDI,EAAQD,CF4FH,CArFZ,IAAME,EAAwB,IAAM,CAChC,GAAM,CAACC,CAAAA,CAAMC,CAA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ACJ,CAER,CAAA,CAAA,CACJ,GACJ,CACJ,CAAA,CAAA,CAER,EAEOC,EAAQrC,CAAAA","file":"touchVolumeBrightness-VSJS4WWO.mjs","sourcesContent":["import Image from \"next/legacy/image\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport Mute from \"../../icon-components/mute\";\r\nimport UnMute from \"../../icon-components/unMute\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { checkParentTarget } from \"../../../helpers/helpers\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { brightnessLog, volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst TouchVolumeBrightness = () => {\r\n const [type, setType] = useState<string>(\"\");\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryBrightnessValueRef = useRef<number>(settings.brightness);\r\n const primaryVolumeValueRef = useRef<number>(settings.volume);\r\n const typeRef = useRef<string>(type);\r\n\r\n useEffect(() => {\r\n typeRef.current = type;\r\n }, [type]);\r\n\r\n useEffect(() => {\r\n let startPositionY = 0;\r\n\r\n const handleTouchStartScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) startPositionY = event.touches[0].clientY;\r\n };\r\n\r\n const handleTouchMoveScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) {\r\n event.stopPropagation();\r\n if (event.touches[0].clientX > window.innerWidth / 2) handleTouchMove(event, \"volume\", startPositionY, window.innerHeight);\r\n else if (event.touches[0].clientX < window.innerWidth / 2) handleTouchMove(event, \"brightness\", startPositionY, window.innerHeight);\r\n }\r\n };\r\n\r\n const handleTouchEndScreen = () => {\r\n const { settings } = store.getState().user;\r\n if (typeRef.current === \"brightness\" && primaryBrightnessValueRef.current !== settings.brightness) {\r\n sendFluentLog(brightnessLog(primaryBrightnessValueRef.current, settings.brightness));\r\n primaryBrightnessValueRef.current = settings.brightness;\r\n } else if (typeRef.current === \"volume\" && primaryVolumeValueRef.current !== settings.volume) {\r\n sendFluentLog(volumeLog(primaryVolumeValueRef.current, settings.volume));\r\n primaryVolumeValueRef.current = settings.volume;\r\n }\r\n setTimeout(() => setType(\"\"), 500);\r\n };\r\n\r\n document.addEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.addEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.addEventListener(\"touchend\", () => handleTouchEndScreen());\r\n\r\n return () => {\r\n document.removeEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.removeEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.removeEventListener(\"touchend\", () => handleTouchEndScreen());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (settings.volume === 0 && !type) primaryVolumeValueRef.current = 0;\r\n }, [settings.volume]);\r\n\r\n const handleTouchMove = (event: any, type: string, startPositionY: number, area: number) => {\r\n const { settings } = store.getState().user;\r\n const { activePointerProgressBar } = store.getState().controller;\r\n try {\r\n if (!activePointerProgressBar) dispatch(setActiveElements(false));\r\n event.stopPropagation();\r\n setType(type);\r\n const { height } = document.getElementsByClassName(\"pl-bar\")[0].getBoundingClientRect();\r\n if (type === \"volume\") {\r\n const value = settings.volume + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n let volumeCount: number;\r\n if (value > 100) volumeCount = 100;\r\n else if (value < 0) volumeCount = 0;\r\n else volumeCount = Math.ceil(Math.abs(value));\r\n dispatch(setUserSettings({ ...settings, volume: volumeCount }));\r\n mainPlayerVideoTag().volume = volumeCount / 100;\r\n } else if (type === \"brightness\") {\r\n const value = settings.brightness + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n if (value > 100) dispatch(setUserSettings({ ...settings, brightness: 100 }));\r\n else if (value < 0) dispatch(setUserSettings({ ...settings, brightness: 0 }));\r\n else dispatch(setUserSettings({ ...settings, brightness: Math.ceil(Math.abs(value)) }));\r\n }\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n return (\r\n <div id=\"volume-brightness\">\r\n <div\r\n className={`pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black`}\r\n style={{ opacity: settings.brightness < 10 ? 0.9 : 1 - settings.brightness / 100 }}\r\n ></div>\r\n <div className=\"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center\">\r\n <div className=\"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6\">\r\n <div\r\n id={\"volume-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"volume\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"volume\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.volume}%` }}\r\n />\r\n <div className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\">\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n {settings.volume > 0 && (\r\n <div className=\"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 33 && (\r\n <div className=\"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 66 && (\r\n <div className=\"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n </div>\r\n {settings.volume === 0 ? (\r\n <Mute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n ) : (\r\n <UnMute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n )}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n {type && (\r\n <div className=\"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white\">\r\n {type === \"volume\" ? settings.volume : settings.brightness}\r\n </div>\r\n )}\r\n <div className=\"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6\">\r\n <div\r\n id={\"brightness-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"brightness\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"brightness\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.brightness}%` }}\r\n />\r\n <div\r\n className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\"\r\n style={{ opacity: settings.brightness / 100 }}\r\n >\r\n <Image alt=\"\" src={IMAGES.sun} className=\"pl-flex-1\" width={20} height={20} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default TouchVolumeBrightness;\r\n","import { IMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst Mute = ({ className, onClick }: IMuteProps) => {\r\n return (\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <g opacity=\"0.7\">\r\n <path d=\"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z\" />\r\n <path d=\"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z\" />\r\n </g>\r\n </svg>\r\n );\r\n};\r\n\r\nexport default Mute;\r\n","import { IUnMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst UnMute = ({ className, onClick }: IUnMuteProps) => {\r\n return (\r\n <svg width=\"13\" height=\"16\" viewBox=\"0 0 13 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <path d=\"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z\" />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default UnMute;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/touchVolumeBrightness/touchVolumeBrightness.tsx","../src/videoPlayerLibrary/components/icon-components/mute.tsx","../src/videoPlayerLibrary/components/icon-components/unMute.tsx"],"names":["init_esm_shims","Mute","className","onClick","jsx","jsxs","mute_default","UnMute","unMute_default","TouchVolumeBrightness","type","setType","useState","dispatch","useAppDispatch","settings","useAppSelector","shallowEqual","primaryBrightnessValueRef","useRef","primaryVolumeValueRef","typeRef","useEffect","startPositionY","handleTouchStartScreen","event","conditions","checkParentTarget","handleTouchMoveScreen","handleTouchMove","handleTouchEndScreen","store_default","sendFluentLog","brightnessLog","volumeLog","area","activePointerProgressBar","setActiveElements","height","value","volumeCount","setUserSettings","mainPlayerVideoTag","Fragment","Image","importImages_default","touchVolumeBrightness_default"],"mappings":"kTAAAA,CAAAA,EAAAA,CCAAA,CAKY,EAAA,CAHZ,IAAMC,CAAO,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAQ,CAAA,GAE3BC,IAAC,KAAI,CAAA,CAAA,KAAA,CAAM,KAAK,MAAO,CAAA,IAAA,CAAK,QAAQ,WAAY,CAAA,IAAA,CAAK,OAAO,KAAM,CAAA,4BAAA,CAA6B,SAAWF,CAAAA,C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AAAA,CAAAA,CAAS,OAASA,CAAS,CAAA,UAAA,CACpD,EAEJX,GAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,oEAAA,CACX,SAAAA,GAAC,CAAA,KAAA,CAAA,CACG,GAAI,wBACJ,CAAA,SAAA,CAAW,0CACPM,CAAS,GAAA,YAAA,EAAgB,gBAC7B,CAEC,yFAAA,CAAA,CAAA,QAAA,CAAAA,IAAS,YACNL,EAAAA,IAAAA,CAAAsC,SAAA,CACI,QAAA,CAAA,CAAAvC,IAAC,KACG,CAAA,CAAA,SAAA,CAAU,6DACV,CAAA,KAAA,CAAO,CAAE,MAAQ,CAAA,CAAA,EAAGW,EAAS,UAAU,CAAA,CAAA,CAAI,EAC/C,CACAX,CAAAA,GAAAA,CAAC,OACG,SAAU,CAAA,wDAAA,CACV,MAAO,CAAE,OAAA,CAASW,EAAS,UAAa,CAAA,GAAI,EAE5C,QAAAX,CAAAA,GAAAA,CAACwC,CAAA,CAAA,CAAM,IAAI,EAAG,CAAA,GAAA,CAAKC,EAAO,GAAK,CAAA,SAAA,CAAU,YAAY,KAAO,CAAA,EAAA,CAAI,OAAQ,EAAI,CAAA,CAAA,CAChF,GACJ,CAER,CAAA,CAAA,CACJ,GACJ,CACJ,CAAA,CAAA,CAER,EAEOC,EAAQrC,CAAAA","file":"touchVolumeBrightness-THRKUQFI.mjs","sourcesContent":["import Image from \"next/legacy/image\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport Mute from \"../../icon-components/mute\";\r\nimport UnMute from \"../../icon-components/unMute\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { checkParentTarget } from \"../../../helpers/helpers\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { brightnessLog, volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst TouchVolumeBrightness = () => {\r\n const [type, setType] = useState<string>(\"\");\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryBrightnessValueRef = useRef<number>(settings.brightness);\r\n const primaryVolumeValueRef = useRef<number>(settings.volume);\r\n const typeRef = useRef<string>(type);\r\n\r\n useEffect(() => {\r\n typeRef.current = type;\r\n }, [type]);\r\n\r\n useEffect(() => {\r\n let startPositionY = 0;\r\n\r\n const handleTouchStartScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) startPositionY = event.touches[0].clientY;\r\n };\r\n\r\n const handleTouchMoveScreen = (event: any) => {\r\n if (conditions(ConditionName.hidePopovers) && !checkParentTarget(event, \"progress-area\")) {\r\n event.stopPropagation();\r\n if (event.touches[0].clientX > window.innerWidth / 2) handleTouchMove(event, \"volume\", startPositionY, window.innerHeight);\r\n else if (event.touches[0].clientX < window.innerWidth / 2) handleTouchMove(event, \"brightness\", startPositionY, window.innerHeight);\r\n }\r\n };\r\n\r\n const handleTouchEndScreen = () => {\r\n const { settings } = store.getState().user;\r\n if (typeRef.current === \"brightness\" && primaryBrightnessValueRef.current !== settings.brightness) {\r\n sendFluentLog(brightnessLog(primaryBrightnessValueRef.current, settings.brightness));\r\n primaryBrightnessValueRef.current = settings.brightness;\r\n } else if (typeRef.current === \"volume\" && primaryVolumeValueRef.current !== settings.volume) {\r\n sendFluentLog(volumeLog(primaryVolumeValueRef.current, settings.volume));\r\n primaryVolumeValueRef.current = settings.volume;\r\n }\r\n setTimeout(() => setType(\"\"), 500);\r\n };\r\n\r\n document.addEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.addEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.addEventListener(\"touchend\", () => handleTouchEndScreen());\r\n\r\n return () => {\r\n document.removeEventListener(\"touchstart\", (event: any) => handleTouchStartScreen(event));\r\n document.removeEventListener(\"touchmove\", (event: any) => handleTouchMoveScreen(event));\r\n document.removeEventListener(\"touchend\", () => handleTouchEndScreen());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (settings.volume === 0 && !type) primaryVolumeValueRef.current = 0;\r\n }, [settings.volume]);\r\n\r\n const handleTouchMove = (event: any, type: string, startPositionY: number, area: number) => {\r\n const { settings } = store.getState().user;\r\n const { activePointerProgressBar } = store.getState().controller;\r\n try {\r\n if (!activePointerProgressBar) dispatch(setActiveElements(false));\r\n event.stopPropagation();\r\n setType(type);\r\n const { height } = document.getElementsByClassName(\"pl-bar\")[0].getBoundingClientRect();\r\n if (type === \"volume\") {\r\n const value = settings.volume + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n let volumeCount: number;\r\n if (value > 100) volumeCount = 100;\r\n else if (value < 0) volumeCount = 0;\r\n else volumeCount = Math.ceil(Math.abs(value));\r\n dispatch(setUserSettings({ ...settings, volume: volumeCount }));\r\n mainPlayerVideoTag().volume = volumeCount / 100;\r\n } else if (type === \"brightness\") {\r\n const value = settings.brightness + (((startPositionY - event.touches[0].clientY) / 40) * height) / area;\r\n if (value > 100) dispatch(setUserSettings({ ...settings, brightness: 100 }));\r\n else if (value < 0) dispatch(setUserSettings({ ...settings, brightness: 0 }));\r\n else dispatch(setUserSettings({ ...settings, brightness: Math.ceil(Math.abs(value)) }));\r\n }\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n return (\r\n <div id=\"volume-brightness\">\r\n <div\r\n className={`pl-fixed pl-w-screen pl-h-screen pl-top-0 pl-right-0 pl-bg-black`}\r\n style={{ opacity: settings.brightness < 10 ? 0.9 : 1 - settings.brightness / 100 }}\r\n ></div>\r\n <div className=\"pl-absolute pl-top-0 pl-right-0 pl-w-full pl-h-full pl-flex pl-justify-between pl-items-center\">\r\n <div className=\"pl-flex pl-items-center pl-flex-1 pl-h-full pl-pr-6\">\r\n <div\r\n id={\"volume-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"volume\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"volume\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-secondary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.volume}%` }}\r\n />\r\n <div className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\">\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n {settings.volume > 0 && (\r\n <div className=\"pl-absolute pl-right-[2px] pl-w-2 pl-h-2 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 33 && (\r\n <div className=\"pl-absolute pl-right-[-1px] pl-w-3 pl-h-3 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n {settings.volume > 66 && (\r\n <div className=\"pl-absolute pl-right-[-4px] pl-w-4 pl-h-4 pl-rounded-full pl-flex pl-items-center pl-justify-center pl-border-2 pl-border-transparent pl-border-r-2 pl-border-r-z-yellow-light\" />\r\n )}\r\n </div>\r\n {settings.volume === 0 ? (\r\n <Mute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n ) : (\r\n <UnMute className=\"pl-z-[1] pl-w-[13px] pl-h-[13px] pl-fill-dark-7\" />\r\n )}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n {type && (\r\n <div className=\"pl-bg-secondary-700/[0.8] pl-rounded-full pl-w-[54px] pl-h-[54px] pl-flex pl-items-center pl-justify-center pl-text-[32px] pl-font-normal pl-text-white\">\r\n {type === \"volume\" ? settings.volume : settings.brightness}\r\n </div>\r\n )}\r\n <div className=\"pl-flex pl-items-center pl-justify-end pl-flex-1 pl-h-full pl-pl-6\">\r\n <div\r\n id={\"brightness-progressbar\"}\r\n className={`pl-bar pl-relative pl-w-6 pl-h-[200px] ${\r\n type === \"brightness\" && \"pl-bg-gray-300\"\r\n } pl-rounded-[50px] pl-overflow-hidden pl-max-h-[80vh] pl-flex pl-items-end pl-justify-end`}\r\n >\r\n {type === \"brightness\" && (\r\n <>\r\n <div\r\n className=\"pl-absolute pl-w-full pl-bg-primary-600 pl-rounded-b-[50px]\"\r\n style={{ height: `${settings.brightness}%` }}\r\n />\r\n <div\r\n className=\"pl-mb-[7px] pl-ml-0.5 pl-flex pl-gap-1 pl-items-center\"\r\n style={{ opacity: settings.brightness / 100 }}\r\n >\r\n <Image alt=\"\" src={IMAGES.sun} className=\"pl-flex-1\" width={20} height={20} />\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default TouchVolumeBrightness;\r\n","import { IMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst Mute = ({ className, onClick }: IMuteProps) => {\r\n return (\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <g opacity=\"0.7\">\r\n <path d=\"M11.6997 10.7997C12.2247 10.2747 13.1247 10.6497 13.1247 11.3914V13.833C13.1247 15.2664 12.6081 16.3414 11.6831 16.858C11.3081 17.0664 10.8914 17.1664 10.4581 17.1664C9.79141 17.1664 9.07474 16.9414 8.34141 16.483L7.80807 16.1497C7.35807 15.8664 7.28307 15.233 7.65807 14.858L11.6997 10.7997Z\" />\r\n <path d=\"M18.141 1.85742C17.891 1.60742 17.4827 1.60742 17.2327 1.85742L13.1077 5.98242C13.0577 4.64909 12.5577 3.64909 11.6743 3.15742C10.741 2.64076 9.54935 2.77409 8.33268 3.53242L5.90768 5.04909C5.74102 5.14909 5.54935 5.20742 5.35768 5.20742H4.58268H4.16602C2.14935 5.20742 1.04102 6.31575 1.04102 8.33242V11.6658C1.04102 13.6824 2.14935 14.7908 4.16602 14.7908H4.29935L1.84935 17.2408C1.59935 17.4908 1.59935 17.8991 1.84935 18.1491C1.98268 18.2658 2.14102 18.3324 2.30768 18.3324C2.47435 18.3324 2.63268 18.2658 2.75768 18.1408L18.141 2.75742C18.3994 2.50742 18.3994 2.10742 18.141 1.85742Z\" />\r\n </g>\r\n </svg>\r\n );\r\n};\r\n\r\nexport default Mute;\r\n","import { IUnMuteProps } from \"../../helpers/interfaces/interfaces\";\r\n\r\nconst UnMute = ({ className, onClick }: IUnMuteProps) => {\r\n return (\r\n <svg width=\"13\" height=\"16\" viewBox=\"0 0 13 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className} onClick={onClick}>\r\n <path d=\"M10.6827 1.14944C9.74935 0.632778 8.55768 0.766111 7.34102 1.52444L4.90768 3.04944C4.74102 3.14944 4.54935 3.20778 4.35768 3.20778H3.58268H3.16602C1.14935 3.20778 0.0410156 4.31611 0.0410156 6.33278V9.66611C0.0410156 11.6828 1.14935 12.7911 3.16602 12.7911H3.58268H4.35768C4.54935 12.7911 4.74102 12.8494 4.90768 12.9494L7.34102 14.4744C8.07435 14.9328 8.79102 15.1578 9.45768 15.1578C9.89102 15.1578 10.3077 15.0578 10.6827 14.8494C11.6077 14.3328 12.1243 13.2578 12.1243 11.8244V4.17444C12.1243 2.74111 11.6077 1.66611 10.6827 1.14944Z\" />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default UnMute;\r\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as default}from'./chunk-DQ4YH4BY.mjs';import'./chunk-BMC7X7BK.mjs';import'./chunk-IOYUXRGD.mjs';import'./chunk-6R7UYUPZ.mjs';import'./chunk-AUZAI7ZJ.mjs';import'./chunk-5OIS455P.mjs';import'./chunk-6567FIPA.mjs';import'./chunk-DBPGS72Q.mjs';//# sourceMappingURL=videoArea-JBENXGDZ.mjs.map
|
|
2
|
+
//# sourceMappingURL=videoArea-JBENXGDZ.mjs.map
|