cafe-video-player 2.4.2 → 2.4.3
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/{VideoHighLighter-VEYEES5O.mjs → VideoHighLighter-AA7I6AFZ.mjs} +2 -2
- package/{VideoHighLighter-VEYEES5O.mjs.map → VideoHighLighter-AA7I6AFZ.mjs.map} +1 -1
- package/{VideoHighLighter-3U5XWMWJ.js → VideoHighLighter-EMXMJJWG.js} +2 -2
- package/{VideoHighLighter-3U5XWMWJ.js.map → VideoHighLighter-EMXMJJWG.js.map} +1 -1
- package/backwardForward-OSLVEXHW.mjs +2 -0
- package/{backwardForward-N75PBTWN.mjs.map → backwardForward-OSLVEXHW.mjs.map} +1 -1
- package/backwardForward-PEKYA7G4.js +2 -0
- package/{backwardForward-E2NLBMMH.js.map → backwardForward-PEKYA7G4.js.map} +1 -1
- package/{chunk-UBKDWPP7.mjs → chunk-2J3G4ODR.mjs} +4 -4
- package/{chunk-UBKDWPP7.mjs.map → chunk-2J3G4ODR.mjs.map} +1 -1
- package/{chunk-KIC75NSX.mjs → chunk-4TQF43YU.mjs} +2 -2
- package/{chunk-KIC75NSX.mjs.map → chunk-4TQF43YU.mjs.map} +1 -1
- package/{chunk-BOS4UPEA.js → chunk-5HFX3MP2.js} +2 -2
- package/{chunk-BOS4UPEA.js.map → chunk-5HFX3MP2.js.map} +1 -1
- package/{chunk-SUV7NR2J.mjs → chunk-6V7Y4FV6.mjs} +2 -2
- package/{chunk-SUV7NR2J.mjs.map → chunk-6V7Y4FV6.mjs.map} +1 -1
- package/{chunk-M4NZ4V5H.mjs → chunk-A2WOHDUE.mjs} +3 -3
- package/{chunk-M4NZ4V5H.mjs.map → chunk-A2WOHDUE.mjs.map} +1 -1
- package/{chunk-4I3S32RN.mjs → chunk-CSWKETJ4.mjs} +2 -2
- package/{chunk-4I3S32RN.mjs.map → chunk-CSWKETJ4.mjs.map} +1 -1
- package/chunk-D6YE37GQ.js +3 -0
- package/{chunk-CIBMAE3N.js.map → chunk-D6YE37GQ.js.map} +1 -1
- package/{chunk-YZYTKWCY.mjs → chunk-FPUBUJN6.mjs} +2 -2
- package/chunk-FPUBUJN6.mjs.map +1 -0
- package/{chunk-HME64W2O.js → chunk-HSAWK74H.js} +2 -2
- package/chunk-HSAWK74H.js.map +1 -0
- package/{chunk-K4TUYQMW.js → chunk-I5PCCWLZ.js} +5 -5
- package/{chunk-K4TUYQMW.js.map → chunk-I5PCCWLZ.js.map} +1 -1
- package/{chunk-5LJKRSJU.js → chunk-IR7FV4FQ.js} +2 -2
- package/{chunk-5LJKRSJU.js.map → chunk-IR7FV4FQ.js.map} +1 -1
- package/chunk-JGG5BV2J.js +2 -0
- package/{chunk-BBWNG7HP.js.map → chunk-JGG5BV2J.js.map} +1 -1
- package/{chunk-L2M274SY.mjs → chunk-MSI72J5J.mjs} +2 -2
- package/{chunk-L2M274SY.mjs.map → chunk-MSI72J5J.mjs.map} +1 -1
- package/chunk-QZJECTZQ.mjs +2 -0
- package/{chunk-ZMWH4RA6.mjs.map → chunk-QZJECTZQ.mjs.map} +1 -1
- package/{chunk-MZP43FH7.mjs → chunk-R4YRPVUD.mjs} +2 -2
- package/{chunk-MZP43FH7.mjs.map → chunk-R4YRPVUD.mjs.map} +1 -1
- package/chunk-VJJNBNP2.js +2 -0
- package/{chunk-4SNO3QVC.js.map → chunk-VJJNBNP2.js.map} +1 -1
- package/chunk-WMEKSWX7.js +2 -0
- package/{chunk-5DVPBBOD.js.map → chunk-WMEKSWX7.js.map} +1 -1
- package/chunk-ZXBCSP2L.js +2 -0
- package/{chunk-D7CTAABP.js.map → chunk-ZXBCSP2L.js.map} +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/nonStaticVideoTag-CGE5567K.js +2 -0
- package/{nonStaticVideoTag-T4CIWREL.js.map → nonStaticVideoTag-CGE5567K.js.map} +1 -1
- package/{nonStaticVideoTag-RO6C2T36.mjs → nonStaticVideoTag-LEI3OS4G.mjs} +2 -2
- package/{nonStaticVideoTag-RO6C2T36.mjs.map → nonStaticVideoTag-LEI3OS4G.mjs.map} +1 -1
- package/package.json +1 -1
- package/staticPlayer-KE3BXILD.mjs +2 -0
- package/{staticPlayer-NXOOJTWO.mjs.map → staticPlayer-KE3BXILD.mjs.map} +1 -1
- package/staticPlayer-XP5433B2.js +2 -0
- package/{staticPlayer-DMILO6PN.js.map → staticPlayer-XP5433B2.js.map} +1 -1
- package/{staticVideoTag-IZI7PG7M.mjs → staticVideoTag-AUESR2OF.mjs} +2 -2
- package/{staticVideoTag-IZI7PG7M.mjs.map → staticVideoTag-AUESR2OF.mjs.map} +1 -1
- package/staticVideoTag-GZN2ANRV.js +2 -0
- package/{staticVideoTag-KT6PBJ7V.js.map → staticVideoTag-GZN2ANRV.js.map} +1 -1
- package/{touchVolumeBrightness-27EBEX5W.mjs → touchVolumeBrightness-EOA2JIOJ.mjs} +3 -3
- package/{touchVolumeBrightness-27EBEX5W.mjs.map → touchVolumeBrightness-EOA2JIOJ.mjs.map} +1 -1
- package/{touchVolumeBrightness-KAAGMQWI.js → touchVolumeBrightness-I4UWCQX6.js} +3 -3
- package/{touchVolumeBrightness-KAAGMQWI.js.map → touchVolumeBrightness-I4UWCQX6.js.map} +1 -1
- package/videoArea-D4BUXRIS.mjs +2 -0
- package/{videoArea-D5XF44HR.mjs.map → videoArea-D4BUXRIS.mjs.map} +1 -1
- package/videoArea-NJQ2YNRH.js +2 -0
- package/{videoArea-HORYPBAZ.js.map → videoArea-NJQ2YNRH.js.map} +1 -1
- package/vodPlayer-HJJHRCFP.js +2 -0
- package/{vodPlayer-VTPZZILH.js.map → vodPlayer-HJJHRCFP.js.map} +1 -1
- package/{vodPlayer-7IQILQHX.mjs → vodPlayer-ZWLHRYSH.mjs} +2 -2
- package/{vodPlayer-7IQILQHX.mjs.map → vodPlayer-ZWLHRYSH.mjs.map} +1 -1
- package/backwardForward-E2NLBMMH.js +0 -2
- package/backwardForward-N75PBTWN.mjs +0 -2
- package/chunk-4SNO3QVC.js +0 -2
- package/chunk-5DVPBBOD.js +0 -2
- package/chunk-BBWNG7HP.js +0 -2
- package/chunk-CIBMAE3N.js +0 -3
- package/chunk-D7CTAABP.js +0 -2
- package/chunk-HME64W2O.js.map +0 -1
- package/chunk-YZYTKWCY.mjs.map +0 -1
- package/chunk-ZMWH4RA6.mjs +0 -2
- package/nonStaticVideoTag-T4CIWREL.js +0 -2
- package/staticPlayer-DMILO6PN.js +0 -2
- package/staticPlayer-NXOOJTWO.mjs +0 -2
- package/staticVideoTag-KT6PBJ7V.js +0 -2
- package/videoArea-D5XF44HR.mjs +0 -2
- package/videoArea-HORYPBAZ.js +0 -2
- package/vodPlayer-VTPZZILH.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {P,
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {P,la,K}from'./chunk-FPUBUJN6.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';e();var f=()=>{let{params:r}=P.getState().videoData,t=la().currentTime;if(t!==0){let d=la().duration,i={video_id:+r.id,video_type:2,time:t===d?0:Math.floor(la().currentTime)},o=localStorage.getItem("viewedVideos");if(o){let e=JSON.parse(o);e=e.filter(n=>n.video_id!==i.video_id||n.video_type!==i.video_type),e.length<10||e.shift(),e.push(i),localStorage.setItem("viewedVideos",JSON.stringify(e));}else localStorage.setItem("viewedVideos",JSON.stringify([i]));}},g=()=>{let r=P.dispatch,{params:t}=P.getState().videoData,d=localStorage.getItem("viewedVideos");if(d){let o=JSON.parse(d).find(e=>e.video_id===Number(t.id)&&e.video_type===2);o&&r(K({time:o.time}));}};export{f as a,g as b};//# sourceMappingURL=chunk-4TQF43YU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-4TQF43YU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/user.actions.ts"],"names":["init_esm_shims","handleContinuousPlayback","params","store_default","currentTime","mainPlayerVideoTag","duration","viewedVideo","viewedVideosInLocalStorage","viewedVideos","video","handleApplyContinuousPlayback","dispatch","setVideoSettings"],"mappings":"+EAAAA,CAAAA,EAAAA,CAKO,IAAMC,CAAAA,CAA2B,IAAM,CAC1C,GAAM,CAAE,MAAA,CAAAC,CAAO,CAAA,CAAIC,EAAM,QAAA,EAAS,CAAE,SAAA,CAC9BC,CAAAA,CAAcC,IAAmB,CAAE,WAAA,CACzC,GAAID,CAAAA,GAAgB,EAAG,CACnB,IAAME,CAAAA,CAAWD,EAAAA,GAAqB,QAAA,CAChCE,CAAAA,CAA4B,CAC9B,QAAA,CAAU,CAACL,CAAAA,CAAO,EAAA,CAClB,UAAA,CAAY,CAAA,CACZ,KAAME,CAAAA,GAAgBE,CAAAA,CAAW,CAAA,CAAI,IAAA,CAAK,MAAMD,EAAAA,EAAmB,CAAE,WAAW,CACpF,EACIG,CAAAA,CAA6B,YAAA,CAAa,OAAA,CAAQ,cAAc,EACpE,GAAIA,CAAAA,CAA4B,CAC5B,IAAIC,EAA+B,IAAA,CAAK,KAAA,CAAMD,CAA0B,CAAA,CACxEC,EAAeA,CAAAA,CAAa,MAAA,CACvBC,CAAAA,EAAwBA,CAAAA,CAAM,WAAaH,CAAAA,CAAY,QAAA,EAAYG,CAAAA,CAAM,UAAA,GAAeH,EAAY,UACzG,CAAA,CACIE,CAAAA,CAAa,MAAA,CAAS,IAEtBA,CAAAA,CAAa,KAAA,EAAM,CACnBA,CAAAA,CAAa,IAAA,CAAKF,CAAW,CAAA,CAEjC,YAAA,CAAa,QAAQ,cAAA,CAAgB,IAAA,CAAK,SAAA,CAAUE,CAAY,CAAC,EACrE,CAAA,KAAO,YAAA,CAAa,OAAA,CAAQ,eAAgB,IAAA,CAAK,SAAA,CAAU,CAACF,CAAW,CAAC,CAAC,EAC7E,CACJ,CAAA,CAEaI,EAAgC,IAAM,CAC/C,IAAMC,CAAAA,CAAWT,EAAM,QAAA,CACjB,CAAE,MAAA,CAAAD,CAAO,EAAIC,CAAAA,CAAM,QAAA,EAAS,CAAE,SAAA,CAChCK,EAA6B,YAAA,CAAa,OAAA,CAAQ,cAAc,CAAA,CACpE,GAAIA,CAAAA,CAA4B,CAE5B,IAAMD,CAAAA,CAD+B,KAAK,KAAA,CAAMC,CAA0B,CAAA,CACzC,IAAA,CAC5BE,GAAwBA,CAAAA,CAAM,QAAA,GAAa,MAAA,CAAOR,CAAAA,CAAO,EAAE,CAAA,EAAKQ,CAAAA,CAAM,UAAA,GAAe,CAC1F,EAEIH,CAAAA,EAAaK,CAAAA,CAASC,CAAAA,CAAiB,CAAE,KAAMN,CAAAA,CAAY,IAAK,CAAC,CAAC,EAC1E,CACJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/user.actions.ts"],"names":["init_esm_shims","handleContinuousPlayback","params","store_default","currentTime","mainPlayerVideoTag","duration","viewedVideo","viewedVideosInLocalStorage","viewedVideos","video","handleApplyContinuousPlayback","dispatch","setVideoSettings"],"mappings":"+EAAAA,CAAAA,EAAAA,CAKO,IAAMC,CAAAA,CAA2B,IAAM,CAC1C,GAAM,CAAE,MAAA,CAAAC,CAAO,CAAA,CAAIC,EAAM,QAAA,EAAS,CAAE,SAAA,CAC9BC,CAAAA,CAAcC,IAAmB,CAAE,WAAA,CACzC,GAAID,CAAAA,GAAgB,EAAG,CACnB,IAAME,CAAAA,CAAWD,EAAAA,GAAqB,QAAA,CAChCE,CAAAA,CAA4B,CAC9B,QAAA,CAAU,CAACL,CAAAA,CAAO,EAAA,CAClB,UAAA,CAAY,CAAA,CACZ,KAAME,CAAAA,GAAgBE,CAAAA,CAAW,CAAA,CAAI,IAAA,CAAK,MAAMD,EAAAA,EAAmB,CAAE,WAAW,CACpF,EACIG,CAAAA,CAA6B,YAAA,CAAa,OAAA,CAAQ,cAAc,EACpE,GAAIA,CAAAA,CAA4B,CAC5B,IAAIC,EAA+B,IAAA,CAAK,KAAA,CAAMD,CAA0B,CAAA,CACxEC,EAAeA,CAAAA,CAAa,MAAA,CACvBC,CAAAA,EAAwBA,CAAAA,CAAM,WAAaH,CAAAA,CAAY,QAAA,EAAYG,CAAAA,CAAM,UAAA,GAAeH,EAAY,UACzG,CAAA,CACIE,CAAAA,CAAa,MAAA,CAAS,IAEtBA,CAAAA,CAAa,KAAA,EAAM,CACnBA,CAAAA,CAAa,IAAA,CAAKF,CAAW,CAAA,CAEjC,YAAA,CAAa,QAAQ,cAAA,CAAgB,IAAA,CAAK,SAAA,CAAUE,CAAY,CAAC,EACrE,CAAA,KAAO,YAAA,CAAa,OAAA,CAAQ,eAAgB,IAAA,CAAK,SAAA,CAAU,CAACF,CAAW,CAAC,CAAC,EAC7E,CACJ,CAAA,CAEaI,EAAgC,IAAM,CAC/C,IAAMC,CAAAA,CAAWT,EAAM,QAAA,CACjB,CAAE,MAAA,CAAAD,CAAO,EAAIC,CAAAA,CAAM,QAAA,EAAS,CAAE,SAAA,CAChCK,EAA6B,YAAA,CAAa,OAAA,CAAQ,cAAc,CAAA,CACpE,GAAIA,CAAAA,CAA4B,CAE5B,IAAMD,CAAAA,CAD+B,KAAK,KAAA,CAAMC,CAA0B,CAAA,CACzC,IAAA,CAC5BE,GAAwBA,CAAAA,CAAM,QAAA,GAAa,MAAA,CAAOR,CAAAA,CAAO,EAAE,CAAA,EAAKQ,CAAAA,CAAM,UAAA,GAAe,CAC1F,EAEIH,CAAAA,EAAaK,CAAAA,CAASC,CAAAA,CAAiB,CAAE,KAAMN,CAAAA,CAAY,IAAK,CAAC,CAAC,EAC1E,CACJ","file":"chunk-4TQF43YU.mjs","sourcesContent":["import { IViewedVideo } from \"../../interfaces/interfaces\";\r\nimport store from \"../store\";\r\nimport { setVideoSettings } from \"../slices/userSlice\";\r\nimport { mainPlayerVideoTag } from \"../../constants\";\r\n\r\nexport const handleContinuousPlayback = () => {\r\n const { params } = store.getState().videoData;\r\n const currentTime = mainPlayerVideoTag().currentTime;\r\n if (currentTime !== 0) {\r\n const duration = mainPlayerVideoTag().duration;\r\n const viewedVideo: IViewedVideo = {\r\n video_id: +params.id!,\r\n video_type: 2,\r\n time: currentTime === duration ? 0 : Math.floor(mainPlayerVideoTag().currentTime),\r\n };\r\n let viewedVideosInLocalStorage = localStorage.getItem(\"viewedVideos\");\r\n if (viewedVideosInLocalStorage) {\r\n let viewedVideos: IViewedVideo[] = JSON.parse(viewedVideosInLocalStorage);\r\n viewedVideos = viewedVideos.filter(\r\n (video: IViewedVideo) => video.video_id !== viewedVideo.video_id || video.video_type !== viewedVideo.video_type\r\n );\r\n if (viewedVideos.length < 10) viewedVideos.push(viewedVideo);\r\n else {\r\n viewedVideos.shift();\r\n viewedVideos.push(viewedVideo);\r\n }\r\n localStorage.setItem(\"viewedVideos\", JSON.stringify(viewedVideos));\r\n } else localStorage.setItem(\"viewedVideos\", JSON.stringify([viewedVideo]));\r\n }\r\n};\r\n\r\nexport const handleApplyContinuousPlayback = () => {\r\n const dispatch = store.dispatch;\r\n const { params } = store.getState().videoData;\r\n let viewedVideosInLocalStorage = localStorage.getItem(\"viewedVideos\");\r\n if (viewedVideosInLocalStorage) {\r\n const viewedVideos: IViewedVideo[] = JSON.parse(viewedVideosInLocalStorage);\r\n const viewedVideo = viewedVideos.find(\r\n (video: IViewedVideo) => video.video_id === Number(params.id) && video.video_type === 2\r\n );\r\n\r\n if (viewedVideo) dispatch(setVideoSettings({ time: viewedVideo.time }));\r\n }\r\n};\r\n\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
'use strict';var chunkHSAWK74H_js=require('./chunk-HSAWK74H.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),react=require('react'),reactRedux=require('react-redux');chunkWO4IQUGO_js.e();var y=()=>{let m=chunkHSAWK74H_js.ga(),{params:e}=chunkHSAWK74H_js.ha(({videoData:{params:t}})=>({params:t}),reactRedux.shallowEqual);react.useEffect(()=>{chunkHSAWK74H_js.fa("hasCurrentTimeParams")&&(chunkHSAWK74H_js.la().currentTime=e.currentTime,m(chunkHSAWK74H_js.c(e.currentTime)));},[e.currentTime]);},P=y;chunkWO4IQUGO_js.e();var h=()=>{let{details:m}=chunkHSAWK74H_js.ha(({videoData:{details:e}})=>({details:e}),reactRedux.shallowEqual);react.useEffect(()=>{let e=chunkHSAWK74H_js.la().getElementsByTagName("track");for(let t=0;t<e.length;t++)e[t].addEventListener("cuechange",p=>{let n=p.target.track,s;n.activeCues&&(s=n.activeCues[0]),s&&(setTimeout(()=>{let o=document.getElementById("subtitle-id");o&&(o.style.display="block");},300),s.onexit=()=>{let o=document.getElementById("subtitle-id");o&&(o.style.display="none");});});},[m.subtitles]);},H=h;exports.a=P;exports.b=H;//# sourceMappingURL=chunk-5HFX3MP2.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-5HFX3MP2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/hooks/useJumpToCurrentTime.tsx","../src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx"],"names":["init_cjs_shims","useJumpToCurrentTime","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","useEffect","conditions","mainPlayerVideoTag","setCurrentTime","useJumpToCurrentTime_default","useHideSubtitle","details","tracks","i","event","track","activeCue","el","useHideSubtitle_default"],"mappings":"0KAAAA,kBAAAA,EAAAA,CAQA,IAAMC,CAAAA,CAAuB,IAAM,CAC/B,IAAMC,CAAAA,CAAWC,qBAAe,CAC1B,CAAE,OAAAC,CAAO,CAAA,CAAIC,mBAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,OAAAD,CAAO,CAAE,KAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAE3FC,eAAAA,CAAU,IAAM,CACRC,mBAAAA,CAAAA,sBAA6C,IA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"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/hooks/useJumpToCurrentTime.tsx","../src/videoPlayerLibrary/helpers/hooks/useHideSubtitle.tsx"],"names":["init_cjs_shims","useJumpToCurrentTime","dispatch","useAppDispatch","params","useAppSelector","shallowEqual","useEffect","conditions","mainPlayerVideoTag","setCurrentTime","useJumpToCurrentTime_default","useHideSubtitle","details","tracks","i","event","track","activeCue","el","useHideSubtitle_default"],"mappings":"0KAAAA,kBAAAA,EAAAA,CAQA,IAAMC,CAAAA,CAAuB,IAAM,CAC/B,IAAMC,CAAAA,CAAWC,qBAAe,CAC1B,CAAE,OAAAC,CAAO,CAAA,CAAIC,mBAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,OAAAD,CAAO,CAAE,KAAO,CAAE,MAAA,CAAAA,CAAO,CAAA,CAAA,CAAIE,uBAAY,CAAA,CAE3FC,eAAAA,CAAU,IAAM,CACRC,mBAAAA,CAAAA,sBAA6C,IAC/CC,mBAAAA,EAAmB,CAAE,WAAA,CAAcL,CAAAA,CAAO,YAC1CF,CAAAA,CAASQ,kBAAAA,CAAeN,EAAO,WAAY,CAAC,GAElD,CAAA,CAAG,CAACA,CAAAA,CAAO,WAAW,CAAC,EAC3B,CAAA,CAEOO,EAAQV,ECpBfD,kBAAAA,EAAAA,KAKMY,CAAAA,CAAkB,IAAM,CAE1B,GAAM,CAAE,OAAA,CAAAC,CAAQ,EAAIR,mBAAAA,CAAe,CAAC,CAAE,SAAA,CAAW,CAAE,QAAAQ,CAAQ,CAAE,CAAA,IAAO,CAAC,QAAAA,CAAO,CAAA,CAAA,CAAGP,uBAAY,CAAA,CAE3FC,eAAAA,CAAU,IAAM,CACZ,IAAMO,CAAAA,CAASL,mBAAAA,GAAqB,oBAAA,CAAqB,OAAO,EAChE,IAAA,IAASM,CAAAA,CAAI,EAAGA,CAAAA,CAAID,CAAAA,CAAO,MAAA,CAAQC,CAAAA,EAAAA,CAC/BD,EAAOC,CAAC,CAAA,CAAE,iBAAiB,WAAA,CAAcC,CAAAA,EAAU,CAC/C,IAAMC,CAAAA,CAASD,CAAAA,CAAM,MAAA,CAAgB,MACjCE,CAAAA,CACAD,CAAAA,CAAM,aAAYC,CAAAA,CAAYD,CAAAA,CAAM,WAAW,CAAC,CAAA,CAAA,CAChDC,CAAAA,GACA,UAAA,CAAW,IAAM,CACb,IAAMC,EAAK,QAAA,CAAS,cAAA,CAAe,aAAa,CAAA,CAC5CA,CAAAA,GAAIA,CAAAA,CAAG,KAAA,CAAM,QAAU,OAAA,EAC/B,CAAA,CAAG,GAAG,CAAA,CAEND,CAAAA,CAAU,OAAS,IAAM,CACrB,IAAMC,CAAAA,CAAK,SAAS,cAAA,CAAe,aAAa,EAC5CA,CAAAA,GAAIA,CAAAA,CAAG,MAAM,OAAA,CAAU,MAAA,EAC/B,GAER,CAAC,EAET,EAAG,CAACN,CAAAA,CAAQ,SAAU,CAAC,EAC3B,EAEOO,CAAAA,CAAQR","file":"chunk-5HFX3MP2.js","sourcesContent":["import { useEffect } from \"react\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { setCurrentTime } from \"../redux/slices/controllerSlice\";\r\nimport { shallowEqual } from \"react-redux\";\r\n\r\nconst useJumpToCurrentTime = () => {\r\n const dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.hasCurrentTimeParams)) {\r\n mainPlayerVideoTag().currentTime = params.currentTime!;\r\n dispatch(setCurrentTime(params.currentTime!));\r\n }\r\n }, [params.currentTime]);\r\n}\r\n\r\nexport default useJumpToCurrentTime;","import { useEffect } from \"react\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\n\r\nconst useHideSubtitle = () => {\r\n\r\n const { details } = useAppSelector(({ videoData: { details } }) => ({details}),shallowEqual);\r\n\r\n useEffect(() => {\r\n const tracks = mainPlayerVideoTag().getElementsByTagName(\"track\");\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].addEventListener(\"cuechange\", (event) => {\r\n const track = (event.target! as any).track;\r\n let activeCue: any;\r\n if (track.activeCues) activeCue = track.activeCues[0];\r\n if (activeCue) {\r\n setTimeout(() => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"block\";\r\n }, 300);\r\n\r\n activeCue.onexit = () => {\r\n const el = document.getElementById(\"subtitle-id\");\r\n if (el) el.style.display = \"none\";\r\n };\r\n }\r\n });\r\n }\r\n }, [details.subtitles!]);\r\n}\r\n\r\nexport default useHideSubtitle;"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {f as f$1,g,d as d$1,j}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {f as f$1,g,d as d$1,j}from'./chunk-QZJECTZQ.mjs';import {fa,ha,ga,f,P,ka,va,J,h,ta}from'./chunk-FPUBUJN6.mjs';import {a}from'./chunk-TM66GJCG.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {useState,useEffect,useRef}from'react';import {shallowEqual}from'react-redux';import {jsx,jsxs}from'react/jsx-runtime';import q from'next/legacy/image';e();e();var k=({title:l,className:o})=>jsx("span",{className:`pl-absolute pl-w-max pl-bg-paper pl-text-white/[0.9] ${fa("isFullScreen")?"pl-bottom-[300%]":"pl-bottom-[270%]"} pl-rounded-[8px] pl-text-[10px] pl-px-4 pl-py-[13px] pl-font-normal ${o}`,children:l}),d=k;var z=()=>{let{isFullScreen:l}=ha(({controller:{firstPlay:p,isFullScreen:h}})=>({firstPlay:p,isFullScreen:h}),shallowEqual),[o,a$1]=useState(false),r=ga();return useEffect(()=>{fa("isFirstPlay")||r(f(false));},[l]),jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(q,{src:fa("isFullScreen")?a.nonFullScreen:a.fullScreen,alt:"fullScreen-icon",className:"pl-cursor-pointer",width:20,height:20,onMouseOver:()=>!fa("isTouchScreen")&&a$1(true),onMouseLeave:()=>!fa("isTouchScreen")&&a$1(false),onClick:()=>{f$1(),g();},id:fa("isFullScreen")?"exit-full-s":"full-s"}),o&&jsx(d,{title:`${fa("isFullScreen")?"\u062E\u0631\u0648\u062C \u0627\u0632":""} \u062A\u0645\u0627\u0645 \u0635\u0641\u062D\u0647`})]})},ue=z;e();var H=()=>{let[l,o]=useState(false),a$1=ga(),{settings:r}=ha(({user:{settings:t}})=>({settings:t}),shallowEqual),p=useRef(r.volume),h=()=>{if(p.current!==r.volume){let{settings:t}=P.getState().user;ka(va(p.current,t.volume)),p.current=t.volume,a$1(J({...t,volume:t.volume}));}},b=t=>{let{settings:C}=P.getState().user;t==="mute"?(d$1(0),ka(va(C.volume,0))):(ka(va(C.volume,100)),d$1(100));};return jsxs("div",{className:"pl-relative pl-inline-flex pl-items-center pl-gap-2 pl-sound-icon",children:[!fa("isTouchScreen")&&jsx("input",{onMouseUp:h,type:"range",min:"0",max:"100",value:r.volume,onChange:t=>d$1(+t.target.value),className:"pl-soundVolume pl-cursor-pointer rounded-full",style:{background:`linear-gradient(to right, white ${r.volume}%, rgba(255,255,255,0.3) 0)`}}),jsxs("div",{className:"pl-relative pl-flex pl-items-center",children:[jsx(q,{src:fa("hasSound")?a.unMute:a.mute,alt:fa("hasSound")?"unmute-icon":"mute-icon",className:"pl-flex pl-items-center pl-cursor-pointer",width:20,height:20,onClick:()=>fa("hasSound")?b("mute"):b("unmute"),onDoubleClick:t=>t.stopPropagation(),onMouseOver:()=>!fa("isTouchScreen")&&o(true),onMouseLeave:()=>!fa("isTouchScreen")&&o(false),id:fa("hasSound")?"mute":"unmute"}),l&&jsx(d,{className:"pl-left-0",title:fa("hasSound")?"\u0635\u062F\u0627":"\u0628\u06CC\u200C\u0635\u062F\u0627"})]})]})},Te=H;e();var Q=()=>{let l=ga();ha(({videoData:{params:o}})=>({params:o}),shallowEqual),useEffect(()=>{let o=()=>{document.fullscreenElement?l(h(true)):(l(h(false)),j(),ka(ta("exitFullScreen")),document.body.style.overflow="auto");};document.addEventListener&&(document.addEventListener("webkitfullscreenchange",o,false),document.addEventListener("mozfullscreenchange",o,false),document.addEventListener("fullscreenchange",o,false),document.addEventListener("MSFullscreenChange",o,false));},[]);},qe=Q;export{d as a,ue as b,Te as c,qe as d};//# sourceMappingURL=chunk-6V7Y4FV6.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-6V7Y4FV6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/fullScreen/fullScreen.tsx","../src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbarTooltip.tsx","../src/videoPlayerLibrary/components/custom-components/soundVolume/soundVolume.tsx","../src/videoPlayerLibrary/helpers/hooks/useFullScreen.tsx"],"names":["init_esm_shims","ControllbarTooltip","title","className","jsx","conditions","controllbarTooltip_default","FullScreen","isFullScreen","useAppSelector","firstPlay","shallowEqual","showTooltip","setShowTooltip","useState","dispatch","useAppDispatch","useEffect","setActiveElements","jsxs","Image","importImages_default","handleFullScreen","handleLockOrientation","fullScreen_default","SoundVolume","settings","primaryVolumeRef","useRef","handleMouseUp","store_default","sendFluentLog","volumeLog","setUserSettings","handleMute","type","handleChangeSoundVolume","event","soundVolume_default","useFullScreen","params","handleChangeFullScreen","setIsFullScreen","handleVideoElementSizeInfo","fullscreenLog","useFullScreen_default"],"mappings":"+VAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAIA,IAAMC,CAAAA,CAAqB,CAAC,CAAE,KAAA,CAAAC,CAAAA,CAAO,SAAA,CAAAC,CAAU,CAAA,GAC3CC,GAAAA,CAAC,MAAA,CAAA,CACG,SAAA,CAAW,CAAA,qDAAA,EAAwDC,EAA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AS,gBAAA,CAAiB,wBAAA,CAA0BH,CAAAA,CAAwB,KAAK,CAAA,CACjF,QAAA,CAAS,gBAAA,CAAiB,qBAAA,CAAuBA,CAAAA,CAAwB,KAAK,CAAA,CAC9E,QAAA,CAAS,gBAAA,CAAiB,kBAAA,CAAoBA,CAAAA,CAAwB,KAAK,CAAA,CAC3E,QAAA,CAAS,gBAAA,CAAiB,oBAAA,CAAsBA,CAAAA,CAAwB,KAAK,CAAA,EASjF,CAAA,CAAG,EAAE,EACP,EAEOI,EAAAA,CAAQN","file":"chunk-SUV7NR2J.mjs","sourcesContent":["import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst FullScreen = () => {\r\n const { isFullScreen } = useAppSelector(({ controller: { firstPlay, isFullScreen } }) => ({ firstPlay, isFullScreen }), shallowEqual);\r\n\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const dispatch = useAppDispatch();\r\n\r\n useEffect(() => {\r\n if (!conditions(ConditionName.isFirstPlay)) dispatch(setActiveElements(false));\r\n }, [isFullScreen]);\r\n\r\n return (\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n <Image\r\n src={conditions(ConditionName.isFullScreen) ? IMAGES.nonFullScreen : IMAGES.fullScreen}\r\n alt=\"fullScreen-icon\"\r\n className={`pl-cursor-pointer`}\r\n width={20}\r\n height={20}\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n onClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n id={conditions(ConditionName.isFullScreen) ? \"exit-full-s\" : \"full-s\"}\r\n />\r\n {showTooltip && (\r\n <ControllbarTooltip\r\n title={`${conditions(ConditionName.isFullScreen) ? \"خروج از\" : \"\"} تمام صفحه`}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default FullScreen;\r\n","import { conditions } from \"../../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../../helpers/interfaces/enums\";\r\nimport { IControllbarTooltipProps } from \"../../../../helpers/interfaces/interfaces\";\r\n\r\nconst ControllbarTooltip = ({ title, className }: IControllbarTooltipProps) => (\r\n <span\r\n className={`pl-absolute pl-w-max pl-bg-paper pl-text-white/[0.9] ${conditions(ConditionName.isFullScreen) ? \"pl-bottom-[300%]\" : \"pl-bottom-[270%]\"} pl-rounded-[8px] pl-text-[10px] pl-px-4 pl-py-[13px] pl-font-normal ${className}`}\r\n >\r\n {title}\r\n </span>\r\n);\r\n\r\nexport default ControllbarTooltip;\r\n","import { useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\nimport Image from \"next/legacy/image\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { handleChangeSoundVolume } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst SoundVolume = () => {\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryVolumeRef = useRef<number>(settings.volume);\r\n\r\n const handleMouseUp = () => {\r\n if (primaryVolumeRef.current !== settings.volume) {\r\n const { settings } = store.getState().user;\r\n sendFluentLog(volumeLog(primaryVolumeRef.current, settings.volume));\r\n primaryVolumeRef.current = settings.volume;\r\n // createSettings({ ...settings, volume: settings.volume });\r\n dispatch(setUserSettings({ ...settings, volume: settings.volume }));\r\n }\r\n };\r\n\r\n const handleMute = (type: string) => {\r\n const { settings } = store.getState().user;\r\n if (type === \"mute\") {\r\n handleChangeSoundVolume(0);\r\n sendFluentLog(volumeLog(settings.volume, 0));\r\n // createSettings({ ...settings, volume: 0 });\r\n } else {\r\n sendFluentLog(volumeLog(settings.volume, 100));\r\n handleChangeSoundVolume(100);\r\n // createSettings({ ...settings, volume: 100 });\r\n }\r\n };\r\n\r\n return (\r\n <div className={`pl-relative pl-inline-flex pl-items-center pl-gap-2 pl-sound-icon`}>\r\n {!conditions(ConditionName.isTouchScreen) && (\r\n <input\r\n onMouseUp={handleMouseUp}\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"100\"\r\n value={settings.volume}\r\n onChange={(event) => handleChangeSoundVolume(+event.target.value)}\r\n className=\"pl-soundVolume pl-cursor-pointer rounded-full\"\r\n style={{ background: `linear-gradient(to right, white ${settings.volume}%, rgba(255,255,255,0.3) 0)` }}\r\n />\r\n )}\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n <Image\r\n src={conditions(ConditionName.hasSound) ? IMAGES.unMute : IMAGES.mute}\r\n alt={conditions(ConditionName.hasSound) ? \"unmute-icon\" : \"mute-icon\"}\r\n className={`pl-flex pl-items-center pl-cursor-pointer`}\r\n width={20}\r\n height={20}\r\n onClick={() => (conditions(ConditionName.hasSound) ? handleMute(\"mute\") : handleMute(\"unmute\"))}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n id={conditions(ConditionName.hasSound) ? \"mute\" : \"unmute\"}\r\n />\r\n {showTooltip && (\r\n <ControllbarTooltip\r\n className=\"pl-left-0\"\r\n title={conditions(ConditionName.hasSound) ? \"صدا\" : \"بیصدا\"}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SoundVolume;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { setIsFullScreen } from \"../redux/slices/controllerSlice\";\r\nimport { handleVideoElementSizeInfo } from \"../redux/actions/controller.actions\";\r\nimport { fullscreenLog } from \"../logs/logs\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\n\r\nconst useFullScreen = () => {\r\n const dispatch = useAppDispatch();\r\n useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n\r\n useEffect(() => {\r\n const handleChangeFullScreen = () => {\r\n const isFullScreen = document.fullscreenElement;\r\n\r\n if (isFullScreen) dispatch(setIsFullScreen(true));\r\n else {\r\n dispatch(setIsFullScreen(false));\r\n handleVideoElementSizeInfo();\r\n sendFluentLog(fullscreenLog(\"exitFullScreen\"));\r\n document.body.style.overflow = \"auto\"\r\n }\r\n };\r\n\r\n if (document.addEventListener) {\r\n document.addEventListener(\"webkitfullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"mozfullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"fullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"MSFullscreenChange\", handleChangeFullScreen, false);\r\n }\r\n\r\n () => {\r\n document.removeEventListener(\"webkitfullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"mozfullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"fullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"MSFullscreenChange\", handleChangeFullScreen, false);\r\n };\r\n }, []);\r\n};\r\n\r\nexport default useFullScreen;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/fullScreen/fullScreen.tsx","../src/videoPlayerLibrary/components/custom-components/footer/controllbar/controllbarTooltip.tsx","../src/videoPlayerLibrary/components/custom-components/soundVolume/soundVolume.tsx","../src/videoPlayerLibrary/helpers/hooks/useFullScreen.tsx"],"names":["init_esm_shims","ControllbarTooltip","title","className","jsx","conditions","controllbarTooltip_default","FullScreen","isFullScreen","useAppSelector","firstPlay","shallowEqual","showTooltip","setShowTooltip","useState","dispatch","useAppDispatch","useEffect","setActiveElements","jsxs","Image","importImages_default","handleFullScreen","handleLockOrientation","fullScreen_default","SoundVolume","settings","primaryVolumeRef","useRef","handleMouseUp","store_default","sendFluentLog","volumeLog","setUserSettings","handleMute","type","handleChangeSoundVolume","event","soundVolume_default","useFullScreen","params","handleChangeFullScreen","setIsFullScreen","handleVideoElementSizeInfo","fullscreenLog","useFullScreen_default"],"mappings":"+VAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAIA,IAAMC,CAAAA,CAAqB,CAAC,CAAE,KAAA,CAAAC,CAAAA,CAAO,SAAA,CAAAC,CAAU,CAAA,GAC3CC,GAAAA,CAAC,MAAA,CAAA,CACG,SAAA,CAAW,CAAA,qDAAA,EAAwDC,EAAAA,CAAAA,cAAqC,CAAA,CAAI,kBAAA,CAAqB,kBAAkB,CAAA,qEAAA,EAAwEF,CAAS,CAAA,CAAA,CAEnO,QAAA,CAAAD,CAAAA,CACL,CAAA,CAGGI,CAAAA,CAAQL,EDDf,IAAMM,CAAAA,CAAa,IAAM,CACrB,GAAM,CAAE,YAAA,CAAAC,CAAa,CAAA,CAAIC,EAAAA,CAAe,CAAC,CAAE,WAAY,CAAE,SAAA,CAAAC,CAAAA,CAAW,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AAG,EAAE,EACP,EAEOI,EAAAA,CAAQN","file":"chunk-6V7Y4FV6.mjs","sourcesContent":["import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst FullScreen = () => {\r\n const { isFullScreen } = useAppSelector(({ controller: { firstPlay, isFullScreen } }) => ({ firstPlay, isFullScreen }), shallowEqual);\r\n\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const dispatch = useAppDispatch();\r\n\r\n useEffect(() => {\r\n if (!conditions(ConditionName.isFirstPlay)) dispatch(setActiveElements(false));\r\n }, [isFullScreen]);\r\n\r\n return (\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n <Image\r\n src={conditions(ConditionName.isFullScreen) ? IMAGES.nonFullScreen : IMAGES.fullScreen}\r\n alt=\"fullScreen-icon\"\r\n className={`pl-cursor-pointer`}\r\n width={20}\r\n height={20}\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n onClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n id={conditions(ConditionName.isFullScreen) ? \"exit-full-s\" : \"full-s\"}\r\n />\r\n {showTooltip && (\r\n <ControllbarTooltip\r\n title={`${conditions(ConditionName.isFullScreen) ? \"خروج از\" : \"\"} تمام صفحه`}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default FullScreen;\r\n","import { conditions } from \"../../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../../helpers/interfaces/enums\";\r\nimport { IControllbarTooltipProps } from \"../../../../helpers/interfaces/interfaces\";\r\n\r\nconst ControllbarTooltip = ({ title, className }: IControllbarTooltipProps) => (\r\n <span\r\n className={`pl-absolute pl-w-max pl-bg-paper pl-text-white/[0.9] ${conditions(ConditionName.isFullScreen) ? \"pl-bottom-[300%]\" : \"pl-bottom-[270%]\"} pl-rounded-[8px] pl-text-[10px] pl-px-4 pl-py-[13px] pl-font-normal ${className}`}\r\n >\r\n {title}\r\n </span>\r\n);\r\n\r\nexport default ControllbarTooltip;\r\n","import { useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\nimport Image from \"next/legacy/image\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport store from \"../../../helpers/redux/store\";\r\nimport { volumeLog } from \"../../../helpers/logs/logs\";\r\nimport { sendFluentLog } from \"../../../helpers/logs/fluentdLogger\";\r\nimport { setUserSettings } from \"../../../helpers/redux/slices/userSlice\";\r\nimport { handleChangeSoundVolume } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport IMAGES from \"../../../images/importImages\";\r\n\r\nconst SoundVolume = () => {\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const dispatch = useAppDispatch();\r\n const { settings } = useAppSelector(({ user: { settings } }) => ({ settings }), shallowEqual);\r\n\r\n const primaryVolumeRef = useRef<number>(settings.volume);\r\n\r\n const handleMouseUp = () => {\r\n if (primaryVolumeRef.current !== settings.volume) {\r\n const { settings } = store.getState().user;\r\n sendFluentLog(volumeLog(primaryVolumeRef.current, settings.volume));\r\n primaryVolumeRef.current = settings.volume;\r\n // createSettings({ ...settings, volume: settings.volume });\r\n dispatch(setUserSettings({ ...settings, volume: settings.volume }));\r\n }\r\n };\r\n\r\n const handleMute = (type: string) => {\r\n const { settings } = store.getState().user;\r\n if (type === \"mute\") {\r\n handleChangeSoundVolume(0);\r\n sendFluentLog(volumeLog(settings.volume, 0));\r\n // createSettings({ ...settings, volume: 0 });\r\n } else {\r\n sendFluentLog(volumeLog(settings.volume, 100));\r\n handleChangeSoundVolume(100);\r\n // createSettings({ ...settings, volume: 100 });\r\n }\r\n };\r\n\r\n return (\r\n <div className={`pl-relative pl-inline-flex pl-items-center pl-gap-2 pl-sound-icon`}>\r\n {!conditions(ConditionName.isTouchScreen) && (\r\n <input\r\n onMouseUp={handleMouseUp}\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"100\"\r\n value={settings.volume}\r\n onChange={(event) => handleChangeSoundVolume(+event.target.value)}\r\n className=\"pl-soundVolume pl-cursor-pointer rounded-full\"\r\n style={{ background: `linear-gradient(to right, white ${settings.volume}%, rgba(255,255,255,0.3) 0)` }}\r\n />\r\n )}\r\n <div className=\"pl-relative pl-flex pl-items-center\">\r\n <Image\r\n src={conditions(ConditionName.hasSound) ? IMAGES.unMute : IMAGES.mute}\r\n alt={conditions(ConditionName.hasSound) ? \"unmute-icon\" : \"mute-icon\"}\r\n className={`pl-flex pl-items-center pl-cursor-pointer`}\r\n width={20}\r\n height={20}\r\n onClick={() => (conditions(ConditionName.hasSound) ? handleMute(\"mute\") : handleMute(\"unmute\"))}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n id={conditions(ConditionName.hasSound) ? \"mute\" : \"unmute\"}\r\n />\r\n {showTooltip && (\r\n <ControllbarTooltip\r\n className=\"pl-left-0\"\r\n title={conditions(ConditionName.hasSound) ? \"صدا\" : \"بیصدا\"}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SoundVolume;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../redux/hooks\";\r\nimport { setIsFullScreen } from \"../redux/slices/controllerSlice\";\r\nimport { handleVideoElementSizeInfo } from \"../redux/actions/controller.actions\";\r\nimport { fullscreenLog } from \"../logs/logs\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\n\r\nconst useFullScreen = () => {\r\n const dispatch = useAppDispatch();\r\n useAppSelector(({ videoData: { params } }) => ({ params }), shallowEqual);\r\n\r\n useEffect(() => {\r\n const handleChangeFullScreen = () => {\r\n const isFullScreen = document.fullscreenElement;\r\n\r\n if (isFullScreen) dispatch(setIsFullScreen(true));\r\n else {\r\n dispatch(setIsFullScreen(false));\r\n handleVideoElementSizeInfo();\r\n sendFluentLog(fullscreenLog(\"exitFullScreen\"));\r\n document.body.style.overflow = \"auto\"\r\n }\r\n };\r\n\r\n if (document.addEventListener) {\r\n document.addEventListener(\"webkitfullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"mozfullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"fullscreenchange\", handleChangeFullScreen, false);\r\n document.addEventListener(\"MSFullscreenChange\", handleChangeFullScreen, false);\r\n }\r\n\r\n () => {\r\n document.removeEventListener(\"webkitfullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"mozfullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"fullscreenchange\", handleChangeFullScreen, false);\r\n document.removeEventListener(\"MSFullscreenChange\", handleChangeFullScreen, false);\r\n };\r\n }, []);\r\n};\r\n\r\nexport default useFullScreen;\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {P,Ga,X as X$1,Z,M,u,v as v$1,fa,r,T as T$1,
|
|
2
|
-
export{W as a,X as b};//# sourceMappingURL=chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {P,Ga,X as X$1,Z,M,u,v as v$1,fa,r,T as T$1,la,A as A$1,ka,Da,ja}from'./chunk-FPUBUJN6.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import P$1 from'axios';e();e();var k=t=>{let{params:e}=P.getState().videoData;return ja().vod.getVodUrl+(t||e.id)},n={url:"",maxRetryCount:0,headers:{},retryPolicy:[],errorCallback:void 0},A=t=>(n.url=k(t),n.maxRetryCount=3,n.retryPolicy=[{codeAbove:500,codeBelow:null,excludeCodes:[],includeCodes:[409],delay:1,count:3},{codeAbove:null,codeBelow:404,excludeCodes:[403,402,401,400],includeCodes:[],delay:10,count:6}],n),w=t=>(A(t),n);var W=async t=>{let e=P.dispatch;try{let o=await Ga({...w(t)});if(X$1(o.status)){if(await P$1.head("https://"+Z(o.data.hls_links)+o.data.path),t)return e(M(o.data));v(o.data);}else throw new Error(JSON.stringify({status:o.status,message:o.data}))}catch{e(u(true)),e(v$1(false));}},v=async t=>{let e=P.dispatch,{params:o}=P.getState().videoData,s=await T(fa("hasSubtitlesInParams")?o.subtitles:t.subtitles);e(r({...t,subtitles:s,stream_link:!!t.stream_link&&T$1("https://"+Z(t.hls_links)+t.path)})),e(u(true)),e(v$1(true));},X=()=>{let t=P.dispatch,{subtitles:e,selectedSubtitle:o}=P.getState().videoData,s=e.find(a=>a.language==="fa");o?(Object.values(la().textTracks).find(a=>a.mode==="showing").mode="disabled",t(A$1(void 0)),ka(Da("empty"))):s?(s.mode="showing",t(A$1(s)),ka(Da(s.language))):(la().textTracks[0].mode="showing",t(A$1(la().textTracks[0])),ka(Da(la().textTracks[0].language)));},T=async t=>{let e=t.map(async s=>{try{return (await fetch(s.url,{method:"HEAD"})).ok?s:null}catch(a){return console.error("Error fetching subtitle:",s.url,a),null}});return (await Promise.all(e)).filter(s=>s!==null)};
|
|
2
|
+
export{W as a,X as b,T as c};//# sourceMappingURL=chunk-A2WOHDUE.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-A2WOHDUE.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts","../src/videoPlayerLibrary/helpers/getDetailsConfigs.ts"],"names":["init_esm_shims","detailAPI","id","params","store_default","API","detailsConfig","vodDetailsConfig","videoId","handleDetailsConfig","getVodDetails","dispatch","d","apiCaller","responseValidator","axios","weighted_random","setDetailsMiniPlayer","detailSetter","setIsFetchDetails","setIsValidAddress","data","validSubtitles","filterValidSubtitles","conditions","setInfo","addUuidToSrc","handleSubtitle","subtitles","selectedSubtitle","faSubtitle","subtitle","mainPlayerVideoTag","textTrack","setSelectedSubtitle","sendFluentLog","subtitleLog","checks","err"],"mappings":"+JAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAIO,IAAMC,CAAAA,CAAaC,CAAAA,EAAgB,CACtC,GAAM,CAAE,OAAAC,CAAO,CAAA,CAAIC,EAAM,QAAA,EAAS,CAAE,UACpC,OAAOC,EAAAA,GAAM,GAAA,CAAI,SAAA,EAAaH,GAAUC,CAAAA,CAAO,EAAA,CACnD,EAEMG,CAAAA,CAAgC,CAClC,IAAK,EAAA,CACL,aAAA,CAAe,EACf,OAAA,CAAS,GACT,WAAA,CAAa,GACb,aAAA,CAAe,MACnB,EAEMC,CAAAA,CAAoBC,CAAAA,GACtBF,EAAc,GAAA,CAAML,CAAAA,CAAUO,CAAO,CAAA,CACrCF,CAAAA,CAAc,cAAgB,CAAA,CAC9BA,CAAAA,CAAc,YAAc,CACxB,CACI,UAAW,GAAA,CACX,SAAA,CAAW,KACX,YAAA,CAAc,GACd,YAAA,CAAc,CAAC,GAAG,CAAA,CAClB,KAAA,CAAO,EACP,KAAA,CAAO,CACX,EACA,CACI,SAAA,CAAW,KACX,SAAA,CAAW,GAAA,CACX,aAAc,CAAC,GAAA,CAAK,IAAK,GAAA,CAAK,GAAG,EACjC,YAAA,CAAc,GACd,KAAA,CAAO,EAAA,CACP,MAAO,CACX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GAAAA,CAAa,UAAA,CAAaV,EAAgBK,CAAAA,CAAK,SAAS,EAAIA,CAAAA,CAAK,IAAI,CACzE,CAAC,CACH,EACAV,CAAAA,CAASQ,CAAAA,CAAkB,IAAI,CAAC,CAAA,CAChCR,EAASS,GAAAA,CAAkB,IAAI,CAAC,EAClC,CAAA,CAEaO,EAAiB,IAAM,CAClC,IAAMhB,CAAAA,CAAWP,CAAAA,CAAM,SACjB,CAAE,SAAA,CAAAwB,EAAW,gBAAA,CAAAC,CAAiB,EAAIzB,CAAAA,CAAM,QAAA,GAAW,SAAA,CAEnD0B,CAAAA,CAAkBF,EAAU,IAAA,CAC/BG,CAAAA,EAAkBA,EAAS,QAAA,GAAa,IAC3C,EACIF,CAAAA,EACF,MAAA,CAAO,OAAOG,EAAAA,EAAmB,CAAE,UAAU,CAAA,CAAE,IAAA,CAC5CC,GAAmBA,CAAAA,CAAU,IAAA,GAAS,SACzC,CAAA,CAAG,IAAA,CAAO,WACVtB,CAAAA,CAASuB,GAAAA,CAAoB,MAAS,CAAC,CAAA,CACvCC,EAAAA,CAAcC,GAAY,OAAO,CAAC,GAE9BN,CAAAA,EACFA,CAAAA,CAAW,KAAO,SAAA,CAClBnB,CAAAA,CAASuB,IAAoBJ,CAAU,CAAC,EACxCK,EAAAA,CAAcC,EAAAA,CAAYN,EAAW,QAAQ,CAAC,IAE9CE,EAAAA,EAAmB,CAAE,WAAW,CAAC,CAAA,CAAE,KAAO,SAAA,CAC1CrB,CAAAA,CAASuB,IAAoBF,EAAAA,EAAmB,CAAE,WAAW,CAAC,CAAC,CAAC,CAAA,CAChEG,EAAAA,CAAcC,GAAYJ,EAAAA,EAAmB,CAAE,WAAW,CAAC,CAAA,CAAE,QAAQ,CAAC,CAAA,EAG5E,CAAA,
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts","../src/videoPlayerLibrary/helpers/getDetailsConfigs.ts"],"names":["init_esm_shims","detailAPI","id","params","store_default","API","detailsConfig","vodDetailsConfig","videoId","handleDetailsConfig","getVodDetails","dispatch","d","apiCaller","responseValidator","axios","weighted_random","setDetailsMiniPlayer","detailSetter","setIsFetchDetails","setIsValidAddress","data","validSubtitles","filterValidSubtitles","conditions","setInfo","addUuidToSrc","handleSubtitle","subtitles","selectedSubtitle","faSubtitle","subtitle","mainPlayerVideoTag","textTrack","setSelectedSubtitle","sendFluentLog","subtitleLog","checks","err"],"mappings":"+JAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAIO,IAAMC,CAAAA,CAAaC,CAAAA,EAAgB,CACtC,GAAM,CAAE,OAAAC,CAAO,CAAA,CAAIC,EAAM,QAAA,EAAS,CAAE,UACpC,OAAOC,EAAAA,GAAM,GAAA,CAAI,SAAA,EAAaH,GAAUC,CAAAA,CAAO,EAAA,CACnD,EAEMG,CAAAA,CAAgC,CAClC,IAAK,EAAA,CACL,aAAA,CAAe,EACf,OAAA,CAAS,GACT,WAAA,CAAa,GACb,aAAA,CAAe,MACnB,EAEMC,CAAAA,CAAoBC,CAAAA,GACtBF,EAAc,GAAA,CAAML,CAAAA,CAAUO,CAAO,CAAA,CACrCF,CAAAA,CAAc,cAAgB,CAAA,CAC9BA,CAAAA,CAAc,YAAc,CACxB,CACI,UAAW,GAAA,CACX,SAAA,CAAW,KACX,YAAA,CAAc,GACd,YAAA,CAAc,CAAC,GAAG,CAAA,CAClB,KAAA,CAAO,EACP,KAAA,CAAO,CACX,EACA,CACI,SAAA,CAAW,KACX,SAAA,CAAW,GAAA,CACX,aAAc,CAAC,GAAA,CAAK,IAAK,GAAA,CAAK,GAAG,EACjC,YAAA,CAAc,GACd,KAAA,CAAO,EAAA,CACP,MAAO,CACX,CACJ,CAAA,CACOA,CAAAA,CAAAA,CAIEG,CAAAA,CAAuBD,CAAAA,GAChCD,EAAiBC,CAAO,CAAA,CACjBF,GDnBJ,IAAMI,CAAAA,CAAgB,MAAOF,CAAAA,EAAqB,CACvD,IAAMG,CAAAA,CA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,CAAS,IAAKO,CAAG,CAAA,CACpD,IACT,CACF,CAAC,EAGD,OAAA,CADgB,MAAM,QAAQ,GAAA,CAAID,CAAM,GACzB,MAAA,CAAQ,CAAA,EAAsB,CAAA,GAAM,IAAI,CACzD","file":"chunk-A2WOHDUE.mjs","sourcesContent":["import { apiCaller, getAll } from \"../../services/apiCaller\";\r\nimport { API } from \"../../services/services\";\r\nimport {\r\n setInfo,\r\n setIsFetchDetails,\r\n setIsValidAddress,\r\n setSelectedSubtitle,\r\n} from \"../slices/videoDataSlice\";\r\nimport store from \"../store\";\r\nimport {\r\n addUuidToSrc,\r\n getUUID,\r\n responseValidator,\r\n weighted_random,\r\n} from \"../../helpers\";\r\nimport axios from \"axios\";\r\nimport { handleDetailsConfig } from \"../../getDetailsConfigs\";\r\nimport { subtitleLog } from \"../../logs/logs\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { mainPlayerVideoTag } from \"../../constants\";\r\nimport { setDetailsMiniPlayer } from \"../slices/miniPlayerSlice\";\r\nimport { conditions } from \"../../conditions/conditions\";\r\nimport { ConditionName } from \"../../interfaces/enums\";\r\nimport { ISubtitle } from \"../../interfaces/interfaces\";\r\n\r\nexport const getVodDetails = async (videoId?: string) => {\r\n const dispatch = store.dispatch;\r\n try {\r\n const d = await apiCaller({ ...handleDetailsConfig(videoId) });\r\n if (responseValidator(d.status)) {\r\n await axios.head(\r\n \"https://\" + weighted_random(d.data.hls_links) + d.data.path\r\n );\r\n if (videoId) return dispatch(setDetailsMiniPlayer(d.data));\r\n detailSetter(d.data);\r\n } else\r\n throw new Error(JSON.stringify({ status: d.status, message: d.data }));\r\n } catch (error: any) {\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(false));\r\n }\r\n};\r\n\r\nexport const detailSetter = async (data: any) => {\r\n const dispatch = store.dispatch;\r\n const {params} = store.getState().videoData;\r\n const validSubtitles = await filterValidSubtitles(conditions(ConditionName.hasSubtitlesInParams) ? params.subtitles : data.subtitles)\r\n dispatch(\r\n setInfo({\r\n ...data,\r\n subtitles: validSubtitles,\r\n stream_link:\r\n !!data.stream_link &&\r\n addUuidToSrc(\"https://\" + weighted_random(data.hls_links) + data.path),\r\n })\r\n );\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(true));\r\n};\r\n\r\nexport const handleSubtitle = () => {\r\n const dispatch = store.dispatch;\r\n const { subtitles, selectedSubtitle } = store.getState().videoData;\r\n\r\n const faSubtitle: any = subtitles.find(\r\n (subtitle: any) => subtitle.language === \"fa\"\r\n );\r\n if (selectedSubtitle) {\r\n Object.values(mainPlayerVideoTag().textTracks).find(\r\n (textTrack: any) => textTrack.mode === \"showing\"\r\n )!.mode = \"disabled\";\r\n dispatch(setSelectedSubtitle(undefined));\r\n sendFluentLog(subtitleLog(\"empty\"));\r\n } else {\r\n if (faSubtitle) {\r\n faSubtitle.mode = \"showing\";\r\n dispatch(setSelectedSubtitle(faSubtitle));\r\n sendFluentLog(subtitleLog(faSubtitle.language));\r\n } else {\r\n mainPlayerVideoTag().textTracks[0].mode = \"showing\";\r\n dispatch(setSelectedSubtitle(mainPlayerVideoTag().textTracks[0]));\r\n sendFluentLog(subtitleLog(mainPlayerVideoTag().textTracks[0].language));\r\n }\r\n }\r\n};\r\n\r\nexport const filterValidSubtitles = async (subtitles: ISubtitle[]): Promise<ISubtitle[]> => {\r\n const checks = subtitles.map(async (subtitle) => {\r\n try {\r\n const response = await fetch(subtitle.url, { method: \"HEAD\" });\r\n if (response.ok) return subtitle;\r\n else return null;\r\n } catch (err) {\r\n console.error(`Error fetching subtitle:`, subtitle.url, err);\r\n return null;\r\n }\r\n });\r\n\r\n const results = await Promise.all(checks);\r\n return results.filter((s): s is ISubtitle => s !== null);\r\n}\r\n\r\nexport const getAllGeneralMarker = async (url: string) => {\r\n const response: any = await getAll(url, [\r\n {\r\n codeAbove: 400,\r\n codeBelow: null,\r\n excludeCodes: [],\r\n includeCodes: [],\r\n delay: 2,\r\n count: 3\r\n }\r\n ]);\r\n return response;\r\n};\r\n","import { IDetailsConfig } from \"./interfaces/interfaces\";\r\nimport store from \"./redux/store\";\r\nimport { API } from \"./services/services\";\r\n\r\nexport const detailAPI = (id?: string) => {\r\n const { params } = store.getState().videoData;\r\n return API().vod.getVodUrl + (id ? id : params.id);\r\n};\r\n\r\nconst detailsConfig: IDetailsConfig = {\r\n url: \"\",\r\n maxRetryCount: 0,\r\n headers: {},\r\n retryPolicy: [],\r\n errorCallback: undefined\r\n};\r\n\r\nconst vodDetailsConfig = (videoId?:string) => {\r\n detailsConfig.url = detailAPI(videoId);\r\n detailsConfig.maxRetryCount = 3;\r\n detailsConfig.retryPolicy = [\r\n {\r\n codeAbove: 500,\r\n codeBelow: null,\r\n excludeCodes: [],\r\n includeCodes: [409],\r\n delay: 1,\r\n count: 3\r\n },\r\n {\r\n codeAbove: null,\r\n codeBelow: 404,\r\n excludeCodes: [403, 402, 401, 400],\r\n includeCodes: [],\r\n delay: 10,\r\n count: 6\r\n }\r\n ];\r\n return detailsConfig;\r\n};\r\n\r\n\r\nexport const handleDetailsConfig = (videoId?: string) => {\r\n vodDetailsConfig(videoId);\r\n return detailsConfig;\r\n};\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {e as e$1}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {e as e$1}from'./chunk-QZJECTZQ.mjs';import {ga,ha,f,la,fa,W}from'./chunk-FPUBUJN6.mjs';import {a}from'./chunk-TM66GJCG.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {useState,useRef,useEffect}from'react';import {shallowEqual}from'react-redux';import {useDoubleTap}from'use-double-tap';import u from'next/legacy/image';import {jsx,jsxs,Fragment}from'react/jsx-runtime';e();var j=1e3,H=({type:r,isRightDoubleTouched:F,isLeftDoubleTouched:g,setIsRightDoubleTouched:d,setIsLeftDoubleTouched:s})=>{let[c,f$1]=useState(15),[x,m]=useState(false),i=useRef(c),M=ga(),{duration:q}=ha(({controller:{currentTime:a,duration:n}})=>({currentTime:a,duration:n}),shallowEqual),{videoElementSizeInfo:B}=ha(({videoData:{videoElementSizeInfo:a,params:n}})=>({videoElementSizeInfo:a,params:n}),shallowEqual),p=useRef(null);useEffect(()=>{i.current=c;},[c]);let N;N=useDoubleTap(a=>{["touchBackward","touchForward"].includes(r)&&(a.stopPropagation(),r==="touchBackward"&&s?s(true):r==="touchForward"&&d&&d(true),clearTimeout(p.current),p.current=setTimeout(()=>m(true),j));},200),useEffect(()=>{x&&(m(false),M(f(false)),F&&d?(d(false),la().duration-la().currentTime<=i.current?e$1(r,la().duration):e$1(r,i.current),f$1(15)):g&&s&&(s(false),la().currentTime<=i.current?e$1(r,0):e$1(r,i.current),f$1(15)));},[x]);let z=a=>{f$1(n=>n+15),fa("isTouchScreenLandscape")&&W(a,r),clearTimeout(p.current),p.current=setTimeout(()=>m(true),j);},w;return ["backward","forward"].includes(r)?w=jsx("div",{className:`${!fa("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer ${r==="backward"&&(la().currentTime>=15?"pl-opacity-100":"pl-opacity-30 pl-cursor-default hover:pl-scale-100")} ${r==="forward"&&(q-la().currentTime>=15?"pl-opacity-100":"pl-opacity-30 pl-cursor-default hover:pl-scale-100")}}`,onContextMenu:a=>a.preventDefault(),children:jsx(u,{alt:r==="backward"?"backward-icon":"forward-icon",src:r==="backward"?a.backward15:a.forward15,width:24,height:24,onClick:()=>e$1(r,c),onDoubleClick:a=>a.stopPropagation()})}):["touchBackward","touchForward"].includes(r)&&(w=jsx("div",{id:r,className:`pl-relative pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-overflow-hidden ${r==="touchBackward"?"pl-rounded-r-full":"pl-rounded-l-full"}`,style:{width:B.width,height:B.width},...N,children:(F||g)&&jsxs("div",{className:"pl-w-full pl-h-full pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-p-5 pl-bg-secondary-100/[0.3]",onTouchStart:z,children:[jsxs("div",{className:`${r==="touchBackward"?"pl-arrow-left":"pl-arrow-right pl-gap-2"} pl-flex pl-justify-center pl-items-center`,children:[jsx(u,{alt:"arrow-left-icon",src:a.arrowLeft,className:`${r==="touchForward"&&"pl-rotate-180"}`,width:24,height:24}),jsx(u,{alt:"arrow-left-icon",src:a.arrowLeft,className:`${r==="touchForward"&&"pl-rotate-180"}`,width:24,height:24}),jsx(u,{alt:"arrow-left-icon",src:a.arrowLeft,className:`${r==="touchForward"&&"pl-rotate-180"}`,width:24,height:24})]}),jsxs("p",{className:"pl-text-center pl-text-[14px] pl-font-normal pl-text-white",children:[c," \u062B\u0627\u0646\u06CC\u0647"]})]})})),jsx(Fragment,{children:w})},rr=H;export{rr as a};//# sourceMappingURL=chunk-CSWKETJ4.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-CSWKETJ4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx"],"names":["init_esm_shims","hideTime","BackwardForward","type","isRightDoubleTouched","isLeftDoubleTouched","setIsRightDoubleTouched","setIsLeftDoubleTouched","backwardForwardCount","setBackwardForwardCount","useState","hide","setHide","backwardForwardCountRef","useRef","dispatch","useAppDispatch","duration","useAppSelector","currentTime","shallowEqual","videoElementSizeInfo","params","timeoutRef","useEffect","doubleTouch","useDoubleTap","event","setActiveElements","mainPlayerVideoTag","handleBackwardForward","handleTouchStart","prev","conditions","handleRippleCircle","component","jsx","Image","importImages_default","jsxs","Fragment","backwardForward_default"],"mappings":"2XAAAA,CAAAA,EAAAA,KAcMC,CAAAA,CAAW,GAAA,CAEXC,CAAAA,CAAkB,CAAC,CACrB,IAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CACJ,CAAA,GAA6B,CACzB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\"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useDoubleTap } from \"use-double-tap\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { IBackwardForwardProps } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleBackwardForward } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleRippleCircle } from \"../../../helpers/helpers\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/legacy/image\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\n\r\nconst hideTime = 1000;\r\n\r\nconst BackwardForward = ({\r\n type,\r\n isRightDoubleTouched,\r\n isLeftDoubleTouched,\r\n setIsRightDoubleTouched,\r\n setIsLeftDoubleTouched\r\n}: IBackwardForwardProps) => {\r\n const [backwardForwardCount, setBackwardForwardCount] = useState<number>(15);\r\n const [hide, setHide] = useState<boolean>(false);\r\n const backwardForwardCountRef = useRef<number>(backwardForwardCount);\r\n\r\n const dispatch = useAppDispatch();\r\n const { duration } = useAppSelector(({ controller: { currentTime, duration } }) => ({ currentTime, duration }), shallowEqual);\r\n const { videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),\r\n shallowEqual\r\n );\r\n\r\n const timeoutRef = useRef<any>(null);\r\n\r\n useEffect(() => {\r\n backwardForwardCountRef.current = backwardForwardCount;\r\n }, [backwardForwardCount]);\r\n\r\n let doubleTouch: any = undefined;\r\n\r\n doubleTouch = useDoubleTap((event) => {\r\n if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n event.stopPropagation();\r\n if (type === \"touchBackward\" && setIsLeftDoubleTouched) setIsLeftDoubleTouched(true);\r\n else if (type === \"touchForward\" && setIsRightDoubleTouched) setIsRightDoubleTouched(true);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n }, 200);\r\n\r\n useEffect(() => {\r\n if (hide) {\r\n setHide(false);\r\n dispatch(setActiveElements(false));\r\n if (isRightDoubleTouched && setIsRightDoubleTouched) {\r\n setIsRightDoubleTouched(false);\r\n if (mainPlayerVideoTag().duration - mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, mainPlayerVideoTag().duration);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(15);\r\n } else if (isLeftDoubleTouched && setIsLeftDoubleTouched) {\r\n setIsLeftDoubleTouched(false);\r\n if (mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, 0);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(15);\r\n }\r\n }\r\n }, [hide]);\r\n\r\n const handleTouchStart = (event: any) => {\r\n setBackwardForwardCount((prev) => prev + 15);\r\n if (conditions(ConditionName.isTouchScreenLandscape)) handleRippleCircle(event, type);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n };\r\n\r\n let component;\r\n\r\n if ([\"backward\", \"forward\"].includes(type)) {\r\n component = (\r\n <div\r\n className={`${\r\n !conditions(ConditionName.isTouchScreen) && \"hover:pl-scale-125\"\r\n } pl-transition-transform pl-ease-in-out pl-cursor-pointer ${\r\n type === \"backward\" && (mainPlayerVideoTag().currentTime >= 15 ? \"pl-opacity-100\" : \"pl-opacity-30 pl-cursor-default hover:pl-scale-100\")\r\n } ${\r\n type === \"forward\" &&\r\n (duration - mainPlayerVideoTag().currentTime >= 15 ? \"pl-opacity-100\" : \"pl-opacity-30 pl-cursor-default hover:pl-scale-100\")\r\n }}`}\r\n onContextMenu={(event) => event.preventDefault()}\r\n >\r\n <Image\r\n alt={type === \"backward\" ? \"backward-icon\" : \"forward-icon\"}\r\n src={type === \"backward\" ? IMAGES.backward15 : IMAGES.forward15}\r\n width={24} \r\n height={24}\r\n onClick={() => handleBackwardForward(type, backwardForwardCount)}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n />\r\n </div>\r\n );\r\n } else if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n component = (\r\n <div\r\n id={type}\r\n className={`pl-relative pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-overflow-hidden ${\r\n type === \"touchBackward\" ? \"pl-rounded-r-full\" : \"pl-rounded-l-full\"\r\n }`}\r\n style={{ width: videoElementSizeInfo.width, height: videoElementSizeInfo.width }}\r\n {...doubleTouch}\r\n >\r\n {(isRightDoubleTouched || isLeftDoubleTouched) && (\r\n <div\r\n className={`pl-w-full pl-h-full pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-p-5 pl-bg-secondary-100/[0.3]`}\r\n onTouchStart={handleTouchStart}\r\n >\r\n <div\r\n className={`${\r\n type === \"touchBackward\" ? \"pl-arrow-left\" : \"pl-arrow-right pl-gap-2\"\r\n } pl-flex pl-justify-center pl-items-center`}\r\n >\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n </div>\r\n <p className=\"pl-text-center pl-text-[14px] pl-font-normal pl-text-white\">{backwardForwardCount} ثانیه</p>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n\r\n return <>{component}</>;\r\n};\r\n\r\nexport default BackwardForward;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/backwardForward/backwardForward.tsx"],"names":["init_esm_shims","hideTime","BackwardForward","type","isRightDoubleTouched","isLeftDoubleTouched","setIsRightDoubleTouched","setIsLeftDoubleTouched","backwardForwardCount","setBackwardForwardCount","useState","hide","setHide","backwardForwardCountRef","useRef","dispatch","useAppDispatch","duration","useAppSelector","currentTime","shallowEqual","videoElementSizeInfo","params","timeoutRef","useEffect","doubleTouch","useDoubleTap","event","setActiveElements","mainPlayerVideoTag","handleBackwardForward","handleTouchStart","prev","conditions","handleRippleCircle","component","jsx","Image","importImages_default","jsxs","Fragment","backwardForward_default"],"mappings":"2XAAAA,CAAAA,EAAAA,KAcMC,CAAAA,CAAW,GAAA,CAEXC,CAAAA,CAAkB,CAAC,CACrB,IAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CACJ,CAAA,GAA6B,CACzB,GAAM,CAACC,CAAAA,CAAsBC,GAAuB,CAAA,CAAIC,QAAAA,CAAiB,EAAE,CAAA,CACrE,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIF,SAAkB,KAAK,CAAA,CACzCG,CAAAA,CAA0BC,MAAAA,CAAeN,CAAoB,CAAA,CAE7DO,EAAWC,EAAAA,EAAe,CAC1B,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAIC,GAAe,CAAC,CAAE,UAAA,CAAY,CAAE,WAAA,CAAAC,CAAAA,CAAa,QAAA,CAAAF,CAAS,CAAE,CAAA,IAAO,CAAE,WAAA,CAAAE,CAAAA,CAAa,QAAA,CAAAF,CAAS,CAAA,CAAA,CAAIG,YAAY,CAAA,CACtH,CAAE,oBAAA,CAAAC,CAAqB,CAAA,CAAIH,EAAAA,CAC7B,CAAC,CAAE,SAAA,CAAW,CAAE,oBAAA,CAAAG,CAAAA,CAAsB,OAAAC,CAAO,CAAE,CAAA,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AAA,GAAS,cAAA,EAAkB,eAAe,GACxD,KAAA,CAAO,EAAA,CACP,MAAA,CAAQ,EAAA,CACZ,CAAA,CACAiC,GAAAA,CAACC,CAAAA,CAAA,CACG,GAAA,CAAI,iBAAA,CACJ,GAAA,CAAKC,CAAAA,CAAO,SAAA,CACZ,SAAA,CAAW,GAAGnC,CAAAA,GAAS,cAAA,EAAkB,eAAe,CAAA,CAAA,CACxD,KAAA,CAAO,EAAA,CACP,MAAA,CAAQ,EAAA,CACZ,CAAA,CAAA,CACJ,CAAA,CACAoC,IAAAA,CAAC,GAAA,CAAA,CAAE,SAAA,CAAU,4DAAA,CAA8D,UAAA/B,CAAAA,CAAqB,iCAAA,CAAA,CAAM,CAAA,CAAA,CAC1G,CAAA,CAER,CAAA,CAAA,CAID4B,GAAAA,CAAAI,QAAAA,CAAA,CAAG,QAAA,CAAAL,CAAAA,CAAU,CACxB,CAAA,CAEOM,EAAAA,CAAQvC","file":"chunk-CSWKETJ4.mjs","sourcesContent":["import { useEffect, useRef, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useDoubleTap } from \"use-double-tap\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { IBackwardForwardProps } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setActiveElements } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleBackwardForward } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { handleRippleCircle } from \"../../../helpers/helpers\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport Image from \"next/legacy/image\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\n\r\nconst hideTime = 1000;\r\n\r\nconst BackwardForward = ({\r\n type,\r\n isRightDoubleTouched,\r\n isLeftDoubleTouched,\r\n setIsRightDoubleTouched,\r\n setIsLeftDoubleTouched\r\n}: IBackwardForwardProps) => {\r\n const [backwardForwardCount, setBackwardForwardCount] = useState<number>(15);\r\n const [hide, setHide] = useState<boolean>(false);\r\n const backwardForwardCountRef = useRef<number>(backwardForwardCount);\r\n\r\n const dispatch = useAppDispatch();\r\n const { duration } = useAppSelector(({ controller: { currentTime, duration } }) => ({ currentTime, duration }), shallowEqual);\r\n const { videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { videoElementSizeInfo, params } }) => ({ videoElementSizeInfo, params }),\r\n shallowEqual\r\n );\r\n\r\n const timeoutRef = useRef<any>(null);\r\n\r\n useEffect(() => {\r\n backwardForwardCountRef.current = backwardForwardCount;\r\n }, [backwardForwardCount]);\r\n\r\n let doubleTouch: any = undefined;\r\n\r\n doubleTouch = useDoubleTap((event) => {\r\n if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n event.stopPropagation();\r\n if (type === \"touchBackward\" && setIsLeftDoubleTouched) setIsLeftDoubleTouched(true);\r\n else if (type === \"touchForward\" && setIsRightDoubleTouched) setIsRightDoubleTouched(true);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n }\r\n }, 200);\r\n\r\n useEffect(() => {\r\n if (hide) {\r\n setHide(false);\r\n dispatch(setActiveElements(false));\r\n if (isRightDoubleTouched && setIsRightDoubleTouched) {\r\n setIsRightDoubleTouched(false);\r\n if (mainPlayerVideoTag().duration - mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, mainPlayerVideoTag().duration);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(15);\r\n } else if (isLeftDoubleTouched && setIsLeftDoubleTouched) {\r\n setIsLeftDoubleTouched(false);\r\n if (mainPlayerVideoTag().currentTime <= backwardForwardCountRef.current) handleBackwardForward(type, 0);\r\n else handleBackwardForward(type, backwardForwardCountRef.current);\r\n setBackwardForwardCount(15);\r\n }\r\n }\r\n }, [hide]);\r\n\r\n const handleTouchStart = (event: any) => {\r\n setBackwardForwardCount((prev) => prev + 15);\r\n if (conditions(ConditionName.isTouchScreenLandscape)) handleRippleCircle(event, type);\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = setTimeout(() => setHide(true), hideTime);\r\n };\r\n\r\n let component;\r\n\r\n if ([\"backward\", \"forward\"].includes(type)) {\r\n component = (\r\n <div\r\n className={`${\r\n !conditions(ConditionName.isTouchScreen) && \"hover:pl-scale-125\"\r\n } pl-transition-transform pl-ease-in-out pl-cursor-pointer ${\r\n type === \"backward\" && (mainPlayerVideoTag().currentTime >= 15 ? \"pl-opacity-100\" : \"pl-opacity-30 pl-cursor-default hover:pl-scale-100\")\r\n } ${\r\n type === \"forward\" &&\r\n (duration - mainPlayerVideoTag().currentTime >= 15 ? \"pl-opacity-100\" : \"pl-opacity-30 pl-cursor-default hover:pl-scale-100\")\r\n }}`}\r\n onContextMenu={(event) => event.preventDefault()}\r\n >\r\n <Image\r\n alt={type === \"backward\" ? \"backward-icon\" : \"forward-icon\"}\r\n src={type === \"backward\" ? IMAGES.backward15 : IMAGES.forward15}\r\n width={24} \r\n height={24}\r\n onClick={() => handleBackwardForward(type, backwardForwardCount)}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n />\r\n </div>\r\n );\r\n } else if ([\"touchBackward\", \"touchForward\"].includes(type)) {\r\n component = (\r\n <div\r\n id={type}\r\n className={`pl-relative pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-overflow-hidden ${\r\n type === \"touchBackward\" ? \"pl-rounded-r-full\" : \"pl-rounded-l-full\"\r\n }`}\r\n style={{ width: videoElementSizeInfo.width, height: videoElementSizeInfo.width }}\r\n {...doubleTouch}\r\n >\r\n {(isRightDoubleTouched || isLeftDoubleTouched) && (\r\n <div\r\n className={`pl-w-full pl-h-full pl-flex pl-flex-col pl-justify-center pl-items-center pl-gap-2 pl-p-5 pl-bg-secondary-100/[0.3]`}\r\n onTouchStart={handleTouchStart}\r\n >\r\n <div\r\n className={`${\r\n type === \"touchBackward\" ? \"pl-arrow-left\" : \"pl-arrow-right pl-gap-2\"\r\n } pl-flex pl-justify-center pl-items-center`}\r\n >\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n <Image\r\n alt=\"arrow-left-icon\"\r\n src={IMAGES.arrowLeft}\r\n className={`${type === \"touchForward\" && \"pl-rotate-180\"}`}\r\n width={24}\r\n height={24}\r\n />\r\n </div>\r\n <p className=\"pl-text-center pl-text-[14px] pl-font-normal pl-text-white\">{backwardForwardCount} ثانیه</p>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n\r\n return <>{component}</>;\r\n};\r\n\r\nexport default BackwardForward;\r\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkHSAWK74H_js=require('./chunk-HSAWK74H.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),A=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var A__default=/*#__PURE__*/_interopDefault(A);chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var I=t=>{let{params:e}=chunkHSAWK74H_js.P.getState().videoData;return chunkHSAWK74H_js.ja().vod.getVodUrl+(t||e.id)},n={url:"",maxRetryCount:0,headers:{},retryPolicy:[],errorCallback:void 0},k=t=>(n.url=I(t),n.maxRetryCount=3,n.retryPolicy=[{codeAbove:500,codeBelow:null,excludeCodes:[],includeCodes:[409],delay:1,count:3},{codeAbove:null,codeBelow:404,excludeCodes:[403,402,401,400],includeCodes:[],delay:10,count:6}],n),w=t=>(k(t),n);var Q=async t=>{let e=chunkHSAWK74H_js.P.dispatch;try{let o=await chunkHSAWK74H_js.Ga({...w(t)});if(chunkHSAWK74H_js.X(o.status)){if(await A__default.default.head("https://"+chunkHSAWK74H_js.Z(o.data.hls_links)+o.data.path),t)return e(chunkHSAWK74H_js.M(o.data));P(o.data);}else throw new Error(JSON.stringify({status:o.status,message:o.data}))}catch{e(chunkHSAWK74H_js.u(true)),e(chunkHSAWK74H_js.v(false));}},P=async t=>{let e=chunkHSAWK74H_js.P.dispatch,{params:o}=chunkHSAWK74H_js.P.getState().videoData,s=await v(chunkHSAWK74H_js.fa("hasSubtitlesInParams")?o.subtitles:t.subtitles);e(chunkHSAWK74H_js.r({...t,subtitles:s,stream_link:!!t.stream_link&&chunkHSAWK74H_js.T("https://"+chunkHSAWK74H_js.Z(t.hls_links)+t.path)})),e(chunkHSAWK74H_js.u(true)),e(chunkHSAWK74H_js.v(true));},W=()=>{let t=chunkHSAWK74H_js.P.dispatch,{subtitles:e,selectedSubtitle:o}=chunkHSAWK74H_js.P.getState().videoData,s=e.find(a=>a.language==="fa");o?(Object.values(chunkHSAWK74H_js.la().textTracks).find(a=>a.mode==="showing").mode="disabled",t(chunkHSAWK74H_js.A(void 0)),chunkHSAWK74H_js.ka(chunkHSAWK74H_js.Da("empty"))):s?(s.mode="showing",t(chunkHSAWK74H_js.A(s)),chunkHSAWK74H_js.ka(chunkHSAWK74H_js.Da(s.language))):(chunkHSAWK74H_js.la().textTracks[0].mode="showing",t(chunkHSAWK74H_js.A(chunkHSAWK74H_js.la().textTracks[0])),chunkHSAWK74H_js.ka(chunkHSAWK74H_js.Da(chunkHSAWK74H_js.la().textTracks[0].language)));},v=async t=>{let e=t.map(async s=>{try{return (await fetch(s.url,{method:"HEAD"})).ok?s:null}catch(a){return console.error("Error fetching subtitle:",s.url,a),null}});return (await Promise.all(e)).filter(s=>s!==null)};
|
|
2
|
+
exports.a=Q;exports.b=W;exports.c=v;//# sourceMappingURL=chunk-D6YE37GQ.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-D6YE37GQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts","../src/videoPlayerLibrary/helpers/getDetailsConfigs.ts"],"names":["init_cjs_shims","detailAPI","id","params","store_default","API","detailsConfig","vodDetailsConfig","videoId","handleDetailsConfig","getVodDetails","dispatch","d","apiCaller","responseValidator","axios","weighted_random","setDetailsMiniPlayer","detailSetter","setIsFetchDetails","setIsValidAddress","data","validSubtitles","filterValidSubtitles","conditions","setInfo","addUuidToSrc","handleSubtitle","subtitles","selectedSubtitle","faSubtitle","subtitle","mainPlayerVideoTag","textTrack","setSelectedSubtitle","sendFluentLog","subtitleLog","checks","err"],"mappings":"oPAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CAIO,IAAMC,CAAAA,CAAaC,CAAAA,EAAgB,CACtC,GAAM,CAAE,OAAAC,CAAO,CAAA,CAAIC,mBAAM,QAAA,EAAS,CAAE,UACpC,OAAOC,mBAAAA,GAAM,GAAA,CAAI,SAAA,EAAaH,GAAUC,CAAAA,CAAO,EAAA,CACnD,EAEMG,CAAAA,CAAgC,CAClC,IAAK,EAAA,CACL,aAAA,CAAe,EACf,OAAA,CAAS,GACT,WAAA,CAAa,GACb,aAAA,CAAe,MACnB,EAEMC,CAAAA,CAAoBC,CAAAA,GACtBF,EAAc,GAAA,CAAML,CAAAA,CAAUO,CAAO,CAAA,CACrCF,CAAAA,CAAc,cAAgB,CAAA,CAC9BA,CAAAA,CAAc,YAAc,CACxB,CACI,UAAW,GAAA,CACX,SAAA,CAAW,KACX,YAAA,CAAc,GACd,YAAA,CAAc,CAAC,GAAG,CAAA,CAClB,KAAA,CAAO,EACP,KAAA,CAAO,CACX,EACA,CACI,SAAA,CAAW,KACX,SAAA,CAAW,GAAA,CACX,aAAc,CAAC,GAAA,CAAK,IAAK,GAAA,CAAK,GAAG,EACjC,YAAA,CAAc,GACd,KAAA,CAAO,EAAA,CACP,MAAO,CACX,CACJ,CAAA,CACOA,C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,CAAa,UAAA,CAAaV,mBAAgBK,CAAAA,CAAK,SAAS,EAAIA,CAAAA,CAAK,IAAI,CACzE,CAAC,CACH,EACAV,CAAAA,CAASQ,kBAAAA,CAAkB,IAAI,CAAC,CAAA,CAChCR,EAASS,kBAAAA,CAAkB,IAAI,CAAC,EAClC,CAAA,CAEaO,EAAiB,IAAM,CAClC,IAAMhB,CAAAA,CAAWP,kBAAAA,CAAM,SACjB,CAAE,SAAA,CAAAwB,EAAW,gBAAA,CAAAC,CAAiB,EAAIzB,kBAAAA,CAAM,QAAA,GAAW,SAAA,CAEnD0B,CAAAA,CAAkBF,EAAU,IAAA,CAC/BG,CAAAA,EAAkBA,EAAS,QAAA,GAAa,IAC3C,EACIF,CAAAA,EACF,MAAA,CAAO,OAAOG,mBAAAA,EAAmB,CAAE,UAAU,CAAA,CAAE,IAAA,CAC5CC,GAAmBA,CAAAA,CAAU,IAAA,GAAS,SACzC,CAAA,CAAG,IAAA,CAAO,WACVtB,CAAAA,CAASuB,kBAAAA,CAAoB,MAAS,CAAC,CAAA,CACvCC,mBAAAA,CAAcC,oBAAY,OAAO,CAAC,GAE9BN,CAAAA,EACFA,CAAAA,CAAW,KAAO,SAAA,CAClBnB,CAAAA,CAASuB,mBAAoBJ,CAAU,CAAC,EACxCK,mBAAAA,CAAcC,mBAAAA,CAAYN,EAAW,QAAQ,CAAC,IAE9CE,mBAAAA,EAAmB,CAAE,WAAW,CAAC,CAAA,CAAE,KAAO,SAAA,CAC1CrB,CAAAA,CAASuB,mBAAoBF,mBAAAA,EAAmB,CAAE,WAAW,CAAC,CAAC,CAAC,CAAA,CAChEG,mBAAAA,CAAcC,oBAAYJ,mBAAAA,EAAmB,CAAE,WAAW,CAAC,CAAA,CAAE,QAAQ,CAAC,CAAA,EAG5E,CAAA,
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/helpers/redux/actions/videoData.actions.ts","../src/videoPlayerLibrary/helpers/getDetailsConfigs.ts"],"names":["init_cjs_shims","detailAPI","id","params","store_default","API","detailsConfig","vodDetailsConfig","videoId","handleDetailsConfig","getVodDetails","dispatch","d","apiCaller","responseValidator","axios","weighted_random","setDetailsMiniPlayer","detailSetter","setIsFetchDetails","setIsValidAddress","data","validSubtitles","filterValidSubtitles","conditions","setInfo","addUuidToSrc","handleSubtitle","subtitles","selectedSubtitle","faSubtitle","subtitle","mainPlayerVideoTag","textTrack","setSelectedSubtitle","sendFluentLog","subtitleLog","checks","err"],"mappings":"oPAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CAIO,IAAMC,CAAAA,CAAaC,CAAAA,EAAgB,CACtC,GAAM,CAAE,OAAAC,CAAO,CAAA,CAAIC,mBAAM,QAAA,EAAS,CAAE,UACpC,OAAOC,mBAAAA,GAAM,GAAA,CAAI,SAAA,EAAaH,GAAUC,CAAAA,CAAO,EAAA,CACnD,EAEMG,CAAAA,CAAgC,CAClC,IAAK,EAAA,CACL,aAAA,CAAe,EACf,OAAA,CAAS,GACT,WAAA,CAAa,GACb,aAAA,CAAe,MACnB,EAEMC,CAAAA,CAAoBC,CAAAA,GACtBF,EAAc,GAAA,CAAML,CAAAA,CAAUO,CAAO,CAAA,CACrCF,CAAAA,CAAc,cAAgB,CAAA,CAC9BA,CAAAA,CAAc,YAAc,CACxB,CACI,UAAW,GAAA,CACX,SAAA,CAAW,KACX,YAAA,CAAc,GACd,YAAA,CAAc,CAAC,GAAG,CAAA,CAClB,KAAA,CAAO,EACP,KAAA,CAAO,CACX,EACA,CACI,SAAA,CAAW,KACX,SAAA,CAAW,GAAA,CACX,aAAc,CAAC,GAAA,CAAK,IAAK,GAAA,CAAK,GAAG,EACjC,YAAA,CAAc,GACd,KAAA,CAAO,EAAA,CACP,MAAO,CACX,CACJ,CAAA,CACOA,CAAAA,CAAAA,CAIEG,CAAAA,CAAuBD,CAAAA,GAChCD,EAAiBC,CAAO,CAAA,CACjBF,GDnBJ,IAAMI,CAAAA,CAAgB,MAAOF,CAAAA,EAAqB,C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AAK,CACZ,OAAA,OAAA,CAAQ,MAAM,0BAAA,CAA4BP,CAAAA,CAAS,IAAKO,CAAG,CAAA,CACpD,IACT,CACF,CAAC,EAGD,OAAA,CADgB,MAAM,QAAQ,GAAA,CAAID,CAAM,GACzB,MAAA,CAAQ,CAAA,EAAsB,CAAA,GAAM,IAAI,CACzD","file":"chunk-D6YE37GQ.js","sourcesContent":["import { apiCaller, getAll } from \"../../services/apiCaller\";\r\nimport { API } from \"../../services/services\";\r\nimport {\r\n setInfo,\r\n setIsFetchDetails,\r\n setIsValidAddress,\r\n setSelectedSubtitle,\r\n} from \"../slices/videoDataSlice\";\r\nimport store from \"../store\";\r\nimport {\r\n addUuidToSrc,\r\n getUUID,\r\n responseValidator,\r\n weighted_random,\r\n} from \"../../helpers\";\r\nimport axios from \"axios\";\r\nimport { handleDetailsConfig } from \"../../getDetailsConfigs\";\r\nimport { subtitleLog } from \"../../logs/logs\";\r\nimport { sendFluentLog } from \"../../logs/fluentdLogger\";\r\nimport { mainPlayerVideoTag } from \"../../constants\";\r\nimport { setDetailsMiniPlayer } from \"../slices/miniPlayerSlice\";\r\nimport { conditions } from \"../../conditions/conditions\";\r\nimport { ConditionName } from \"../../interfaces/enums\";\r\nimport { ISubtitle } from \"../../interfaces/interfaces\";\r\n\r\nexport const getVodDetails = async (videoId?: string) => {\r\n const dispatch = store.dispatch;\r\n try {\r\n const d = await apiCaller({ ...handleDetailsConfig(videoId) });\r\n if (responseValidator(d.status)) {\r\n await axios.head(\r\n \"https://\" + weighted_random(d.data.hls_links) + d.data.path\r\n );\r\n if (videoId) return dispatch(setDetailsMiniPlayer(d.data));\r\n detailSetter(d.data);\r\n } else\r\n throw new Error(JSON.stringify({ status: d.status, message: d.data }));\r\n } catch (error: any) {\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(false));\r\n }\r\n};\r\n\r\nexport const detailSetter = async (data: any) => {\r\n const dispatch = store.dispatch;\r\n const {params} = store.getState().videoData;\r\n const validSubtitles = await filterValidSubtitles(conditions(ConditionName.hasSubtitlesInParams) ? params.subtitles : data.subtitles)\r\n dispatch(\r\n setInfo({\r\n ...data,\r\n subtitles: validSubtitles,\r\n stream_link:\r\n !!data.stream_link &&\r\n addUuidToSrc(\"https://\" + weighted_random(data.hls_links) + data.path),\r\n })\r\n );\r\n dispatch(setIsFetchDetails(true));\r\n dispatch(setIsValidAddress(true));\r\n};\r\n\r\nexport const handleSubtitle = () => {\r\n const dispatch = store.dispatch;\r\n const { subtitles, selectedSubtitle } = store.getState().videoData;\r\n\r\n const faSubtitle: any = subtitles.find(\r\n (subtitle: any) => subtitle.language === \"fa\"\r\n );\r\n if (selectedSubtitle) {\r\n Object.values(mainPlayerVideoTag().textTracks).find(\r\n (textTrack: any) => textTrack.mode === \"showing\"\r\n )!.mode = \"disabled\";\r\n dispatch(setSelectedSubtitle(undefined));\r\n sendFluentLog(subtitleLog(\"empty\"));\r\n } else {\r\n if (faSubtitle) {\r\n faSubtitle.mode = \"showing\";\r\n dispatch(setSelectedSubtitle(faSubtitle));\r\n sendFluentLog(subtitleLog(faSubtitle.language));\r\n } else {\r\n mainPlayerVideoTag().textTracks[0].mode = \"showing\";\r\n dispatch(setSelectedSubtitle(mainPlayerVideoTag().textTracks[0]));\r\n sendFluentLog(subtitleLog(mainPlayerVideoTag().textTracks[0].language));\r\n }\r\n }\r\n};\r\n\r\nexport const filterValidSubtitles = async (subtitles: ISubtitle[]): Promise<ISubtitle[]> => {\r\n const checks = subtitles.map(async (subtitle) => {\r\n try {\r\n const response = await fetch(subtitle.url, { method: \"HEAD\" });\r\n if (response.ok) return subtitle;\r\n else return null;\r\n } catch (err) {\r\n console.error(`Error fetching subtitle:`, subtitle.url, err);\r\n return null;\r\n }\r\n });\r\n\r\n const results = await Promise.all(checks);\r\n return results.filter((s): s is ISubtitle => s !== null);\r\n}\r\n\r\nexport const getAllGeneralMarker = async (url: string) => {\r\n const response: any = await getAll(url, [\r\n {\r\n codeAbove: 400,\r\n codeBelow: null,\r\n excludeCodes: [],\r\n includeCodes: [],\r\n delay: 2,\r\n count: 3\r\n }\r\n ]);\r\n return response;\r\n};\r\n","import { IDetailsConfig } from \"./interfaces/interfaces\";\r\nimport store from \"./redux/store\";\r\nimport { API } from \"./services/services\";\r\n\r\nexport const detailAPI = (id?: string) => {\r\n const { params } = store.getState().videoData;\r\n return API().vod.getVodUrl + (id ? id : params.id);\r\n};\r\n\r\nconst detailsConfig: IDetailsConfig = {\r\n url: \"\",\r\n maxRetryCount: 0,\r\n headers: {},\r\n retryPolicy: [],\r\n errorCallback: undefined\r\n};\r\n\r\nconst vodDetailsConfig = (videoId?:string) => {\r\n detailsConfig.url = detailAPI(videoId);\r\n detailsConfig.maxRetryCount = 3;\r\n detailsConfig.retryPolicy = [\r\n {\r\n codeAbove: 500,\r\n codeBelow: null,\r\n excludeCodes: [],\r\n includeCodes: [409],\r\n delay: 1,\r\n count: 3\r\n },\r\n {\r\n codeAbove: null,\r\n codeBelow: 404,\r\n excludeCodes: [403, 402, 401, 400],\r\n includeCodes: [],\r\n delay: 10,\r\n count: 6\r\n }\r\n ];\r\n return detailsConfig;\r\n};\r\n\r\n\r\nexport const handleDetailsConfig = (videoId?: string) => {\r\n vodDetailsConfig(videoId);\r\n return detailsConfig;\r\n};\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import {b as b$1,e,c as c$1,a,d}from'./chunk-NXC6LNWJ.mjs';import {createSlice,configureStore}from'@reduxjs/toolkit';import {useDispatch,useSelector}from'react-redux';import Re from'axios';var le=b$1((ba,ne)=>{e();ne.exports={baseUrl:"https://hamrahi.cloud",fluentdUrl:"https://hamrahi.cloud"};});var ue={};c$1(ue,{isNpmPackage:()=>Ue});var Ue,de=a(()=>{e();Ue=false;});e();var Q={play:false,isAutoPlay:true,duration:0,currentTime:0,qualityLevels:[],manualQuality:void 0,autoQuality:void 0,activeElements:true,isLoading:false,isFullScreen:false,bufferedTimeWidth:0,firstPlay:true,activePointerProgressBar:false,delayTurnOffControlbar:false,canPlayVideo:false,lock:false,isEnded:false,tooltipTime:0},B=createSlice({name:"controller",initialState:Q,reducers:{setPlay:(t,e)=>{t.play=e.payload;},setIsAutoPlay:(t,e)=>{t.isAutoPlay=e.payload;},setDuration:(t,e)=>{t.duration=e.payload;},setCurrentTime:(t,e)=>{t.currentTime=e.payload;},setManualQuality:(t,e)=>{t.manualQuality=e.payload;},setAutoQuality:(t,e)=>{t.autoQuality=e.payload;},setQualityLevels:(t,e)=>{t.qualityLevels=e.payload;},setActiveElements:(t,e)=>{t.activeElements=e.payload;},setIsLoading:(t,e)=>{t.isLoading=e.payload;},setIsFullScreen:(t,e)=>{t.isFullScreen=e.payload;},setBufferedTimeWidth:(t,e)=>{t.bufferedTimeWidth=e.payload;},setFirstPlay:(t,e)=>{t.firstPlay=e.payload;},setActivePointerProgressBar:(t,e)=>{t.activePointerProgressBar=e.payload;},setDelayTurnOffControlbar:(t,e)=>{t.delayTurnOffControlbar=e.payload;},setCanPlayVideo:(t,e)=>{t.canPlayVideo=e.payload;},setLock:(t,e)=>{t.lock=e.payload;},setIsEnded:(t,e)=>{t.isEnded=e.payload;},setTooltipTime:(t,e)=>{t.tooltipTime=e.payload;},setClearControllerSlice:()=>Q}}),{setPlay:Be,setIsAutoPlay:Oe,setDuration:$e,setCurrentTime:Ke,setQualityLevels:qe,setAutoQuality:Ce,setActiveElements:He,setIsLoading:je,setIsFullScreen:We,setBufferedTimeWidth:Xe,setFirstPlay:Ye,setActivePointerProgressBar:Ge,setDelayTurnOffControlbar:Je,setManualQuality:Ze,setCanPlayVideo:ze,setLock:Ne,setIsEnded:et,setTooltipTime:tt,setClearControllerSlice:O}=B.actions,$=B.reducer;e();var K={details:{stream_link:"",type:"",banner:"",id:void 0,title:void 0,vtt:void 0,vtt_mobile:void 0,user_id:null,content_id:void 0,content_type:null,duration:0,subtitles:void 0},params:{type:"",id:"",bannerAlt:"",fullscreen:"",autoplay:"",banner:"",provider:"cafevdo",onFinished:void 0,onPlay:void 0,onPause:void 0,playStatus:void 0,currentTime:void 0,daaniHashCode:void 0},markers:[],videoElementSizeInfo:{bottom:0,top:0,right:0,left:0,width:0,height:0},isFetchDetails:false,isValidAddress:false,videoTimelines:[],isReady:false,subtitles:[],selectedSubtitle:void 0,subtitleText:void 0,multiAudio:[],selectedAudioId:0},q=createSlice({name:"videoData",initialState:K,reducers:{setInfo:(t,e)=>{t.details=e.payload;},setPlayerParams:(t,e)=>{t.params=e.payload;},setMarkers:(t,e)=>{t.markers=e.payload;},setVideoElementSizeInfo:(t,e)=>{t.videoElementSizeInfo=e.payload;},setIsFetchDetails:(t,e)=>{t.isFetchDetails=e.payload;},setIsValidAddress:(t,e)=>{t.isValidAddress=e.payload;},setVideoTimelines:(t,e)=>{t.videoTimelines=e.payload;},setIsReady:(t,e)=>{t.isReady=e.payload;},setSubtitles:(t,e)=>{t.subtitles=e.payload;},setSelectedSubtitle:(t,e)=>{t.selectedSubtitle=e.payload;},setSubtitleText:(t,e)=>{t.subtitleText=e.payload;},setMultiAudio:(t,e)=>{t.multiAudio=JSON.parse(JSON.stringify(e.payload));},setSelectedAudioId:(t,e)=>{t.selectedAudioId=e.payload;},setClearVideoDataSlice:t=>K}}),{setInfo:it,setPlayerParams:nt,setVideoElementSizeInfo:lt,setMarkers:ut,setIsFetchDetails:dt,setIsValidAddress:ct,setVideoTimelines:pt,setIsReady:mt,setSubtitles:yt,setSubtitleText:gt,setSelectedSubtitle:ht,setMultiAudio:Pt,setSelectedAudioId:ft,setClearVideoDataSlice:C}=q.actions,H=q.reducer;e();var j={settings:{quality:-1,brightness:100,volume:100,speed:1},videoSettings:{time:0}},W=createSlice({name:"user",initialState:j,reducers:{setUserSettings:(t,e)=>{t.settings=e.payload;},setVideoSettings:(t,e)=>{t.videoSettings=e.payload;},setClearUserSlice:()=>j}}),{setUserSettings:wt,setVideoSettings:Lt,setClearUserSlice:X}=W.actions,Y=W.reducer;e();e();e();var xe={settingPopover:false,speedPopover:false,qualityLevelsPopover:false,markersListPopover:false,multiAudioPopover:false},G=createSlice({name:"popover",initialState:xe,reducers:{setSettingPopover:(t,e)=>{t.settingPopover=e.payload;},setSpeedPopover:(t,e)=>{t.speedPopover=e.payload;},setQualityLevelsPopover:(t,e)=>{t.qualityLevelsPopover=e.payload;},setMarkersListPopover:(t,e)=>{t.markersListPopover=e.payload;},setMultiAudioPopover:(t,e)=>{t.multiAudioPopover=e.payload;},setClearPopoversSlice:t=>{t.settingPopover=false,t.speedPopover=false,t.qualityLevelsPopover=false,t.markersListPopover=false,t.multiAudioPopover=false;}}}),{setSettingPopover:Ft,setSpeedPopover:Vt,setQualityLevelsPopover:_t,setMarkersListPopover:Rt,setMultiAudioPopover:Ut,setClearPopoversSlice:J}=G.actions,Z=G.reducer;e();var z={params:{id:"0",type:"",currentTime:0,autoPlay:false,onClose:()=>{}},details:{},play:false},N=createSlice({name:"user",initialState:z,reducers:{setMiniPlayerInfo:(t,e)=>{t.params={...e.payload,id:e.payload.type==="static"?window.atob(e.payload.id):e.payload.id,banner:e.payload.banner?e.payload.banner:void 0};},setDetailsMiniPlayer:(t,e)=>{t.details=e.payload;},setPlayMiniPlayer:(t,e)=>{t.play=e.payload;},setClearMiniPlayerSlice:t=>z}}),{setMiniPlayerInfo:Kt,setDetailsMiniPlayer:qt,setPlayMiniPlayer:Ct,setClearMiniPlayerSlice:Ht}=N.actions,ee=N.reducer;var Ie=configureStore({reducer:{controller:$,videoData:H,popovers:Z,user:Y,miniPlayer:ee},devTools:true,middleware:t=>t({serializableCheck:false})}),s=Ie;e();e();var c=t=>{let{params:e,details:r,isValidAddress:a,isFetchDetails:i,isReady:l,subtitles:p,selectedSubtitle:d,markers:h,multiAudio:f}=s.getState().videoData,{firstPlay:u,lock:n,canPlayVideo:S,manualQuality:v,activeElements:g,isLoading:pe,isEnded:R,isAutoPlay:me,play:ye,isFullScreen:L}=s.getState().controller,{settingPopover:U,speedPopover:ge,qualityLevelsPopover:he,markersListPopover:Pe}=s.getState().popovers,{settings:E}=s.getState().user,k=s.getState().miniPlayer;switch(t){case "showHeader":return !u&&S;case "showMain":return !n||u;case "showFooter":return !u&&S;case "showTouchVolumeBrightness":return !u&&x()&&!n&&!R;case "showBackwardForward":return !u&&b()&&!n;case "showTitle":return e.type!=="static"&&L&&!n;case "showSettingPopover":return U;case "showSpeedPopover":return ge;case "showQualityLevelsPopover":return he;case "showSettingIcon":return e.type!=="static"&&!A()&&!L;case "showBanner":return u&&(r.banner||e.banner);case "showProgressbar":return !A();case "showPictureInPicture":return !A()&&!b();case "showSubtitle":return !!d;case "showMarkerListPopover":return Pe;case "hidePopovers":return !U;case "isLandscape":return window.innerHeight<=window.innerWidth;case "isTouchScreen":return b();case "isTouchScreenPortrait":return re();case "isTouchScreenLandscape":return x();case "isActiveElements":return g;case "isPlay":return ye;case "isPlayMiniPlayer":return k.play;case "isFirstPlay":return u;case "isLock":return n;case "isIOS":return A();case "isLoading":return pe;case "isStaticFormat":return e.type==="static";case "isEnded":return R;case "isAutoPlay":return me;case "isFullScreen":return L;case "isValidAddress":return a;case "isFetchDetails":return i;case "isAutoQuality":return E.quality===-1;case "isPressKeySpace":return !n;case "isPressKeyI":return !n&&!u;case "isPressKeyF":return !n&&!u||!!e.vhl_status;case "isPressKeyS":return !n&&!u;case "isPressKeyArrowRight":return !u&&!n;case "isPressKeyArrowLeft":return !u&&!n;case "isPressKeyM":return !u&&!n;case "isPressKeyC":return !n&&!u&&!!p&&p.length>0;case "isSendTimelineLog":return e.type!=="static";case "isReady":return l;case "isSelectedSubtitle":return !!p&&p.length>0&&d;case "isMiniPlayerAndMainPlayerSame":return e.id===k.params.id;case "isVideoHighLighter":return !!e.vhl_status;case "hasTitle":return r.title;case "hasBanner":return r.banner;case "hasStreamLink":return r.stream_link;case "hasManualQuality":return v!=null;case "hasSound":return !!E.volume;case "hasAutoPlay":return e.autoplay==="true";case "hasFullScreenParams":return e.fullscreen==="true";case "hasOnFinishedParams":return !!e.onFinished;case "hasSubtitles":return !!p&&p.length>0;case "hasSubtitlesInDetails":return r.subtitles&&r.subtitles.length>0;case "hasActiveCue":return d&&d.activeCues&&d.activeCues.length>0;case "hasOnPlayParams":return !!e.onPlay;case "hasOnPauseParams":return !!e.onPause;case "hasPlayStatusParams":return e.playStatus!==void 0;case "hasMiniPlayer":return k.params.id;case "hasCurrentTimeParams":return e.currentTime!==void 0;case "hasMarkers":return h.length!==0;case "hasSubtitlesInParams":return e.subtitles&&e.subtitles.length;case "hasOnChangeCurrentTime":return !!e.onChangeCurrentTime;case "hasMultiAudio":return f&&!!f.length;case "skeletonStatusInVhl":return e.vhl_status==="skeleton";case "getDetails":return !!e.type&&e.id;case "getMarkers":return String(e.type)==="vod"&&e.id&&i;case "canPlayVideo":return S;case "setSubtitleFirstPlay":return r.subtitles&&r.subtitles.length>0&&!u&&e.type!=="static";}};var ae=t=>new Promise(e=>setTimeout(e,t*1e3)),P=()=>{let t=localStorage.getItem("hamrahiUUID");return t||(t=Fe(),localStorage.setItem("hamrahiUUID",t)),t.toString()},Fe=()=>{let t="xxxxxxxx-xxxx-Mxxx-Nxxx-x".replace(/[xMN]/g,e=>{let r;return e==="M"?r=Math.floor(1+Math.random()*5):e==="N"?r=Math.floor(8+Math.random()*4):r=Math.floor(Math.random()*16),r.toString(16)});return t+=Date.now().toString(16),t},b=()=>typeof window<"u"&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),x=()=>{let{isFullScreen:t}=s.getState().controller;return b()&&t},re=()=>{let{isFullScreen:t}=s.getState().controller;return b()&&!t},A=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,w=t=>(t<10?"0":"")+t,mr=t=>{let e=Math.floor(t/3600),r=Math.floor(t%3600/60),a=Math.floor(t%3600%60);return e<1?`${w(r)}:${w(a)}`:`${w(e)}:${w(r)}:${w(a)}`},yr=t=>{let e=new URL(t),r=t;return e.search.length?r+=`&uuid=${P()}`:r+=`?uuid=${P()}`},gr=(t,e)=>{try{return [t.target.id,t.target.parentNode.id,t.target.parentNode.parentNode.id,t.target.parentNode.parentNode.parentNode.id,t.target.parentNode.parentNode.parentNode.parentNode.id].includes(e)}catch{return false}},hr=t=>{let e="";t==="mainPlayer"?e=s.getState().videoData.details.stream_link:e=s.getState().miniPlayer.details.stream_link;let r="";return e&&(r=e.split("m3u8")[1]),r?r=`${r}&uuid=${P()}`:r=`?uuid=${P()}`,r},Pr=(t,e)=>{let r=document.getElementById(e),a=document.createElement("span");a.style.width=a.style.height="50px",a.style.left=`${t.touches[0].clientX-r.offsetLeft-25}px`,a.style.top=`${t.touches[0].clientY-r.offsetTop-25}px`,a.classList.add("pl-ripple");let i=r.getElementsByClassName("pl-ripple")[0];i&&i.remove(),r.appendChild(a);};var fr=t=>t>=200&&t<300,Sr=()=>{let t=s.dispatch;t(C()),t(O()),t(X()),t(J());},vr=t=>{let e,r=[];for(e=0;e<t.length;e++)r[e]=t[e].weight+(r[e-1]||0);let a=Math.random()*r[r.length-1];for(e=0;e<r.length&&!(r[e]>a);e++);return t[e].domain},br=t=>{let e=0;performance&&performance.getEntriesByType("navigation")&&(e=performance.getEntriesByType("navigation")[0].duration),t.current=e;},Ar=(t,e,r)=>{let a=e*window.devicePixelRatio,i=r*window.devicePixelRatio,l=[];return c("isTouchScreenPortrait")?l=t.filter(p=>Number(p.split("x")[0].trim())<=a):l=t.filter(p=>Number(p.split("x")[0].trim())<=i||Number(p.split("x")[1].trim())<=a),l.indexOf(l[l.length-1])},T=(t,e)=>{let r={};for(let a in t){let i=e?`${e}_${a}`:a;typeof t[a]=="object"&&!Array.isArray(t[a])?r={...r,...T(t[a],i)}:r[i]=t[a];}return r},wr=t=>{let e={fa:1,en:2};return t.slice().sort((r,a)=>{let i=e[r.lang]||999,l=e[a.lang]||999;return i-l})},Lr=t=>{let e;switch(t){case "fa":e="\u0641\u0627\u0631\u0633\u06CC";break;case "en":e="\u0627\u0646\u06AF\u0644\u06CC\u0633\u06CC";break;case "ar":e="\u0639\u0631\u0628\u06CC";break;case "tr":e="\u062A\u0631\u06A9\u06CC";break;}return e},kr=t=>t.split(/\r?\n|\r|\n/g),xr=t=>{if(t){let e=t.offsetLeft-t.offsetWidth/2,r=window.innerWidth-(t.offsetLeft+t.offsetWidth);if(e>=0&&r>=0)return "inViewport";if(e<0)return "OutViewPortFromLeft";if(r<0)return "OutViewPortFromRight"}};var Tr=t=>(t=t.replace(/\d{2}:\d{2}:\d{2}\.\d{3} --> \d{2}:\d{2}:\d{2}\.\d{3}.*\n/g,""),t=t.replace(/<[^>]+>/g,""),t=t.replace(/\n+/g,`
|
|
2
|
-
`),t=t.trim(),t);e();var Vr=()=>useDispatch(),_r=useSelector;e();var D=()=>document.getElementById("player-tag"),Qr=()=>document.getElementById("mini-player-video-tag"),Br=()=>document.getElementById("time-progress-bar"),Or=()=>s.getState().videoData.videoElementSizeInfo.width-2;
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
`),t=t.trim(),t);e();var Vr=()=>useDispatch(),_r=useSelector;e();e();e();e();e();var D=()=>document.getElementById("player-tag"),Qr=()=>document.getElementById("mini-player-video-tag"),Br=()=>document.getElementById("time-progress-bar"),Or=()=>s.getState().videoData.videoElementSizeInfo.width-2;var Xr=t=>{let{params:e,details:r}=s.getState().videoData,{settings:a}=s.getState().user;return {category:"speedChange",previousSelectedSpeed:a.speed,selectedSpeed:t,id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id,provider:e.provider}},Yr=t=>{let{params:e,details:r}=s.getState().videoData,{qualityLevels:a,manualQuality:i,autoQuality:l}=s.getState().controller;return {category:"qualityChangeRequest",currentPlayingQuality:`${a[c("isAutoQuality")?l??i:i]}P`,previousSelectedQuality:c("isAutoQuality")?"auto":`${a[i]}P`,selectedQuality:t,id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id,provider:e.provider}},Gr=t=>{let{params:e,details:r}=s.getState().videoData,{qualityLevels:a,autoQuality:i}=s.getState().controller,{settings:l}=s.getState().user;return {category:"catchUpLoading",previousVideoTime:Number(sessionStorage.getItem("previousVideoTime")),currentVideoTime:D().currentTime,duration:t,quality:`${c("isAutoQuality")?a[i]:a[l.quality]}P`,isAutoQuality:c("isAutoQuality"),id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id,provider:e.provider}},Jr=t=>{let{params:e,details:r}=s.getState().videoData;return {category:t==="backward"?"backward":"forward",id:Number(e.id),type:e.type,src:r.stream_link?r.stream_link:e.id,provider:e.provider}},Zr=t=>{let{params:e,details:r}=s.getState().videoData;return {category:t,id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id}},zr=(t,e)=>{let{params:r,details:a}=s.getState().videoData;return {category:"brightnessChange",source:t,target:e,id:Number(r.id),type:r.type,src:c("hasStreamLink")?a.stream_link:r.id}},Nr=(t,e)=>{let{params:r,details:a}=s.getState().videoData;return {category:"volumeChange",source:t,target:e,id:Number(r.id),type:r.type,src:c("hasStreamLink")?a.stream_link:r.id}},ea=t=>{let{params:e,details:r}=s.getState().videoData;return {category:t,id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id}},se=(t,e,r,a)=>({category:"player-error",type:t,message:e,statusCode:r,url:a}),ta=(t,e)=>{let{params:r,details:a}=s.getState().videoData,{duration:i}=s.getState().controller;return {category:"video-timeline",video_id:+r.id,video_type:r.type,start:t,end:e,watchedDuration:e-t,video_duration:Math.floor(i),clientUUID:P(),user_id:a.user_id,content_type:a.content_type,content_id:a.content_id}},ra=(t,e,r)=>{let{params:a,details:i}=s.getState().videoData;return {category:"autoQualityChange",sourceQuality:t,targetQuality:e,diffQuality:r,id:Number(a.id),type:a.type,src:c("hasStreamLink")?i.stream_link:a.id,provider:a.provider}},aa=(t,e)=>{let{params:r,details:a}=s.getState().videoData;return {category:"pingpong",id:Number(r.id),type:r.type,src:c("hasStreamLink")?a.stream_link:r.id,PingPongDuration:Number((new Date().getTime()-t).toFixed(2)),PingPongSourceQuality:`${e[0]}P`,PingPongTargetQuality:`${e[1]}P`,provider:r.provider}},sa=t=>{let{params:e,details:r}=s.getState().videoData;return {category:t?"playVideo":"pauseVideo",id:Number(e.id),type:e.type,src:r.stream_link?r.stream_link:e.id,provider:e.provider}},oa=(t,e,r,a,i)=>{let{params:l,details:p}=s.getState().videoData,d=Date.now()-i.current+t+e,h=window.performance.memory,f=JSON.parse(JSON.stringify(window.performance.timing));return {category:"initLog",id:Number(l.id),type:l.type,origin:new URL(c("hasStreamLink")?p.stream_link:l.id).origin,src:c("hasStreamLink")?p.stream_link:l.id,loading:t,bannerLoading:!c("hasBanner")||r<0?0:r,waiting:e,firstChunkPlaying:a<0?0:a,totalTime:d,provider:l.provider,performance:T({memory:h,timing:f},"performance"),userAgent:window.navigator.userAgent}},ia=(t,e,r,a,i)=>{let{params:l,details:p}=s.getState().videoData,{settings:d}=s.getState().user,h=Date.now()-r.current;return {category:"loading",id:Number(l.id),type:l.type,src:c("hasStreamLink")?p.stream_link:l.id,duration:t,quality:`${e}P`,isAutoQuality:c("isAutoQuality"),previousLoaderDiff:h,counter:a.current,loadingPercentile:Number((t/h).toFixed(2)),videoTime:D().currentTime,videoEntranceTime:i,speed:d.speed,provider:l.provider}},na=t=>{let{params:e,details:r}=s.getState().videoData;return {category:"subtitle",language:t,id:Number(e.id),type:e.type,src:c("hasStreamLink")?r.stream_link:e.id}},la=(t,e,r,a,i)=>{let{params:l,details:p}=s.getState().videoData;return {category:"eventMarkerClick",video_id:Number(l.id),markerId:t,markerTime:e,markerTitle:r,markerDescription:a,markerSticker:i,type:l.type,src:c("hasStreamLink")?p.stream_link:l.id,provider:l.provider}};var ie=t=>{t&&oe(se(t.type,t.message,t.statusCode,t.url));};var M=async({url:t,method:e="GET",data:r,headers:a,retryCount:i=1,maxRetryCount:l=0,errorMessage:p,retryPolicy:d,errorCallback:h,timeoutCount:f})=>{let u={url:t,method:e,headers:{...a,"Content-Type":"application/json"},timeout:f?f*1e3:void 0};r?e==="GET"?u={...u,params:{uuid:s.getState().videoData.params.uuid,provider:s.getState().videoData.params.provider==="unknown"?void 0:s.getState().videoData.params.provider,...r}}:u={...u,data:{uuid:s.getState().videoData.params.uuid,provider:s.getState().videoData.params.provider==="unknown"?void 0:s.getState().videoData.params.provider,...r}}:e==="GET"?u={...u,params:{uuid:s.getState().videoData.params.uuid,provider:s.getState().videoData.params.provider==="unknown"?void 0:s.getState().videoData.params.provider}}:u={...u,data:{uuid:s.getState().videoData.params.uuid,provider:s.getState().videoData.params.provider==="unknown"?void 0:s.getState().videoData.params.provider}};try{return await Re(u)}catch(n){if(ie({type:"API-ERROR",message:n.message?n.message:"",statusCode:n.response&&n.response.status?n.response.status:void 0,url:t}),!(n&&n.response&&n.response.status===401)){h&&h(n.response.status,n.response.message);let S=0,v=0;if(d!==void 0){for(let g=0;g<d.length;g++)if((d[g].codeAbove&&n.response.status>=d[g].codeAbove||d[g].codeBelow&&n.response.status<=d[g].codeBelow)&&(d[g].excludeCodes.length===0||!d[g].excludeCodes.includes(n.response.status))||d[g].includeCodes.length===0||d[g].includeCodes.includes(n.response.status)){v=d[g].count,S=d[g].delay;break}}else v=l,S=i+1;if(i<v)return await ae(S),M({url:t,method:e,data:r,headers:a,retryCount:i+1,errorMessage:p,retryPolicy:d,errorCallback:h});if(n.response)return {data:n.response.data?n.response.data:{detail:"\u0639\u0645\u0644\u06CC\u0627\u062A \u0628\u0627 \u062E\u0637\u0627 \u0645\u0648\u0627\u062C\u0647 \u0634\u062F\u0647 \u0627\u0633\u062A."},status:n.response.status}}}};e();e();var I=le(),F=(de(),d(ue)),V=()=>(F?I.baseUrl:process.env.baseUrl)+"/live/api",_=()=>F?I.fluentdUrl:process.env.fluentdUrl,La=()=>(F?I.baseUrl:process.env.baseUrl)+"/emoji";var ce=()=>({vod:{getVodUrl:`${V()}/v1/live/details/vod/`,getMarkerUrl:t=>`${V()}/v1/live/list-event/vod/${t}/`},videoTimelineLog:`${_()}/video-timeline.log`,logs:`${_()}/cafevideo-endpoint.log`});var oe=t=>{let{details:e,params:r}=s.getState().videoData,a={...t,timestamp:Date.now(),clientUUID:P(),uuid:P(),link:window.location.href,user_id:e.user_id,live_id:null,format:void 0,content_type:e.content_type,content_id:e.content_id,daaniHashCode:r.daaniHashCode};M({url:ce().logs,method:"post",data:a});};export{Ar as $,ht as A,sa as Aa,Pt as B,oa as Ba,ft as C,ia as Ca,Ft as D,na as Da,Vt as E,la as Ea,_t as F,ie as Fa,Rt as G,M as Ga,Ut as H,J as I,wt as J,Lt as K,Kt as L,qt as M,Ct as N,Ht as O,s as P,P as Q,b as R,mr as S,yr as T,gr as U,hr as V,Pr as W,fr as X,Sr as Y,vr as Z,br as _,Be as a,wr as aa,$e as b,Lr as ba,Ke as c,kr as ca,qe as d,xr as da,Ce as e,Tr as ea,He as f,c as fa,je as g,Vr as ga,We as h,_r as ha,Xe as i,La as ia,Ye as j,ce as ja,Ge as k,oe as ka,Je as l,D as la,Ze as m,Qr as ma,ze as n,Br as na,Ne as o,Or as oa,et as p,Xr as pa,tt as q,Yr as qa,it as r,Gr as ra,nt as s,Jr as sa,lt as t,Zr as ta,dt as u,zr as ua,ct as v,Nr as va,pt as w,ea as wa,mt as x,ta as xa,yt as y,ra as ya,gt as z,aa as za};//# sourceMappingURL=chunk-FPUBUJN6.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-FPUBUJN6.mjs.map
|