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
package/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$4,d,C as C$1,b}from'./chunk-
|
|
1
|
+
import {a as a$4,d,C as C$1,b}from'./chunk-MSI72J5J.mjs';import {a}from'./chunk-OEFD3YXU.mjs';import {a as a$1,c as c$2,b as b$1}from'./chunk-A2WOHDUE.mjs';import {c as c$1,a as a$5,e as e$1,f,d as d$1}from'./chunk-QZJECTZQ.mjs';import {Fa,P,ha,la,Y,fa,ga,L,ma,c,N as N$1,a as a$3,O,Q,s,x}from'./chunk-FPUBUJN6.mjs';import {a as a$2}from'./chunk-TM66GJCG.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {Provider,shallowEqual}from'react-redux';import Ae,{useEffect,useRef}from'react';import C from'next/dynamic';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import _e from'next/legacy/image';import S from'hls.js';e();e();e();e();var ye=e=>{let r=ga(),t={},o=()=>{r(s(t)),r(x(true));},p=()=>{e.uuid&&(localStorage.setItem("hamrahiUUID",e.uuid),t.uuid=e.uuid);},E=()=>{t={provider:"cafevdo",...e};},d=async()=>{let ce=e.subtitles?await c$2(e.subtitles):[];t={uuid:Q(),provider:"cafevdo",...e,subtitles:ce,id:e.id?window.atob(e.id):void 0,banner:e.banner&&e.banner!=="undefined"?e.banner:void 0};},fe=async()=>{t={},Object.keys(e).includes("type")&&(String(e.type)==="vod"?E():String(e.type)==="static"&&await d(),p(),o());};useEffect(()=>{fe();},[e]);},j=ye;e();e();var he=(e,r)=>{let t=useRef(r);useEffect(()=>{t.current=r;},[]),useEffect(()=>{let o=p=>{p.code===e&&!["INPUT","TEXTAREA"].includes(p.target.nodeName)&&!p.target.isContentEditable&&t.current(p);};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]);},u=he;var ve=()=>{u("Space",e=>{fa("isPressKeySpace")&&a$5(e);}),u("ArrowRight",e=>{fa("isPressKeyArrowRight")&&e$1("forward",15,e);}),u("ArrowLeft",e=>{fa("isPressKeyArrowLeft")&&e$1("backward",15,e);}),u("KeyI",()=>{fa("isPressKeyI")&&la().requestPictureInPicture();}),u("KeyF",()=>{fa("isPressKeyF")&&f();}),u("KeyM",()=>{if(fa("isPressKeyM")){let{settings:e}=P.getState().user;d$1(e.volume?0:50);}}),u("KeyC",()=>{fa("isPressKeyC")&&b$1();});},ee=ve;var be=C(()=>import('./staticPlayer-KE3BXILD.mjs')),Ie=C(()=>import('./vodPlayer-ZWLHRYSH.mjs')),Se=C(()=>import('./VideoHighLighter-AA7I6AFZ.mjs')),Ee=e=>{let{params:r}=ha(({videoData:{isReady:o,params:p}})=>({isReady:o,params:p}),shallowEqual);if(useEffect(()=>(r.id&&e.params.id!==r.id&&(r.type==="static"&&(la()?.pause(),la().removeAttribute("src"),la().load()),Y()),()=>{r.id&&Y();}),[e.params.id]),j(e.params),ee(),ha(({controller:{isFullScreen:o}})=>({isFullScreen:o}),shallowEqual),e.params.vhl_status)return jsx(Se,{});let t=jsx(Fragment,{});return fa("isReady")&&(t=jsx("div",{className:`${!fa("isTouchScreen")&&"pl-rounded-[12px]"}`,style:{zIndex:1e6,touchAction:"pan-y",userSelect:"none"},children:fa("isStaticFormat")?jsx(be,{}):jsx(Ie,{})})),jsxs("div",{dir:"rtl",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${fa("isFullScreen")&&"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 pl-w-screen pl-h-screen pl-rounded-none"}`,id:"parent-player",children:[fa("isFirstPlay")&&jsx("div",{className:`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${!fa("isTouchScreen")&&!fa("isFullScreen")&&"pl-rounded-[12px]"}`,children:jsx(a,{})}),t]})},ie=Ee;e();var N=class extends Ae.Component{state={hasError:false,error:null,errorInfo:null};static getDerivedStateFromError(r){return {hasError:true}}componentDidCatch(r,t){this.setState({error:r,errorInfo:t}),Fa({type:"OTHER_ERROR",message:r.message});}render(){return this.state.hasError?jsx(Fragment,{}):this.props.children}},I=N;var De=({params:e})=>jsx(Provider,{store:P,children:jsx(I,{children:jsx(ie,{params:e})})});e();e();e();var Ke=()=>(ha(({miniPlayer:{play:e}})=>({play:e}),shallowEqual),jsx("div",{className:`${!fa("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsx(_e,{alt:"",src:fa("isPlayMiniPlayer")?a$2.bigPause:a$2.bigPlay,width:20,height:20,onClick:e=>c$1(e),onDoubleClick:e=>e.stopPropagation(),className:`${fa("isPlayMiniPlayer")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),te=Ke;e();e();var ke=()=>{let e=ga(),r=ha(o=>o.miniPlayer.details),t=ha(o=>o.miniPlayer.params);return useEffect(()=>{let o=new S(d());return S.isSupported()?(o.attachMedia(document.getElementById("mini-player-video-tag")),o.on(S.Events.MEDIA_ATTACHED,()=>C$1(o))):la().canPlayType("application/vnd.apple.mpegurl")&&(la().src=r.stream_link,b()),()=>{e(O()),o.detachMedia(),o.off(S.Events.MEDIA_ATTACHED,()=>C$1(o));}},[]),useEffect(()=>{t.currentTime&&(e(N$1(true)),ma().currentTime=t.currentTime,e(a$3(false)),la()?.pause());},[t.currentTime]),jsx(Fragment,{children:jsx("video",{onPlay:()=>e(N$1(true)),onEnded:()=>e(N$1(false)),onError:a$4,poster:t.banner?t.banner:r.banner,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true,muted:true})})},ne=ke;e();var He=()=>{let e=ga(),r=ha(t=>t.miniPlayer.params);return useEffect(()=>{r.currentTime&&(e(N$1(true)),ma().currentTime=r.currentTime,e(a$3(false)),la()?.pause());},[r.currentTime]),jsx("video",{poster:r.banner,onPlay:()=>e(N$1(true)),onEnded:()=>e(N$1(false)),onError:a$4,src:r.id,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true})},se=He;var Ue=()=>{let e=ha(r=>r.miniPlayer.params.type);return jsx(Fragment,{children:e==="static"?jsx(se,{}):jsx(ne,{})})},me=Ue;var de=({params:e})=>{let r=ga(),t=ha(d=>d.miniPlayer.details),o=ha(d=>d.miniPlayer.params);ha(d=>d.miniPlayer.play);let p=ha(d=>d.videoData.params);useEffect(()=>{r(L(e));},[]);let E=async()=>await a$1(e.id);return useEffect(()=>{e.id&&e.type==="vod"&&E();},[e.id]),jsx(Fragment,{children:t.stream_link||o.type==="static"&&o.id?jsxs("div",{id:"miniPlayer-video-area",style:{zIndex:1000003},className:"pl-relative pl-w-full pl-h-full",children:[jsx("div",{className:`pl-absolute pl-z-[1000000] pl-top-3 pl-right-3 pl-cursor-pointer ${fa("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,onClick:()=>{p.id===o.id&&(la().currentTime=ma().currentTime,r(c(ma().currentTime))),localStorage.setItem("close-miniPlayer","true"),e.onClose();},children:jsx(_e,{className:"pl-cursor-pointer",src:a$2.closeSquare,alt:"close-square",width:16,height:16})}),jsx("div",{className:`pl-w-full pl-absolute pl-bottom-0 animate__animated animate__faster pl-z-[1000000] ${fa("isActiveElements")&&!fa("isLoading")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,children:jsx("div",{className:"pl-w-full pl-flex pl-justify-center",children:jsx(te,{})})}),jsx(me,{})]}):jsx("div",{className:"pl-w-full pl-h-full pl-bg-white"})})};var Qe=({params:e})=>jsx(Provider,{store:P,children:jsx(I,{children:jsx(de,{params:e})})});export{Qe as MiniPlayerLibrary,De as VideoPlayerLibrary};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/index.ts","../src/videoPlayerLibrary/videoPlayerLibrary.tsx","../src/videoPlayerLibrary/components/videoPlayer/videoPlayer.tsx","../src/videoPlayerLibrary/helpers/hooks/useHandleParams.tsx","../src/videoPlayerLibrary/helpers/hooks/useHandleKeyPress.tsx","../src/videoPlayerLibrary/helpers/hooks/useKeyPress.tsx","../src/videoPlayerLibrary/helpers/errorBoundary/errorBoundary.tsx","../src/videoPlayerLibrary/miniPlayerLibrary.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/miniPlayer.tsx","../src/videoPlayerLibrary/components/custom-components/playPause/miniPlayerPlayPause.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/videoTag.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerNonStaticVideoTag.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerStaticVideoTag.tsx"],"names":["init_esm_shims","useHandleParams","query","dispatch","useAppDispatch","queryParams","handleSetParamsInRedux","setPlayerParams","setIsReady","handleAddUUID","handleVodParams","handleStaticParams","getUUID","handleParams","useEffect","useHandleParams_default","useKeyPress","key","cb","callbackRef","useRef","handleKeyPress","event","useKeyPress_default","useHandleKeyPress","conditions","handlePlayPause","handleBackwardForward","mainPlayerVideoTag","handleFullScreen","settings","store_default","handleChangeSoundVolume","handleSubtitle","useHandleKeyPress_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","shallowEqual","clearRedux","isFullScreen","jsx","element","Fragment","jsxs","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","Image","importImages_default","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","setPlay","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","setCurrentTime","MiniPlayerLibrary"],"mappings":"kmBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CASA,IAAMC,EAAAA,CAAmBC,CAAAA,EAAe,CACtC,IAAMC,CAAAA,CAAWC,EAAAA,EAAe,CAE5BC,EAAuB,EAAC,CAEtBC,CAAAA,CAAyB,IAAM,CACnCH,CAAAA,CAASI,CAAAA,CAAgBF,CAAW,CAAC,EACrCF,CAAAA,CAASK,CAAAA,CAAW,IAAI,CAAC,EAC3B,CAAA,CAEMC,CAAAA,CAAgB,IAAM,CACpBP,CAAAA,CAAM,IAAA,GACV,YAAA,CAAa,OAAA,CAAQ,cAAeA,CAAAA,CAAM,IAAK,CAAA,CAC/CG,CAAAA,CAAY,KAAOH,CAAAA,CAAM,IAAA,EAE7B,CAAA,CAEMQ,CAAAA,CAAkB,IAAM,CAC5BL,CAAAA,CAAc,CACZ,QAAA,CAAU,UACV,GAAGH,CACL,EACF,CAAA,CAEMS,EAAqB,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,QAAA,CAAAsB,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,sCACX,QAAA,CAAAA,GAAAA,CAACmB,EAAAA,CAAA,EAAoB,EACzB,CAAA,CACR,CAAA,CACAnB,GAAAA,CAACsC,EAAAA,CAAA,EAAS,CAAA,CAAA,CACd,CAAA,CAEAtC,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,iCAAA,CAAkC,CAAA,CAGzD,CAER,CAAA,CDhEO,IAAM8C,EAAAA,CAAoB,CAAC,CAChC,MAAA,CAAApD,CACF,CAAA,GAIIM,IAACa,QAAAA,CAAA,CAAS,KAAA,CAAO7B,CAAAA,CACf,SAAAgB,GAAAA,CAACW,CAAAA,CAAA,CACC,QAAA,CAAAX,IAACuC,EAAAA,CAAA,CAAW,MAAA,CAAQ7C,CAAAA,CAAQ,EAC9B,CAAA,CACF","file":"index.mjs","sourcesContent":["export { VideoPlayerLibrary } from \"./videoPlayerLibrary\";\r\nexport { MiniPlayerLibrary } from \"./miniPlayerLibrary\";\r\n","\"use client\";\r\n\r\nimport { Provider } from \"react-redux\";\r\nimport { IParams } from \"./helpers/interfaces/interfaces\";\r\nimport store from \"./helpers/redux/store\";\r\nimport VideoPlayer from \"./components/videoPlayer/videoPlayer\";\r\nimport ErrorBoundary from \"./helpers/errorBoundary/errorBoundary\";\r\n\r\nexport const VideoPlayerLibrary = ({ params }: { params: IParams }) => {\r\n return (\r\n <Provider store={store}>\r\n <ErrorBoundary>\r\n <VideoPlayer params={params} />\r\n </ErrorBoundary>\r\n </Provider>\r\n );\r\n};\r\n","\"use client\";\r\n\r\nimport { conditions } from \"../../helpers/conditions/conditions\";\r\nimport useHandleParams from \"../../helpers/hooks/useHandleParams\";\r\nimport { ConditionName, PlayerTypes, zIndex } from \"../../helpers/interfaces/enums\";\r\nimport { IParams } from \"../../helpers/interfaces/interfaces\";\r\nimport { useAppSelector } from \"../../helpers/redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport dynamic from \"next/dynamic\";\r\nimport useHandleKeyPress from \"../../helpers/hooks/useHandleKeyPress\";\r\nimport { useEffect } from \"react\";\r\nimport { clearRedux } from \"../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../helpers/constants\";\r\nimport Loader from \"../custom-components/loader/loader\";\r\n\r\nconst StaticPlayer = dynamic(() => import(\"./staticPlayer/staticPlayer\"));\r\nconst VodPlayer = dynamic(() => import(\"./vodPlayer/vodPlayer\"));\r\nconst VideoHighLighter = dynamic(() => import(\"./videoHighLighter/VideoHighLighter\"));\r\n\r\ninterface IProps {\r\n params: IParams;\r\n}\r\n\r\nconst VideoPlayer = (props: IProps) => {\r\n const { params } = useAppSelector(({ videoData: { isReady, params } }) => ({ isReady, params }), shallowEqual);\r\n useEffect(() => {\r\n if (params.id && props.params.id !== params.id) {\r\n if (params.type === PlayerTypes.static) {\r\n mainPlayerVideoTag()?.pause();\r\n mainPlayerVideoTag().removeAttribute(\"src\");\r\n mainPlayerVideoTag().load();\r\n }\r\n clearRedux();\r\n }\r\n return () => {\r\n if (params.id) clearRedux();\r\n };\r\n }, [props.params.id]);\r\n\r\n useHandleParams(props.params);\r\n useHandleKeyPress();\r\n useAppSelector(({ controller: { isFullScreen } }) => ({ isFullScreen }), shallowEqual);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div\r\n className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen, touchAction: \"pan-y\", userSelect: \"none\" }}\r\n >\r\n {conditions(ConditionName.isStaticFormat) ? <StaticPlayer /> : <VodPlayer />}\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n dir=\"rtl\"\r\n className={`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${\r\n conditions(ConditionName.isFullScreen) && \"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 pl-w-screen pl-h-screen pl-rounded-none\"\r\n }`}\r\n id=\"parent-player\"\r\n >\r\n {conditions(ConditionName.isFirstPlay) && (\r\n <div\r\n className={`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${\r\n !conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"pl-rounded-[12px]\"\r\n }`}\r\n >\r\n <Loader />\r\n </div>\r\n )}\r\n {element}\r\n </div>\r\n );\r\n};\r\n\r\nexport default VideoPlayer;\r\n","\"use client\";\r\n\r\nimport { useEffect } from \"react\";\r\nimport { getUUID } from \"../helpers\";\r\nimport { useAppDispatch } from \"../redux/hooks\";\r\nimport { IParams } from \"../interfaces/interfaces\";\r\nimport { setIsReady, setPlayerParams } from \"../redux/slices/videoDataSlice\";\r\nimport { PlayerTypes } from \"../interfaces/enums\";\r\n\r\nconst useHandleParams = (query: any) => {\r\n const dispatch = useAppDispatch();\r\n\r\n let queryParams: IParams = {};\r\n\r\n const handleSetParamsInRedux = () => {\r\n dispatch(setPlayerParams(queryParams));\r\n dispatch(setIsReady(true));\r\n };\r\n\r\n const handleAddUUID = () => {\r\n if (!!query.uuid) {\r\n localStorage.setItem(\"hamrahiUUID\", query.uuid!);\r\n queryParams.uuid = query.uuid;\r\n }\r\n };\r\n\r\n const handleVodParams = () => {\r\n queryParams = {\r\n provider: \"cafevdo\",\r\n ...query,\r\n };\r\n };\r\n\r\n const handleStaticParams = () => {\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n id: query.id ? window.atob(query.id) : undefined,\r\n banner: query.banner && query.banner !== \"undefined\" ? query.banner : undefined,\r\n };\r\n };\r\n\r\n const handleParams = async () => {\r\n queryParams = {};\r\n if (Object.keys(query).includes(\"type\")) {\r\n if (String(query.type) === PlayerTypes.vod) handleVodParams();\r\n else if (String(query.type) === PlayerTypes.static) handleStaticParams();\r\n handleAddUUID();\r\n handleSetParamsInRedux();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n handleParams();\r\n }, [query]);\r\n};\r\n\r\nexport default useHandleParams;\r\n","import { conditions } from \"../conditions/conditions\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { handleBackwardForward, handleChangeSoundVolume, handleFullScreen, handlePlayPause } from \"../redux/actions/controller.actions\";\r\nimport { handleSubtitle } from \"../redux/actions/videoData.actions\";\r\nimport store from \"../redux/store\";\r\nimport useKeyPress from \"./useKeyPress\";\r\n\r\nconst useHandleKeyPress = () => {\r\n useKeyPress(\"Space\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeySpace)) handlePlayPause(event);\r\n });\r\n useKeyPress(\"ArrowRight\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowRight)) handleBackwardForward(\"forward\", 15, event);\r\n });\r\n useKeyPress(\"ArrowLeft\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowLeft)) handleBackwardForward(\"backward\", 15, event);\r\n });\r\n useKeyPress(\"KeyI\", () => {\r\n if (conditions(ConditionName.isPressKeyI)) mainPlayerVideoTag().requestPictureInPicture();\r\n });\r\n useKeyPress(\"KeyF\", () => {\r\n if (conditions(ConditionName.isPressKeyF)) handleFullScreen();\r\n });\r\n useKeyPress(\"KeyM\", () => {\r\n if (conditions(ConditionName.isPressKeyM)) {\r\n const { settings } = store.getState().user;\r\n handleChangeSoundVolume(settings.volume ? 0 : 50);\r\n }\r\n });\r\n useKeyPress(\"KeyC\", () => {\r\n if (conditions(ConditionName.isPressKeyC)) handleSubtitle();\r\n });\r\n};\r\n\r\nexport default useHandleKeyPress;\r\n","import { useEffect, useRef } from \"react\";\r\n\r\nconst useKeyPress = (key: string, cb: any) => {\r\n const callbackRef = useRef(cb);\r\n\r\n useEffect(() => {\r\n callbackRef.current = cb;\r\n }, []);\r\n\r\n useEffect(() => {\r\n const handleKeyPress = (event: any) => {\r\n if (event.code === key && ![\"INPUT\", \"TEXTAREA\"].includes(event.target.nodeName) && !event.target.isContentEditable) callbackRef.current(event);\r\n };\r\n\r\n document.addEventListener(\"keydown\", handleKeyPress);\r\n\r\n return () => document.removeEventListener(\"keydown\", handleKeyPress);\r\n }, [key]);\r\n};\r\nexport default useKeyPress;\r\n","import React from \"react\";\r\nimport { errorLogProvider } from \"./errorBoundaryFunctions\";\r\n\r\nclass ErrorBoundary extends React.Component {\r\n state = { hasError: false, error: null, errorInfo: null };\r\n\r\n static getDerivedStateFromError(error: any) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n\r\n componentDidCatch(error: any, errorInfo: any) {\r\n // You can also log the error to an error reporting service\r\n this.setState({ error: error, errorInfo: errorInfo });\r\n errorLogProvider({ type: \"OTHER_ERROR\", message: error.message });\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) {\r\n return <></>;\r\n }\r\n\r\n return (this.props as any).children;\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;\r\n","\"use client\";\r\n\r\nimport { Provider } from \"react-redux\";\r\nimport { IMiniPlayerParams } from \"./helpers/interfaces/interfaces\";\r\nimport store from \"./helpers/redux/store\";\r\nimport { MiniPlayer } from \"./components/custom-components/miniPlayer/miniPlayer\";\r\nimport ErrorBoundary from \"./helpers/errorBoundary/errorBoundary\";\r\n\r\nexport const MiniPlayerLibrary = ({\r\n params,\r\n}: {\r\n params: IMiniPlayerParams;\r\n}) => {\r\n return (\r\n <Provider store={store}>\r\n <ErrorBoundary>\r\n <MiniPlayer params={params} />\r\n </ErrorBoundary>\r\n </Provider>\r\n );\r\n};\r\n","\"use client\";\r\n\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { useEffect } from \"react\";\r\nimport { IMiniPlayerParams } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setMiniPlayerInfo } from \"../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport MiniPlayerPlayPause from \"../playPause/miniPlayerPlayPause\";\r\nimport VideoTag from \"./videoTag/videoTag\";\r\nimport { getVodDetails } from \"../../../helpers/redux/actions/videoData.actions\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { setCurrentTime } from \"../../../helpers/redux/slices/controllerSlice\";\r\n\r\nexport const MiniPlayer = ({ params }: { params: IMiniPlayerParams }) => {\r\n const dispatch = useAppDispatch();\r\n const details = useAppSelector(state => state.miniPlayer.details);\r\n const miniPlayerParams = useAppSelector(state => state.miniPlayer.params);\r\n useAppSelector(state => state.miniPlayer.play);\r\n const mainPlayerParams = useAppSelector(state => state.videoData.params);\r\n \r\n useEffect(() => {\r\n dispatch(setMiniPlayerInfo(params));\r\n },[])\r\n\r\n const handleGetDetail = async () => await getVodDetails(params.id);\r\n\r\n useEffect(() => {\r\n if(params.id && params.type === \"vod\") handleGetDetail();\r\n },[params.id])\r\n\r\n return (\r\n <>\r\n {details.stream_link || (miniPlayerParams.type === \"static\" && !!miniPlayerParams.id) ? (\r\n <div id=\"miniPlayer-video-area\" style={{zIndex: zIndex.miniPlayer}} className=\"pl-relative pl-w-full pl-h-full\">\r\n <div \r\n className={`pl-absolute pl-z-[1000000] pl-top-3 pl-right-3 pl-cursor-pointer ${conditions(ConditionName.isActiveElements) ? \"animate__fadeIn pl-pointer-events-auto\" : \"animate__fadeOut pl-pointer-events-none\" }`} \r\n onClick={() => {\r\n if(mainPlayerParams.id === miniPlayerParams.id) {\r\n mainPlayerVideoTag().currentTime = miniPlayerVideoTag().currentTime;\r\n dispatch(setCurrentTime(miniPlayerVideoTag().currentTime));\r\n }\r\n localStorage.setItem(\"close-miniPlayer\", \"true\");\r\n params.onClose();\r\n }}\r\n > \r\n <Image\r\n className=\"pl-cursor-pointer\"\r\n src={IMAGES.closeSquare}\r\n alt=\"close-square\"\r\n width={16}\r\n height={16}\r\n />\r\n </div>\r\n <div className={`pl-w-full pl-absolute pl-bottom-0 animate__animated animate__faster pl-z-[1000000] ${conditions(ConditionName.isActiveElements) && !conditions(ConditionName.isLoading)\r\n ? \"animate__fadeIn pl-pointer-events-auto\"\r\n : \"animate__fadeOut pl-pointer-events-none\"\r\n }`}>\r\n <div className=\"pl-w-full pl-flex pl-justify-center\">\r\n <MiniPlayerPlayPause />\r\n </div>\r\n </div>\r\n <VideoTag />\r\n </div>\r\n ) : (\r\n <div className=\"pl-w-full pl-h-full pl-bg-white\" />\r\n )}\r\n\r\n </>\r\n )\r\n}","import { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport { handlePlayerPauseMiniPlayer } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport Image from \"next/legacy/image\";\r\n\r\nconst MiniPlayerPlayPause = () => {\r\n useAppSelector(({ miniPlayer: { play } }) => ({ play }), shallowEqual);\r\n\r\n return (\r\n <div\r\n className={`${!conditions(ConditionName.isTouchScreen) && \"hover:pl-scale-125\"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`}\r\n onContextMenu={(event) => event.preventDefault()}\r\n >\r\n <Image\r\n alt=\"\"\r\n src={conditions(ConditionName.isPlayMiniPlayer) ? IMAGES.bigPause : IMAGES.bigPlay}\r\n width={20}\r\n height={20}\r\n onClick={(event: any) => handlePlayerPauseMiniPlayer(event)}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n className={`${conditions(ConditionName.isPlayMiniPlayer) ? \"pl-big-play-icon\" : \"pl-big-pause-icon\"}`}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nexport default MiniPlayerPlayPause;\r\n","import { PlayerTypes } from \"../../../../helpers/interfaces/enums\";\r\nimport { useAppSelector } from \"../../../../helpers/redux/hooks\";\r\nimport MiniPlayerNonStaticVideoTag from \"./miniPlayerNonStaticVideoTag\";\r\nimport MiniPlayerStaticVideoTag from \"./miniPlayerStaticVideoTag\";\r\n\r\nconst VideoTag = () => {\r\n \r\n const type = useAppSelector(state => state.miniPlayer.params.type);\r\n return (\r\n <>{type === PlayerTypes.static ? <MiniPlayerStaticVideoTag /> : <MiniPlayerNonStaticVideoTag />}</>\r\n )\r\n}\r\n\r\nexport default VideoTag;","import Hls from \"hls.js\";\r\nimport { useEffect } from \"react\";\r\nimport {\r\n appendQueryParamsToChunksIOS,\r\n handleMiniPlayerHlsConfig,\r\n handleMiniPlayerMediaAttached,\r\n handleVideoError,\r\n} from \"../../../../helpers/redux/actions/playerCore.actions\";\r\nimport {\r\n useAppDispatch,\r\n useAppSelector,\r\n} from \"../../../../helpers/redux/hooks\";\r\nimport {\r\n mainPlayerVideoTag,\r\n miniPlayerVideoTag,\r\n} from \"../../../../helpers/constants\";\r\nimport {\r\n setClearMiniPlayerSlice,\r\n setPlayMiniPlayer,\r\n} from \"../../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport { setPlay } from \"../../../../helpers/redux/slices/controllerSlice\";\r\n\r\nconst MiniPlayerNonStaticVideoTag = () => {\r\n const dispatch = useAppDispatch();\r\n const details = useAppSelector((state) => state.miniPlayer.details);\r\n const params = useAppSelector((state) => state.miniPlayer.params);\r\n\r\n useEffect(() => {\r\n let hls = new Hls(handleMiniPlayerHlsConfig());\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(\r\n document.getElementById(`mini-player-video-tag`) as HTMLMediaElement\r\n );\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () =>\r\n handleMiniPlayerMediaAttached(hls)\r\n );\r\n } else if (\r\n mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")\r\n ) {\r\n mainPlayerVideoTag().src = details.stream_link!;\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n return () => {\r\n dispatch(setClearMiniPlayerSlice());\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () =>\r\n handleMiniPlayerMediaAttached(hls)\r\n );\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (params.currentTime) {\r\n dispatch(setPlayMiniPlayer(true));\r\n miniPlayerVideoTag().currentTime = params.currentTime;\r\n dispatch(setPlay(false));\r\n mainPlayerVideoTag()?.pause();\r\n }\r\n }, [params.currentTime]);\r\n\r\n return (\r\n <>\r\n <video\r\n onPlay={() => dispatch(setPlayMiniPlayer(true))}\r\n onEnded={() => dispatch(setPlayMiniPlayer(false))}\r\n onError={handleVideoError}\r\n poster={params.banner ? params.banner : details.banner}\r\n id={`mini-player-video-tag`}\r\n className=\"pl-absolute pl-bg-black pl-w-full pl-h-full\"\r\n autoPlay={true}\r\n muted={true}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport default MiniPlayerNonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../../helpers/redux/hooks\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../../../helpers/constants\";\r\nimport { setPlayMiniPlayer } from \"../../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport { setPlay } from \"../../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleVideoError } from \"../../../../helpers/redux/actions/playerCore.actions\";\r\n\r\nconst MiniPlayerStaticVideoTag = () => {\r\n\r\n const dispatch = useAppDispatch();\r\n const params = useAppSelector(state => state.miniPlayer.params);\r\n\r\n useEffect(() => {\r\n if(params.currentTime) {\r\n dispatch(setPlayMiniPlayer(true));\r\n miniPlayerVideoTag().currentTime = params.currentTime;\r\n dispatch(setPlay(false));\r\n mainPlayerVideoTag()?.pause();\r\n }\r\n },[params.currentTime])\r\n\r\n return (\r\n <video \r\n poster={params.banner} \r\n onPlay={() => dispatch(setPlayMiniPlayer(true))}\r\n onEnded={() => dispatch(setPlayMiniPlayer(false))}\r\n onError={handleVideoError}\r\n src={params.id} \r\n id={`mini-player-video-tag`} \r\n className=\"pl-absolute pl-bg-black pl-w-full pl-h-full\"\r\n autoPlay\r\n />\r\n )\r\n}\r\n\r\nexport default MiniPlayerStaticVideoTag;"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/index.ts","../src/videoPlayerLibrary/videoPlayerLibrary.tsx","../src/videoPlayerLibrary/components/videoPlayer/videoPlayer.tsx","../src/videoPlayerLibrary/helpers/hooks/useHandleParams.tsx","../src/videoPlayerLibrary/helpers/hooks/useHandleKeyPress.tsx","../src/videoPlayerLibrary/helpers/hooks/useKeyPress.tsx","../src/videoPlayerLibrary/helpers/errorBoundary/errorBoundary.tsx","../src/videoPlayerLibrary/miniPlayerLibrary.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/miniPlayer.tsx","../src/videoPlayerLibrary/components/custom-components/playPause/miniPlayerPlayPause.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/videoTag.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerNonStaticVideoTag.tsx","../src/videoPlayerLibrary/components/custom-components/miniPlayer/videoTag/miniPlayerStaticVideoTag.tsx"],"names":["init_esm_shims","useHandleParams","query","dispatch","useAppDispatch","queryParams","handleSetParamsInRedux","setPlayerParams","setIsReady","handleAddUUID","handleVodParams","handleStaticParams","validSubtitles","filterValidSubtitles","getUUID","handleParams","useEffect","useHandleParams_default","useKeyPress","key","cb","callbackRef","useRef","handleKeyPress","event","useKeyPress_default","useHandleKeyPress","conditions","handlePlayPause","handleBackwardForward","mainPlayerVideoTag","handleFullScreen","settings","store_default","handleChangeSoundVolume","handleSubtitle","useHandleKeyPress_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","shallowEqual","clearRedux","isFullScreen","jsx","element","Fragment","jsxs","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","Image","importImages_default","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","setPlay","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","setCurrentTime","MiniPlayerLibrary"],"mappings":"2mBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAUA,IAAMC,EAAAA,CAAmBC,CAAAA,EAAe,CACtC,IAAMC,CAAAA,CAAWC,EAAAA,EAAe,CAE5BC,EAAuB,EAAC,CAEtBC,CAAAA,CAAyB,IAAM,CACnCH,CAAAA,CAASI,CAAAA,CAAgBF,CAAW,CAAC,EACrCF,CAAAA,CAASK,CAAAA,CAAW,IAAI,CAAC,EAC3B,CAAA,CAEMC,CAAAA,CAAgB,IAAM,CACpBP,EAAM,IAAA,GACV,YAAA,CAAa,OAAA,CAAQ,aAAA,CAAeA,EAAM,IAAK,CAAA,CAC/CG,CAAAA,CAAY,IAAA,CAAOH,EAAM,IAAA,EAE7B,CAAA,CAEMQ,CAAAA,CAAkB,IAAM,CAC5BL,CAAAA,CAAc,CACZ,QAAA,CAAU,SAAA,CACV,GAAGH,CACL,EACF,CAAA,CAEMS,CAAAA,CAAqB,SAAY,CACrC,IAAMC,EAAAA,CAAiBV,CAAAA,CAAM,UAAY,MAAMW,GAAAA,CAAqBX,CAAAA,CAAM,SAAS,EAAI,EAAC,CACxFG,CAAAA,CAAc,CACZ,KAAMS,CAAAA,EAAQ,CACd,QAAA,CAAU,SA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AA,CAAC,KAAA,CAAA,CAAI,UAAU,iCAAA,CAAkC,CAAA,CAGzD,CAER,CAAA,CDhEO,IAAM8C,EAAAA,CAAoB,CAAC,CAChC,MAAA,CAAApD,CACF,CAAA,GAIIM,IAACa,QAAAA,CAAA,CAAS,KAAA,CAAO7B,CAAAA,CACf,SAAAgB,GAAAA,CAACW,CAAAA,CAAA,CACC,QAAA,CAAAX,IAACuC,EAAAA,CAAA,CAAW,MAAA,CAAQ7C,CAAAA,CAAQ,EAC9B,CAAA,CACF","file":"index.mjs","sourcesContent":["export { VideoPlayerLibrary } from \"./videoPlayerLibrary\";\r\nexport { MiniPlayerLibrary } from \"./miniPlayerLibrary\";\r\n","\"use client\";\r\n\r\nimport { Provider } from \"react-redux\";\r\nimport { IParams } from \"./helpers/interfaces/interfaces\";\r\nimport store from \"./helpers/redux/store\";\r\nimport VideoPlayer from \"./components/videoPlayer/videoPlayer\";\r\nimport ErrorBoundary from \"./helpers/errorBoundary/errorBoundary\";\r\n\r\nexport const VideoPlayerLibrary = ({ params }: { params: IParams }) => {\r\n return (\r\n <Provider store={store}>\r\n <ErrorBoundary>\r\n <VideoPlayer params={params} />\r\n </ErrorBoundary>\r\n </Provider>\r\n );\r\n};\r\n","\"use client\";\r\n\r\nimport { conditions } from \"../../helpers/conditions/conditions\";\r\nimport useHandleParams from \"../../helpers/hooks/useHandleParams\";\r\nimport { ConditionName, PlayerTypes, zIndex } from \"../../helpers/interfaces/enums\";\r\nimport { IParams } from \"../../helpers/interfaces/interfaces\";\r\nimport { useAppSelector } from \"../../helpers/redux/hooks\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport dynamic from \"next/dynamic\";\r\nimport useHandleKeyPress from \"../../helpers/hooks/useHandleKeyPress\";\r\nimport { useEffect } from \"react\";\r\nimport { clearRedux } from \"../../helpers/helpers\";\r\nimport { mainPlayerVideoTag } from \"../../helpers/constants\";\r\nimport Loader from \"../custom-components/loader/loader\";\r\n\r\nconst StaticPlayer = dynamic(() => import(\"./staticPlayer/staticPlayer\"));\r\nconst VodPlayer = dynamic(() => import(\"./vodPlayer/vodPlayer\"));\r\nconst VideoHighLighter = dynamic(() => import(\"./videoHighLighter/VideoHighLighter\"));\r\n\r\ninterface IProps {\r\n params: IParams;\r\n}\r\n\r\nconst VideoPlayer = (props: IProps) => {\r\n const { params } = useAppSelector(({ videoData: { isReady, params } }) => ({ isReady, params }), shallowEqual);\r\n useEffect(() => {\r\n if (params.id && props.params.id !== params.id) {\r\n if (params.type === PlayerTypes.static) {\r\n mainPlayerVideoTag()?.pause();\r\n mainPlayerVideoTag().removeAttribute(\"src\");\r\n mainPlayerVideoTag().load();\r\n }\r\n clearRedux();\r\n }\r\n return () => {\r\n if (params.id) clearRedux();\r\n };\r\n }, [props.params.id]);\r\n\r\n useHandleParams(props.params);\r\n useHandleKeyPress();\r\n useAppSelector(({ controller: { isFullScreen } }) => ({ isFullScreen }), shallowEqual);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div\r\n className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen, touchAction: \"pan-y\", userSelect: \"none\" }}\r\n >\r\n {conditions(ConditionName.isStaticFormat) ? <StaticPlayer /> : <VodPlayer />}\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n dir=\"rtl\"\r\n className={`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${\r\n conditions(ConditionName.isFullScreen) && \"!pl-overflow-hidden pl-fixed pl-top-0 pl-right-0 pl-w-screen pl-h-screen pl-rounded-none\"\r\n }`}\r\n id=\"parent-player\"\r\n >\r\n {conditions(ConditionName.isFirstPlay) && (\r\n <div\r\n className={`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${\r\n !conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"pl-rounded-[12px]\"\r\n }`}\r\n >\r\n <Loader />\r\n </div>\r\n )}\r\n {element}\r\n </div>\r\n );\r\n};\r\n\r\nexport default VideoPlayer;\r\n","\"use client\";\r\n\r\nimport { useEffect } from \"react\";\r\nimport { getUUID } from \"../helpers\";\r\nimport { useAppDispatch } from \"../redux/hooks\";\r\nimport { IParams } from \"../interfaces/interfaces\";\r\nimport { setIsReady, setPlayerParams } from \"../redux/slices/videoDataSlice\";\r\nimport { PlayerTypes } from \"../interfaces/enums\";\r\nimport { filterValidSubtitles } from \"../redux/actions/videoData.actions\";\r\n\r\nconst useHandleParams = (query: any) => {\r\n const dispatch = useAppDispatch();\r\n\r\n let queryParams: IParams = {};\r\n\r\n const handleSetParamsInRedux = () => {\r\n dispatch(setPlayerParams(queryParams));\r\n dispatch(setIsReady(true));\r\n };\r\n\r\n const handleAddUUID = () => {\r\n if (!!query.uuid) {\r\n localStorage.setItem(\"hamrahiUUID\", query.uuid!);\r\n queryParams.uuid = query.uuid;\r\n }\r\n };\r\n\r\n const handleVodParams = () => {\r\n queryParams = {\r\n provider: \"cafevdo\",\r\n ...query,\r\n };\r\n };\r\n\r\n const handleStaticParams = async () => {\r\n const validSubtitles = query.subtitles ? await filterValidSubtitles(query.subtitles) : [];\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n subtitles: validSubtitles,\r\n id: query.id ? window.atob(query.id) : undefined,\r\n banner: query.banner && query.banner !== \"undefined\" ? query.banner : undefined,\r\n };\r\n };\r\n\r\n const handleParams = async () => {\r\n queryParams = {};\r\n if (Object.keys(query).includes(\"type\")) {\r\n if (String(query.type) === PlayerTypes.vod) handleVodParams();\r\n else if (String(query.type) === PlayerTypes.static) await handleStaticParams();\r\n handleAddUUID();\r\n handleSetParamsInRedux();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n handleParams();\r\n }, [query]);\r\n};\r\n\r\nexport default useHandleParams;\r\n","import { conditions } from \"../conditions/conditions\";\r\nimport { mainPlayerVideoTag } from \"../constants\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { handleBackwardForward, handleChangeSoundVolume, handleFullScreen, handlePlayPause } from \"../redux/actions/controller.actions\";\r\nimport { handleSubtitle } from \"../redux/actions/videoData.actions\";\r\nimport store from \"../redux/store\";\r\nimport useKeyPress from \"./useKeyPress\";\r\n\r\nconst useHandleKeyPress = () => {\r\n useKeyPress(\"Space\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeySpace)) handlePlayPause(event);\r\n });\r\n useKeyPress(\"ArrowRight\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowRight)) handleBackwardForward(\"forward\", 15, event);\r\n });\r\n useKeyPress(\"ArrowLeft\", (event: any) => {\r\n if (conditions(ConditionName.isPressKeyArrowLeft)) handleBackwardForward(\"backward\", 15, event);\r\n });\r\n useKeyPress(\"KeyI\", () => {\r\n if (conditions(ConditionName.isPressKeyI)) mainPlayerVideoTag().requestPictureInPicture();\r\n });\r\n useKeyPress(\"KeyF\", () => {\r\n if (conditions(ConditionName.isPressKeyF)) handleFullScreen();\r\n });\r\n useKeyPress(\"KeyM\", () => {\r\n if (conditions(ConditionName.isPressKeyM)) {\r\n const { settings } = store.getState().user;\r\n handleChangeSoundVolume(settings.volume ? 0 : 50);\r\n }\r\n });\r\n useKeyPress(\"KeyC\", () => {\r\n if (conditions(ConditionName.isPressKeyC)) handleSubtitle();\r\n });\r\n};\r\n\r\nexport default useHandleKeyPress;\r\n","import { useEffect, useRef } from \"react\";\r\n\r\nconst useKeyPress = (key: string, cb: any) => {\r\n const callbackRef = useRef(cb);\r\n\r\n useEffect(() => {\r\n callbackRef.current = cb;\r\n }, []);\r\n\r\n useEffect(() => {\r\n const handleKeyPress = (event: any) => {\r\n if (event.code === key && ![\"INPUT\", \"TEXTAREA\"].includes(event.target.nodeName) && !event.target.isContentEditable) callbackRef.current(event);\r\n };\r\n\r\n document.addEventListener(\"keydown\", handleKeyPress);\r\n\r\n return () => document.removeEventListener(\"keydown\", handleKeyPress);\r\n }, [key]);\r\n};\r\nexport default useKeyPress;\r\n","import React from \"react\";\r\nimport { errorLogProvider } from \"./errorBoundaryFunctions\";\r\n\r\nclass ErrorBoundary extends React.Component {\r\n state = { hasError: false, error: null, errorInfo: null };\r\n\r\n static getDerivedStateFromError(error: any) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n\r\n componentDidCatch(error: any, errorInfo: any) {\r\n // You can also log the error to an error reporting service\r\n this.setState({ error: error, errorInfo: errorInfo });\r\n errorLogProvider({ type: \"OTHER_ERROR\", message: error.message });\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) {\r\n return <></>;\r\n }\r\n\r\n return (this.props as any).children;\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;\r\n","\"use client\";\r\n\r\nimport { Provider } from \"react-redux\";\r\nimport { IMiniPlayerParams } from \"./helpers/interfaces/interfaces\";\r\nimport store from \"./helpers/redux/store\";\r\nimport { MiniPlayer } from \"./components/custom-components/miniPlayer/miniPlayer\";\r\nimport ErrorBoundary from \"./helpers/errorBoundary/errorBoundary\";\r\n\r\nexport const MiniPlayerLibrary = ({\r\n params,\r\n}: {\r\n params: IMiniPlayerParams;\r\n}) => {\r\n return (\r\n <Provider store={store}>\r\n <ErrorBoundary>\r\n <MiniPlayer params={params} />\r\n </ErrorBoundary>\r\n </Provider>\r\n );\r\n};\r\n","\"use client\";\r\n\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { useEffect } from \"react\";\r\nimport { IMiniPlayerParams } from \"../../../helpers/interfaces/interfaces\";\r\nimport { setMiniPlayerInfo } from \"../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport MiniPlayerPlayPause from \"../playPause/miniPlayerPlayPause\";\r\nimport VideoTag from \"./videoTag/videoTag\";\r\nimport { getVodDetails } from \"../../../helpers/redux/actions/videoData.actions\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { setCurrentTime } from \"../../../helpers/redux/slices/controllerSlice\";\r\n\r\nexport const MiniPlayer = ({ params }: { params: IMiniPlayerParams }) => {\r\n const dispatch = useAppDispatch();\r\n const details = useAppSelector(state => state.miniPlayer.details);\r\n const miniPlayerParams = useAppSelector(state => state.miniPlayer.params);\r\n useAppSelector(state => state.miniPlayer.play);\r\n const mainPlayerParams = useAppSelector(state => state.videoData.params);\r\n \r\n useEffect(() => {\r\n dispatch(setMiniPlayerInfo(params));\r\n },[])\r\n\r\n const handleGetDetail = async () => await getVodDetails(params.id);\r\n\r\n useEffect(() => {\r\n if(params.id && params.type === \"vod\") handleGetDetail();\r\n },[params.id])\r\n\r\n return (\r\n <>\r\n {details.stream_link || (miniPlayerParams.type === \"static\" && !!miniPlayerParams.id) ? (\r\n <div id=\"miniPlayer-video-area\" style={{zIndex: zIndex.miniPlayer}} className=\"pl-relative pl-w-full pl-h-full\">\r\n <div \r\n className={`pl-absolute pl-z-[1000000] pl-top-3 pl-right-3 pl-cursor-pointer ${conditions(ConditionName.isActiveElements) ? \"animate__fadeIn pl-pointer-events-auto\" : \"animate__fadeOut pl-pointer-events-none\" }`} \r\n onClick={() => {\r\n if(mainPlayerParams.id === miniPlayerParams.id) {\r\n mainPlayerVideoTag().currentTime = miniPlayerVideoTag().currentTime;\r\n dispatch(setCurrentTime(miniPlayerVideoTag().currentTime));\r\n }\r\n localStorage.setItem(\"close-miniPlayer\", \"true\");\r\n params.onClose();\r\n }}\r\n > \r\n <Image\r\n className=\"pl-cursor-pointer\"\r\n src={IMAGES.closeSquare}\r\n alt=\"close-square\"\r\n width={16}\r\n height={16}\r\n />\r\n </div>\r\n <div className={`pl-w-full pl-absolute pl-bottom-0 animate__animated animate__faster pl-z-[1000000] ${conditions(ConditionName.isActiveElements) && !conditions(ConditionName.isLoading)\r\n ? \"animate__fadeIn pl-pointer-events-auto\"\r\n : \"animate__fadeOut pl-pointer-events-none\"\r\n }`}>\r\n <div className=\"pl-w-full pl-flex pl-justify-center\">\r\n <MiniPlayerPlayPause />\r\n </div>\r\n </div>\r\n <VideoTag />\r\n </div>\r\n ) : (\r\n <div className=\"pl-w-full pl-h-full pl-bg-white\" />\r\n )}\r\n\r\n </>\r\n )\r\n}","import { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport { handlePlayerPauseMiniPlayer } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport Image from \"next/legacy/image\";\r\n\r\nconst MiniPlayerPlayPause = () => {\r\n useAppSelector(({ miniPlayer: { play } }) => ({ play }), shallowEqual);\r\n\r\n return (\r\n <div\r\n className={`${!conditions(ConditionName.isTouchScreen) && \"hover:pl-scale-125\"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`}\r\n onContextMenu={(event) => event.preventDefault()}\r\n >\r\n <Image\r\n alt=\"\"\r\n src={conditions(ConditionName.isPlayMiniPlayer) ? IMAGES.bigPause : IMAGES.bigPlay}\r\n width={20}\r\n height={20}\r\n onClick={(event: any) => handlePlayerPauseMiniPlayer(event)}\r\n onDoubleClick={(event: any) => event.stopPropagation()}\r\n className={`${conditions(ConditionName.isPlayMiniPlayer) ? \"pl-big-play-icon\" : \"pl-big-pause-icon\"}`}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nexport default MiniPlayerPlayPause;\r\n","import { PlayerTypes } from \"../../../../helpers/interfaces/enums\";\r\nimport { useAppSelector } from \"../../../../helpers/redux/hooks\";\r\nimport MiniPlayerNonStaticVideoTag from \"./miniPlayerNonStaticVideoTag\";\r\nimport MiniPlayerStaticVideoTag from \"./miniPlayerStaticVideoTag\";\r\n\r\nconst VideoTag = () => {\r\n \r\n const type = useAppSelector(state => state.miniPlayer.params.type);\r\n return (\r\n <>{type === PlayerTypes.static ? <MiniPlayerStaticVideoTag /> : <MiniPlayerNonStaticVideoTag />}</>\r\n )\r\n}\r\n\r\nexport default VideoTag;","import Hls from \"hls.js\";\r\nimport { useEffect } from \"react\";\r\nimport {\r\n appendQueryParamsToChunksIOS,\r\n handleMiniPlayerHlsConfig,\r\n handleMiniPlayerMediaAttached,\r\n handleVideoError,\r\n} from \"../../../../helpers/redux/actions/playerCore.actions\";\r\nimport {\r\n useAppDispatch,\r\n useAppSelector,\r\n} from \"../../../../helpers/redux/hooks\";\r\nimport {\r\n mainPlayerVideoTag,\r\n miniPlayerVideoTag,\r\n} from \"../../../../helpers/constants\";\r\nimport {\r\n setClearMiniPlayerSlice,\r\n setPlayMiniPlayer,\r\n} from \"../../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport { setPlay } from \"../../../../helpers/redux/slices/controllerSlice\";\r\n\r\nconst MiniPlayerNonStaticVideoTag = () => {\r\n const dispatch = useAppDispatch();\r\n const details = useAppSelector((state) => state.miniPlayer.details);\r\n const params = useAppSelector((state) => state.miniPlayer.params);\r\n\r\n useEffect(() => {\r\n let hls = new Hls(handleMiniPlayerHlsConfig());\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(\r\n document.getElementById(`mini-player-video-tag`) as HTMLMediaElement\r\n );\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () =>\r\n handleMiniPlayerMediaAttached(hls)\r\n );\r\n } else if (\r\n mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")\r\n ) {\r\n mainPlayerVideoTag().src = details.stream_link!;\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n return () => {\r\n dispatch(setClearMiniPlayerSlice());\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () =>\r\n handleMiniPlayerMediaAttached(hls)\r\n );\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (params.currentTime) {\r\n dispatch(setPlayMiniPlayer(true));\r\n miniPlayerVideoTag().currentTime = params.currentTime;\r\n dispatch(setPlay(false));\r\n mainPlayerVideoTag()?.pause();\r\n }\r\n }, [params.currentTime]);\r\n\r\n return (\r\n <>\r\n <video\r\n onPlay={() => dispatch(setPlayMiniPlayer(true))}\r\n onEnded={() => dispatch(setPlayMiniPlayer(false))}\r\n onError={handleVideoError}\r\n poster={params.banner ? params.banner : details.banner}\r\n id={`mini-player-video-tag`}\r\n className=\"pl-absolute pl-bg-black pl-w-full pl-h-full\"\r\n autoPlay={true}\r\n muted={true}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport default MiniPlayerNonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../../helpers/redux/hooks\";\r\nimport { mainPlayerVideoTag, miniPlayerVideoTag } from \"../../../../helpers/constants\";\r\nimport { setPlayMiniPlayer } from \"../../../../helpers/redux/slices/miniPlayerSlice\";\r\nimport { setPlay } from \"../../../../helpers/redux/slices/controllerSlice\";\r\nimport { handleVideoError } from \"../../../../helpers/redux/actions/playerCore.actions\";\r\n\r\nconst MiniPlayerStaticVideoTag = () => {\r\n\r\n const dispatch = useAppDispatch();\r\n const params = useAppSelector(state => state.miniPlayer.params);\r\n\r\n useEffect(() => {\r\n if(params.currentTime) {\r\n dispatch(setPlayMiniPlayer(true));\r\n miniPlayerVideoTag().currentTime = params.currentTime;\r\n dispatch(setPlay(false));\r\n mainPlayerVideoTag()?.pause();\r\n }\r\n },[params.currentTime])\r\n\r\n return (\r\n <video \r\n poster={params.banner} \r\n onPlay={() => dispatch(setPlayMiniPlayer(true))}\r\n onEnded={() => dispatch(setPlayMiniPlayer(false))}\r\n onError={handleVideoError}\r\n src={params.id} \r\n id={`mini-player-video-tag`} \r\n className=\"pl-absolute pl-bg-black pl-w-full pl-h-full\"\r\n autoPlay\r\n />\r\n )\r\n}\r\n\r\nexport default MiniPlayerStaticVideoTag;"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkZXBCSP2L_js=require('./chunk-ZXBCSP2L.js'),chunk5HFX3MP2_js=require('./chunk-5HFX3MP2.js'),chunkJGG5BV2J_js=require('./chunk-JGG5BV2J.js'),chunkQHZJEU27_js=require('./chunk-QHZJEU27.js'),chunkWMEKSWX7_js=require('./chunk-WMEKSWX7.js'),chunkHSAWK74H_js=require('./chunk-HSAWK74H.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),d=require('hls.js'),react=require('react'),reactRedux=require('react-redux'),De=require('next/legacy/image'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var De__default=/*#__PURE__*/_interopDefault(De);chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var Pe=()=>{let i=null,{isEnded:o}=chunkHSAWK74H_js.ha(({controller:{isEnded:E}})=>({isEnded:E}),reactRedux.shallowEqual);react.useEffect(()=>(i=setInterval(()=>chunkZXBCSP2L_js.a(),chunkQHZJEU27_js.c),()=>clearInterval(i)),[]),react.useEffect(()=>{chunkHSAWK74H_js.fa("isEnded")&&clearInterval(i);},[o]);},ie=Pe;chunkWO4IQUGO_js.e();var Le=i=>{let[o,E]=react.useState([]),[l,m]=react.useState(0),{qualityLevels:s}=chunkHSAWK74H_js.ha(({controller:{qualityLevels:t}})=>({qualityLevels:t}),reactRedux.shallowEqual);react.useEffect(()=>{if(i){let t=[];switch(o.length){case 0:t=[i];break;case 1:t=[i,...o];break;case 2:t=[i,...o],chunkHSAWK74H_js.ka(chunkHSAWK74H_js.ya(`${t[0]}P`,`${t[1]}P`,s.indexOf(t[0])-s.indexOf(t[1])));break;default:t=[i,o[0],o[1]],t[1]!==t[2]&&chunkHSAWK74H_js.ka(chunkHSAWK74H_js.ya(`${t[1]}P`,`${t[2]}P`,s.indexOf(t[1])-s.indexOf(t[2])));break}E(t);}},[i]),react.useEffect(()=>{o.length===3&&o[0]===o[2]?(chunkHSAWK74H_js.ka(chunkHSAWK74H_js.za(l,o)),E([]),m(0)):m(new Date().getTime());},[o]);},le=Le;chunkWO4IQUGO_js.e();var Ae=()=>{react.useEffect(()=>{let i=()=>{chunkZXBCSP2L_js.a();};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[]);},me=Ae;var Te=()=>{let[i,o]=react.useState(void 0),E=chunkHSAWK74H_js.ga(),{params:l,details:m,videoElementSizeInfo:s}=chunkHSAWK74H_js.ha(({videoData:{params:e,details:a,videoElementSizeInfo:r}})=>({params:e,details:a,videoElementSizeInfo:r}),reactRedux.shallowEqual),{currentTime:t,duration:pe}=chunkHSAWK74H_js.ha(({controller:{currentTime:e,duration:a,isEnded:r,firstPlay:he}})=>({currentTime:e,duration:a,isEnded:r,firstPlay:he}),reactRedux.shallowEqual),g=react.useRef(null),ce=react.useRef(0),y=react.useRef(0),V=react.useRef(0),F=react.useRef(0),H=react.useRef(0),Ee=react.useRef(1),ye=react.useRef(chunkHSAWK74H_js.la()?chunkHSAWK74H_js.la().currentTime:0);return ie(),me(),react.useLayoutEffect(()=>{let e=new d__default.default(chunkJGG5BV2J_js.c());return chunkHSAWK74H_js._(H),V.current=Date.now(),d__default.default.isSupported()?(e.attachMedia(chunkHSAWK74H_js.la()),e.on(d__default.default.Events.MEDIA_ATTACHED,()=>chunkJGG5BV2J_js.f(d__default.default,e)),e.on(d__default.default.Events.FRAG_BUFFERED,()=>chunkJGG5BV2J_js.g(e)),e.on(d__default.default.Events.FRAG_CHANGED,(a,r)=>chunkJGG5BV2J_js.h(e,r,o)),e.on(d__default.default.Events.FRAG_PARSED,(a,r)=>chunkJGG5BV2J_js.i(e,r,o)),e.on(d__default.default.Events.ERROR,(a,r)=>chunkHSAWK74H_js.Fa(chunkJGG5BV2J_js.j(r))),chunkHSAWK74H_js.la().addEventListener("waiting",a=>chunkJGG5BV2J_js.k(a,y)),chunkHSAWK74H_js.la().addEventListener("seeking",a=>chunkJGG5BV2J_js.l(a,y)),chunkHSAWK74H_js.la().addEventListener("play",a=>chunkJGG5BV2J_js.m(a,g)),chunkHSAWK74H_js.la().addEventListener("playing",()=>chunkJGG5BV2J_js.n(Ee,H,V,F,g,ce,y,ye)),chunkHSAWK74H_js.la().addEventListener("pause",chunkJGG5BV2J_js.o),chunkHSAWK74H_js.la().addEventListener("timeupdate",chunkJGG5BV2J_js.p),chunkHSAWK74H_js.la().addEventListener("canplay",chunkJGG5BV2J_js.q),chunkHSAWK74H_js.la().addEventListener("ended",chunkJGG5BV2J_js.r),chunkHSAWK74H_js.la().addEventListener("error",chunkJGG5BV2J_js.a),document.addEventListener("visibilitychange",chunkJGG5BV2J_js.D)):chunkHSAWK74H_js.la().canPlayType("application/vnd.apple.mpegurl")&&(chunkHSAWK74H_js.la().src=m.stream_link,chunkHSAWK74H_js.la().addEventListener("waiting",a=>chunkJGG5BV2J_js.k(a,y)),chunkHSAWK74H_js.la().addEventListener("play",a=>chunkJGG5BV2J_js.s(a,g)),chunkHSAWK74H_js.la().addEventListener("playing",chunkJGG5BV2J_js.t),chunkHSAWK74H_js.la().addEventListener("canplay",chunkJGG5BV2J_js.q),chunkHSAWK74H_js.la().addEventListener("timeupdate",chunkJGG5BV2J_js.u),chunkHSAWK74H_js.la().addEventListener("ended",chunkJGG5BV2J_js.v),chunkHSAWK74H_js.la().addEventListener("pause",chunkJGG5BV2J_js.o),chunkJGG5BV2J_js.b()),()=>{chunkWMEKSWX7_js.b(),e.detachMedia(),e.off(d__default.default.Events.MEDIA_ATTACHED,()=>chunkJGG5BV2J_js.f(d__default.default,e)),e.off(d__default.default.Events.FRAG_BUFFERED,()=>chunkJGG5BV2J_js.g(e)),e.off(d__default.default.Events.FRAG_CHANGED,(a,r)=>chunkJGG5BV2J_js.h(e,r,o)),e.off(d__default.default.Events.FRAG_PARSED,(a,r)=>chunkJGG5BV2J_js.i(e,r,o)),e.off(d__default.default.Events.ERROR,(a,r)=>chunkJGG5BV2J_js.j(r)),e.off(d__default.default.Events.MANIFEST_PARSED,(a,r)=>chunkJGG5BV2J_js.e(e,r)),document.removeEventListener("visibilitychange",chunkJGG5BV2J_js.D);}},[m.stream_link]),react.useEffect(()=>{t<pe&&chunkHSAWK74H_js.fa("isEnded")&&E(chunkHSAWK74H_js.p(false));},[t]),react.useEffect(()=>{chunkHSAWK74H_js.fa("hasPlayStatusParams")&&(l.playStatus?chunkHSAWK74H_js.la().play():chunkHSAWK74H_js.la()?.pause());},[l.playStatus]),le(i),chunk5HFX3MP2_js.b(),chunk5HFX3MP2_js.a(),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("video",{poster:l.banner?l.banner:m.banner,preload:"metadata",crossOrigin:"anonymous",id:"player-tag",playsInline:true,className:"pl-items-center pl-flex-1 pl-h-full",style:{width:"100%",height:"100%",maxWidth:s.width?s.width:"100%",maxHeight:s.width?s.width<s.height?s.width*9/16:s.width*16/9:"100%"},autoPlay:chunkHSAWK74H_js.fa("hasAutoPlay"),children:[jsxRuntime.jsx(De__default.default,{onLoad:()=>F.current=Date.now(),layout:"fill",src:l.banner?l.banner:m.banner,alt:l.bannerAlt?l.bannerAlt:chunkHSAWK74H_js.fa("isStaticFormat")?"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648":m.title}),chunkHSAWK74H_js.fa("hasSubtitlesInDetails")&&chunkHSAWK74H_js.aa(m.subtitles).map(e=>jsxRuntime.jsx("track",{id:`player-tracker-${e.lang}`,src:e.url,label:chunkHSAWK74H_js.ba(e.lang),kind:"subtitles",srcLang:e.lang},e.id))]})})},vn=Te;module.exports=vn;//# sourceMappingURL=nonStaticVideoTag-CGE5567K.js.map
|
|
2
|
+
//# sourceMappingURL=nonStaticVideoTag-CGE5567K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_cjs_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mappings":"upBAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CAQA,IAAMC,GAAgC,IAAM,CACxC,IAAIC,C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A,CAAAA,CAAS,EAKlB,CAEP,CAAA,CAAA,CACT,CAAA,CACJ,CAER,CAAA,CAEOE,EAAAA,CAAQ5D","file":"nonStaticVideoTag-T4CIWREL.js","sourcesContent":["\"use client\";\r\n\r\nimport Hls, { ErrorData, Events } from \"hls.js\";\r\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag()?.pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_cjs_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mappings":"upBAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CAQA,IAAMC,GAAgC,IAAM,CACxC,IAAIC,CAAAA,CAAgB,IAAA,CAEd,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,mBAAAA,CAAe,CAAC,CAAE,UA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":"nonStaticVideoTag-CGE5567K.js","sourcesContent":["\"use client\";\r\n\r\nimport Hls, { ErrorData, Events } from \"hls.js\";\r\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag()?.pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=nonStaticVideoTag-
|
|
1
|
+
import {a as a$2}from'./chunk-4TQF43YU.mjs';import {b as b$2,a as a$1}from'./chunk-R4YRPVUD.mjs';import {c,f,g,h,i,j,k,l,m,n,o,p,q,r,a,D,s,t,u,v,b,e as e$1}from'./chunk-MSI72J5J.mjs';import {c as c$1}from'./chunk-SIUJSGLY.mjs';import {b as b$1}from'./chunk-QZJECTZQ.mjs';import {ga,ha,la,_,Fa,fa,p as p$1,aa,ba,ka,ya,za}from'./chunk-FPUBUJN6.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import d from'hls.js';import {useState,useRef,useLayoutEffect,useEffect}from'react';import {shallowEqual}from'react-redux';import Te from'next/legacy/image';import {jsx,Fragment,jsxs}from'react/jsx-runtime';e();e();var be=()=>{let i=null,{isEnded:o}=ha(({controller:{isEnded:E}})=>({isEnded:E}),shallowEqual);useEffect(()=>(i=setInterval(()=>a$2(),c$1),()=>clearInterval(i)),[]),useEffect(()=>{fa("isEnded")&&clearInterval(i);},[o]);},de=be;e();var Re=i=>{let[o,E]=useState([]),[l,m]=useState(0),{qualityLevels:s}=ha(({controller:{qualityLevels:t}})=>({qualityLevels:t}),shallowEqual);useEffect(()=>{if(i){let t=[];switch(o.length){case 0:t=[i];break;case 1:t=[i,...o];break;case 2:t=[i,...o],ka(ya(`${t[0]}P`,`${t[1]}P`,s.indexOf(t[0])-s.indexOf(t[1])));break;default:t=[i,o[0],o[1]],t[1]!==t[2]&&ka(ya(`${t[1]}P`,`${t[2]}P`,s.indexOf(t[1])-s.indexOf(t[2])));break}E(t);}},[i]),useEffect(()=>{o.length===3&&o[0]===o[2]?(ka(za(l,o)),E([]),m(0)):m(new Date().getTime());},[o]);},me=Re;e();var we=()=>{useEffect(()=>{let i=()=>{a$2();};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[]);},fe=we;var Ie=()=>{let[i$1,o$1]=useState(void 0),E=ga(),{params:l$1,details:m$1,videoElementSizeInfo:s$1}=ha(({videoData:{params:e,details:a,videoElementSizeInfo:r}})=>({params:e,details:a,videoElementSizeInfo:r}),shallowEqual),{currentTime:t$1,duration:ce}=ha(({controller:{currentTime:e,duration:a,isEnded:r,firstPlay:ve}})=>({currentTime:e,duration:a,isEnded:r,firstPlay:ve}),shallowEqual),g$1=useRef(null),Ee=useRef(0),y=useRef(0),F=useRef(0),H=useRef(0),_$1=useRef(0),ye=useRef(1),he=useRef(la()?la().currentTime:0);return de(),fe(),useLayoutEffect(()=>{let e=new d(c());return _(_$1),F.current=Date.now(),d.isSupported()?(e.attachMedia(la()),e.on(d.Events.MEDIA_ATTACHED,()=>f(d,e)),e.on(d.Events.FRAG_BUFFERED,()=>g(e)),e.on(d.Events.FRAG_CHANGED,(a,r)=>h(e,r,o$1)),e.on(d.Events.FRAG_PARSED,(a,r)=>i(e,r,o$1)),e.on(d.Events.ERROR,(a,r)=>Fa(j(r))),la().addEventListener("waiting",a=>k(a,y)),la().addEventListener("seeking",a=>l(a,y)),la().addEventListener("play",a=>m(a,g$1)),la().addEventListener("playing",()=>n(ye,_$1,F,H,g$1,Ee,y,he)),la().addEventListener("pause",o),la().addEventListener("timeupdate",p),la().addEventListener("canplay",q),la().addEventListener("ended",r),la().addEventListener("error",a),document.addEventListener("visibilitychange",D)):la().canPlayType("application/vnd.apple.mpegurl")&&(la().src=m$1.stream_link,la().addEventListener("waiting",a=>k(a,y)),la().addEventListener("play",a=>s(a,g$1)),la().addEventListener("playing",t),la().addEventListener("canplay",q),la().addEventListener("timeupdate",u),la().addEventListener("ended",v),la().addEventListener("pause",o),b()),()=>{b$1(),e.detachMedia(),e.off(d.Events.MEDIA_ATTACHED,()=>f(d,e)),e.off(d.Events.FRAG_BUFFERED,()=>g(e)),e.off(d.Events.FRAG_CHANGED,(a,r)=>h(e,r,o$1)),e.off(d.Events.FRAG_PARSED,(a,r)=>i(e,r,o$1)),e.off(d.Events.ERROR,(a,r)=>j(r)),e.off(d.Events.MANIFEST_PARSED,(a,r)=>e$1(e,r)),document.removeEventListener("visibilitychange",D);}},[m$1.stream_link]),useEffect(()=>{t$1<ce&&fa("isEnded")&&E(p$1(false));},[t$1]),useEffect(()=>{fa("hasPlayStatusParams")&&(l$1.playStatus?la().play():la()?.pause());},[l$1.playStatus]),me(i$1),b$2(),a$1(),jsx(Fragment,{children:jsxs("video",{poster:l$1.banner?l$1.banner:m$1.banner,preload:"metadata",crossOrigin:"anonymous",id:"player-tag",playsInline:true,className:"pl-items-center pl-flex-1 pl-h-full",style:{width:"100%",height:"100%",maxWidth:s$1.width?s$1.width:"100%",maxHeight:s$1.width?s$1.width<s$1.height?s$1.width*9/16:s$1.width*16/9:"100%"},autoPlay:fa("hasAutoPlay"),children:[jsx(Te,{onLoad:()=>H.current=Date.now(),layout:"fill",src:l$1.banner?l$1.banner:m$1.banner,alt:l$1.bannerAlt?l$1.bannerAlt:fa("isStaticFormat")?"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648":m$1.title}),fa("hasSubtitlesInDetails")&&aa(m$1.subtitles).map(e=>jsx("track",{id:`player-tracker-${e.lang}`,src:e.url,label:ba(e.lang),kind:"subtitles",srcLang:e.lang},e.id))]})})},gn=Ie;export{gn as default};//# sourceMappingURL=nonStaticVideoTag-LEI3OS4G.mjs.map
|
|
2
|
+
//# sourceMappingURL=nonStaticVideoTag-LEI3OS4G.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_esm_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mappings":"+kBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAQA,IAAMC,GAAgC,IAAM,CACxC,IAAIC,CAAAA,CAAgB,IAAA,CAEd,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,EAAAA,CAAe,CAAC,CAAE,UAAA,CAAY,CAAE,QAAAD,CAAQ,CAAE,CAAA,IAAO,CAAE,OAAA,CAAAA,CAAQ,CAAA,CAAA,CAAIE,YAAY,CAAA,CAE/FC,SAAAA,CAAU,KACNJ,CAAAA,CAAW,WAAA,CAAY,IAAMK,KAAyB,CAAGC,GAA+B,CAAA,CACjF,IAAM,aAAA,CAAcN,CAAQ,CAAA,CAAA,CACpC,EAAE,CAAA,CAELI,SAAAA,CAAU,IAAM,CACRG,EAAAA,CAAAA,SAAgC,GAAG,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,IAAMzC,CAAAA,CAAyB,OAAA,CAAU,KAAK,GAAA,EAAI,CAAG,MAAA,CAAO,MAAA,CAAO,GAAA,CAAKX,GAAAA,CAAO,MAAA,CAASA,GAAAA,CAAO,MAAA,CAASC,GAAAA,CAAQ,MAAA,CAAQ,GAAA,CAAKD,GAAAA,CAAO,SAAA,CAAYA,IAAO,SAAA,CAAYtB,EAAAA,CAAAA,gBAAuC,CAAA,CAAI,oIAAA,CAA8BuB,GAAAA,CAAQ,KAAA,CAAO,CAAA,CACzQvB,EAAAA,CAAAA,uBAA8C,CAAA,EAC3C2E,EAAAA,CAAcpD,GAAAA,CAAQ,SAAS,CAAA,CAAG,GAAA,CAAKqD,GAE/BL,GAAAA,CAAC,OAAA,CAAA,CACG,EAAA,CAAI,CAAA,eAAA,EAAkBK,CAAAA,CAAS,IAAI,CAAA,CAAA,CAEnC,GAAA,CAAKA,CAAAA,CAAS,GAAA,CACd,KAAA,CAAOC,EAAAA,CAAiBD,CAAAA,CAAS,IAAI,EACrC,IAAA,CAAK,WAAA,CACL,OAAA,CAASA,CAAAA,CAAS,IAAA,CAAA,CAJbA,CAAAA,CAAS,EAKlB,CAEP,CAAA,CAAA,CACT,CAAA,CACJ,CAER,CAAA,CAEOE,EAAAA,CAAQ5D","file":"nonStaticVideoTag-RO6C2T36.mjs","sourcesContent":["\"use client\";\r\n\r\nimport Hls, { ErrorData, Events } from \"hls.js\";\r\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag()?.pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/custom-components/videoTag/nonStaticVideoTag.tsx","../src/videoPlayerLibrary/helpers/hooks/useContinuousPlaybackInterval.tsx","../src/videoPlayerLibrary/helpers/hooks/usePingPong.tsx","../src/videoPlayerLibrary/helpers/hooks/useBeforeUnload.tsx"],"names":["init_esm_shims","useContinuousPlaybackInterval","interval","isEnded","useAppSelector","shallowEqual","useEffect","handleContinuousPlayback","continuousePlaybackIntervalTime","conditions","useContinuousPlaybackInterval_default","usePingPong","qualityLevel","qualityHistory","setQualityHistory","useState","startTimer","setStartTimer","qualityLevels","newQualityArray","sendFluentLog","autoQualityChangeLog","pingpongLog","usePingPong_default","useBeforeUnload","handleBeforeUnload","useBeforeUnload_default","NonStaticVideoTag","setQualityLevel","dispatch","useAppDispatch","params","details","videoElementSizeInfo","currentTime","duration","firstPlay","timerRef","useRef","waitingDurationRef","waitingTimerRef","initialWaitingDurationRef","bannerLoadingDurationRef","loadingDurationRef","loadingCounterRef","videoEntranceTimeRef","mainPlayerVideoTag","useLayoutEffect","hls","Hls","handleHlsConfig","handlePageLoadTime","handleMediaAttached","handleFragBuffered","event","data","handleFragChanged","handleFragParsed","errorLogProvider","handleHlsErrors","handleVideoWaiting","handleVideoSeeking","handleVideoPlay","handleVideoPlaying","handleVideoPause","handleVideoTimeUpdate","handleVideoCanPlay","handleVideoEnded","handleVideoError","handleVideoVisibilityChange","handleIosVideoPlay","handleIosVideoPlaying","handleIosVideoTimeUpdate","handleIosVideoEnded","appendQueryParamsToChunksIOS","handlePlayPauseAfterChangeVideo","handleManifestParsed","setIsEnded","useHideSubtitle_default","useJumpToCurrentTime_default","jsx","Fragment","jsxs","Image","sortLanguages","subtitle","getSubtitleLabel","nonStaticVideoTag_default"],"mappings":"+kBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CAQA,IAAMC,GAAgC,IAAM,CACxC,IAAIC,CAAAA,CAAgB,IAAA,CAEd,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,EAAAA,CAAe,CAAC,CAAE,UAAA,CAAY,CAAE,QAAAD,CAAQ,CAAE,CAAA,IAAO,CAAE,OAAA,CAAAA,CAAQ,CAAA,CAAA,CAAIE,YAAY,CAAA,CAE/FC,SAAAA,CAAU,KACNJ,CAAAA,CAAW,WAAA,CAAY,IAAMK,KAAyB,CAAGC,GAA+B,CAAA,CACjF,IAAM,aAAA,CAAcN,CAAQ,CAAA,CAAA,CACpC,EAAE,CAAA,CAELI,SAAAA,CAAU,IAAM,CACRG,EAAAA,CAAAA,SAAgC,GAAG,aAAA,CAAcP,CAAQ,EACjE,CAAA,CAAG,CAACC,CAAO,CAAC,EAChB,CAAA,CAEOO,EAAAA,CAAQT,EAAAA,CCvBfD,CAAAA,EAAAA,CAMA,IAAMW,EAAAA,CAAeC,CAAAA,EAA0B,CAC3C,GAAM,CAACC,CAAAA,CAAgBC,CAAiB,CAAA,CAAIC,QA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O,SAAA,CAAYtB,EAAAA,CAAAA,gBAAuC,CAAA,CAAI,oIAAA,CAA8BuB,GAAAA,CAAQ,KAAA,CAAO,CAAA,CACzQvB,EAAAA,CAAAA,uBAA8C,CAAA,EAC3C2E,EAAAA,CAAcpD,GAAAA,CAAQ,SAAS,CAAA,CAAG,GAAA,CAAKqD,GAE/BL,GAAAA,CAAC,OAAA,CAAA,CACG,EAAA,CAAI,CAAA,eAAA,EAAkBK,CAAAA,CAAS,IAAI,CAAA,CAAA,CAEnC,GAAA,CAAKA,CAAAA,CAAS,GAAA,CACd,KAAA,CAAOC,EAAAA,CAAiBD,CAAAA,CAAS,IAAI,EACrC,IAAA,CAAK,WAAA,CACL,OAAA,CAASA,CAAAA,CAAS,IAAA,CAAA,CAJbA,CAAAA,CAAS,EAKlB,CAEP,CAAA,CAAA,CACT,CAAA,CACJ,CAER,CAAA,CAEOE,EAAAA,CAAQ5D","file":"nonStaticVideoTag-LEI3OS4G.mjs","sourcesContent":["\"use client\";\r\n\r\nimport Hls, { ErrorData, Events } from \"hls.js\";\r\nimport { useEffect, useState, useRef, useLayoutEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppDispatch, useAppSelector } from \"../../../helpers/redux/hooks\";\r\nimport useContinuousPlaybackInterval from \"../../../helpers/hooks/useContinuousPlaybackInterval\";\r\nimport { getSubtitleLabel, handlePageLoadTime, sortLanguages } from \"../../../helpers/helpers\";\r\nimport { appendQueryParamsToChunksIOS, handleFragBuffered, handleFragChanged, handleFragParsed, handleHlsConfig, handleHlsErrors, handleIosVideoEnded, handleIosVideoPlay, handleIosVideoPlaying, handleIosVideoTimeUpdate, handleManifestParsed, handleMediaAttached, handleVideoCanPlay, handleVideoEnded, handleVideoError, handleVideoPause, handleVideoPlay, handleVideoPlaying, handleVideoSeeking, handleVideoTimeUpdate, handleVideoVisibilityChange, handleVideoWaiting } from \"../../../helpers/redux/actions/playerCore.actions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { setIsEnded } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport usePingPong from \"../../../helpers/hooks/usePingPong\";\r\nimport Image from \"next/legacy/image\";\r\nimport useBeforeUnload from \"../../../helpers/hooks/useBeforeUnload\";\r\nimport { ISubtitle } from \"../../../helpers/interfaces/interfaces\";\r\nimport useHideSubtitle from \"../../../helpers/hooks/useHideSubtitle\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { handlePlayPauseAfterChangeVideo } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport useJumpToCurrentTime from \"../../../helpers/hooks/useJumpToCurrentTime\";\r\nimport { errorLogProvider } from \"../../../helpers/errorBoundary/errorBoundaryFunctions\";\r\n\r\nconst NonStaticVideoTag = () => {\r\n const [qualityLevel, setQualityLevel] = useState<number | undefined>(undefined);\r\n\r\n const dispatch = useAppDispatch();\r\n const { params, details, videoElementSizeInfo } = useAppSelector(\r\n ({ videoData: { params, details, videoElementSizeInfo } }) => ({\r\n params,\r\n details,\r\n videoElementSizeInfo,\r\n }),\r\n shallowEqual\r\n );\r\n const { currentTime, duration } = useAppSelector(\r\n ({ controller: { currentTime, duration, isEnded, firstPlay } }) => ({\r\n currentTime,\r\n duration,\r\n isEnded,\r\n firstPlay,\r\n }),\r\n shallowEqual\r\n );\r\n const timerRef = useRef<any>(null);\r\n const waitingDurationRef = useRef<any>(0);\r\n const waitingTimerRef = useRef<number>(0);\r\n const initialWaitingDurationRef = useRef<any>(0);\r\n const bannerLoadingDurationRef = useRef<any>(0);\r\n const loadingDurationRef = useRef<any>(0);\r\n const loadingCounterRef = useRef<any>(1);\r\n const videoEntranceTimeRef = useRef<any>(mainPlayerVideoTag() ? mainPlayerVideoTag().currentTime : 0);\r\n\r\n useContinuousPlaybackInterval();\r\n useBeforeUnload();\r\n\r\n useLayoutEffect(() => {\r\n let hls = new Hls(handleHlsConfig());\r\n\r\n // ---- Page Load Time ----\r\n handlePageLoadTime(loadingDurationRef);\r\n\r\n initialWaitingDurationRef.current = Date.now();\r\n\r\n if (Hls.isSupported()) {\r\n hls.attachMedia(mainPlayerVideoTag() as HTMLMediaElement);\r\n hls.on(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.on(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.on(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.on(Hls.Events.ERROR, (event: Events.ERROR, data: ErrorData) => errorLogProvider(handleHlsErrors(data)));\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"seeking\", (event: any) => handleVideoSeeking(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", () =>\r\n handleVideoPlaying(\r\n loadingCounterRef,\r\n loadingDurationRef,\r\n initialWaitingDurationRef,\r\n bannerLoadingDurationRef,\r\n timerRef,\r\n waitingDurationRef,\r\n waitingTimerRef,\r\n videoEntranceTimeRef\r\n )\r\n );\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"error\", handleVideoError);\r\n\r\n document.addEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n } else if (mainPlayerVideoTag().canPlayType(\"application/vnd.apple.mpegurl\")) {\r\n mainPlayerVideoTag().src = details.stream_link;\r\n\r\n mainPlayerVideoTag().addEventListener(\"waiting\", (event: any) => handleVideoWaiting(event, waitingTimerRef));\r\n mainPlayerVideoTag().addEventListener(\"play\", (event: any) => handleIosVideoPlay(event, timerRef));\r\n mainPlayerVideoTag().addEventListener(\"playing\", handleIosVideoPlaying);\r\n mainPlayerVideoTag().addEventListener(\"canplay\", handleVideoCanPlay);\r\n mainPlayerVideoTag().addEventListener(\"timeupdate\", handleIosVideoTimeUpdate);\r\n mainPlayerVideoTag().addEventListener(\"ended\", handleIosVideoEnded);\r\n mainPlayerVideoTag().addEventListener(\"pause\", handleVideoPause);\r\n\r\n // Append Query Parameter to .ts Chunks\r\n appendQueryParamsToChunksIOS();\r\n }\r\n\r\n return () => {\r\n handlePlayPauseAfterChangeVideo();\r\n hls.detachMedia();\r\n hls.off(Hls.Events.MEDIA_ATTACHED, () => handleMediaAttached(Hls, hls));\r\n hls.off(Hls.Events.FRAG_BUFFERED, () => handleFragBuffered(hls));\r\n hls.off(Hls.Events.FRAG_CHANGED, (event: any, data: any) => handleFragChanged(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.FRAG_PARSED, (event: any, data: any) => handleFragParsed(hls, data, setQualityLevel));\r\n hls.off(Hls.Events.ERROR, (event: any, data: any) => handleHlsErrors(data));\r\n hls.off(Hls.Events.MANIFEST_PARSED, (event: any, data: any) => handleManifestParsed(hls, data));\r\n document.removeEventListener(\"visibilitychange\", handleVideoVisibilityChange);\r\n };\r\n }, [details.stream_link]);\r\n\r\n useEffect(() => {\r\n if (currentTime < duration && conditions(ConditionName.isEnded)) {\r\n dispatch(setIsEnded(false));\r\n }\r\n }, [currentTime]);\r\n\r\n useEffect(() => {\r\n if(conditions(ConditionName.hasPlayStatusParams)) {\r\n if(params.playStatus) mainPlayerVideoTag().play();\r\n else mainPlayerVideoTag()?.pause();\r\n };\r\n },[params.playStatus])\r\n\r\n usePingPong(qualityLevel);\r\n useHideSubtitle();\r\n\r\n useJumpToCurrentTime();\r\n\r\n return (\r\n <>\r\n <video\r\n poster={params.banner ? params.banner : details.banner}\r\n preload=\"metadata\"\r\n crossOrigin=\"anonymous\"\r\n id=\"player-tag\"\r\n playsInline\r\n className={`pl-items-center pl-flex-1 pl-h-full`}\r\n style={{\r\n width: \"100%\",\r\n height: \"100%\",\r\n maxWidth: videoElementSizeInfo.width ? videoElementSizeInfo.width : \"100%\",\r\n maxHeight: videoElementSizeInfo.width\r\n ? videoElementSizeInfo.width < videoElementSizeInfo.height\r\n ? (videoElementSizeInfo.width * 9) / 16\r\n : (videoElementSizeInfo.width * 16) / 9\r\n : \"100%\"\r\n }}\r\n autoPlay={conditions(ConditionName.hasAutoPlay)}\r\n >\r\n <Image onLoad={() => bannerLoadingDurationRef.current = Date.now()} layout=\"fill\" src={params.banner ? params.banner : details.banner} alt={params.bannerAlt ? params.bannerAlt : conditions(ConditionName.isStaticFormat) ? \"بنر ویدیو پلیر کافه ویدیو\" : details.title} />\r\n {conditions(ConditionName.hasSubtitlesInDetails) &&\r\n sortLanguages(details.subtitles)!.map((subtitle: ISubtitle) => {\r\n return (\r\n <track\r\n id={`player-tracker-${subtitle.lang}`}\r\n key={subtitle.id}\r\n src={subtitle.url}\r\n label={getSubtitleLabel(subtitle.lang)}\r\n kind=\"subtitles\"\r\n srcLang={subtitle.lang}\r\n />\r\n );\r\n })}\r\n </video>\r\n </>\r\n );\r\n};\r\n\r\nexport default NonStaticVideoTag;\r\n","import { useEffect } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { continuousePlaybackIntervalTime } from \"../environment\";\r\nimport { ConditionName } from \"../interfaces/enums\";\r\nimport { conditions } from \"../conditions/conditions\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useContinuousPlaybackInterval = () => {\r\n let interval: any = null;\r\n\r\n const { isEnded } = useAppSelector(({ controller: { isEnded } }) => ({ isEnded }), shallowEqual);\r\n\r\n useEffect(() => {\r\n interval = setInterval(() => handleContinuousPlayback(), continuousePlaybackIntervalTime);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (conditions(ConditionName.isEnded)) clearInterval(interval);\r\n }, [isEnded]);\r\n};\r\n\r\nexport default useContinuousPlaybackInterval;\r\n","import { useEffect, useState } from \"react\";\r\nimport { shallowEqual } from \"react-redux\";\r\nimport { useAppSelector } from \"../redux/hooks\";\r\nimport { sendFluentLog } from \"../logs/fluentdLogger\";\r\nimport { autoQualityChangeLog, pingpongLog } from \"../logs/logs\";\r\n\r\nconst usePingPong = (qualityLevel?: number) => {\r\n const [qualityHistory, setQualityHistory] = useState<number[]>([]);\r\n const [startTimer, setStartTimer] = useState<number>(0);\r\n\r\n const { qualityLevels } = useAppSelector(({ controller: { qualityLevels } }) => ({ qualityLevels }), shallowEqual);\r\n\r\n useEffect(() => {\r\n if (qualityLevel) {\r\n let newQualityArray: number[] = [];\r\n switch (qualityHistory.length) {\r\n case 0:\r\n newQualityArray = [qualityLevel];\r\n break;\r\n case 1:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n break;\r\n case 2:\r\n newQualityArray = [qualityLevel, ...qualityHistory];\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[0]}P`,\r\n `${newQualityArray[1]}P`,\r\n qualityLevels.indexOf(newQualityArray[0]) - qualityLevels.indexOf(newQualityArray[1])\r\n )\r\n );\r\n break;\r\n default:\r\n newQualityArray = [qualityLevel, qualityHistory[0], qualityHistory[1]];\r\n if (newQualityArray[1] !== newQualityArray[2])\r\n sendFluentLog(\r\n autoQualityChangeLog(\r\n `${newQualityArray[1]}P`,\r\n `${newQualityArray[2]}P`,\r\n qualityLevels.indexOf(newQualityArray[1]) - qualityLevels.indexOf(newQualityArray[2])\r\n )\r\n );\r\n break;\r\n }\r\n setQualityHistory(newQualityArray);\r\n }\r\n }, [qualityLevel]);\r\n\r\n useEffect(() => {\r\n if (qualityHistory.length === 3 && qualityHistory[0] === qualityHistory[2]) {\r\n sendFluentLog(pingpongLog(startTimer, qualityHistory));\r\n setQualityHistory([]);\r\n setStartTimer(0);\r\n } else {\r\n setStartTimer(new Date().getTime());\r\n }\r\n }, [qualityHistory]);\r\n};\r\nexport default usePingPong;\r\n","import { useEffect } from \"react\";\r\nimport { handleContinuousPlayback } from \"../redux/actions/user.actions\";\r\n\r\nconst useBeforeUnload = () => {\r\n useEffect(() => {\r\n const handleBeforeUnload = () => {\r\n handleContinuousPlayback();\r\n };\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n return () => window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n }, []);\r\n};\r\n\r\nexport default useBeforeUnload;\r\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-2J3G4ODR.mjs';import'./chunk-6V7Y4FV6.mjs';import'./chunk-OEFD3YXU.mjs';import'./chunk-A2WOHDUE.mjs';import'./chunk-CSWKETJ4.mjs';import'./chunk-SIUJSGLY.mjs';import'./chunk-QZJECTZQ.mjs';import {fa}from'./chunk-FPUBUJN6.mjs';import'./chunk-TM66GJCG.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {jsx}from'react/jsx-runtime';e();var l=()=>jsx("div",{className:`pl-w-full pl-aspect-video ${!fa("isTouchScreen")&&!fa("isFullScreen")&&"!pl-rounded-[12px]"}`,children:jsx(a,{})}),m=l;export{m as default};//# sourceMappingURL=staticPlayer-KE3BXILD.mjs.map
|
|
2
|
+
//# sourceMappingURL=staticPlayer-KE3BXILD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_esm_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"+VAAAA,CAAAA,EAAAA,CAMA,IAAMC,CAAAA,CAAe,IAEbC,GAAAA,CAAC,KAAA,CAAA,CACD,SAAA,CAAW,CAAA,0BAAA,EAA6B,CAACC,EAAAA,CAAAA,eAAsC,GAAK,CAACA,EAAAA,CAAAA,cAAqC,CAAA,EAAK,oBAAoB,CAAA,CAAA,CAEnJ,QAAA,CAAAD,IAACE,CAAAA,CAAA,EAAU,CAAA,CACf,CAAA,CAIGC,CAAAA,CAAQJ","file":"staticPlayer-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_esm_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"+VAAAA,CAAAA,EAAAA,CAMA,IAAMC,CAAAA,CAAe,IAEbC,GAAAA,CAAC,KAAA,CAAA,CACD,SAAA,CAAW,CAAA,0BAAA,EAA6B,CAACC,EAAAA,CAAAA,eAAsC,GAAK,CAACA,EAAAA,CAAAA,cAAqC,CAAA,EAAK,oBAAoB,CAAA,CAAA,CAEnJ,QAAA,CAAAD,IAACE,CAAAA,CAAA,EAAU,CAAA,CACf,CAAA,CAIGC,CAAAA,CAAQJ","file":"staticPlayer-KE3BXILD.mjs","sourcesContent":["\"use client\";\r\n\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport VideoArea from \"../../custom-components/videoArea/videoArea\";\r\n\r\nconst StaticPlayer = () => {\r\n return (\r\n <div\r\n className={`pl-w-full pl-aspect-video ${!conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"!pl-rounded-[12px]\"}`}\r\n >\r\n <VideoArea />\r\n </div>\r\n )\r\n}\r\n\r\nexport default StaticPlayer;"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkI5PCCWLZ_js=require('./chunk-I5PCCWLZ.js');require('./chunk-VJJNBNP2.js'),require('./chunk-TVDVQALL.js'),require('./chunk-D6YE37GQ.js'),require('./chunk-IR7FV4FQ.js'),require('./chunk-QHZJEU27.js'),require('./chunk-WMEKSWX7.js');var chunkHSAWK74H_js=require('./chunk-HSAWK74H.js');require('./chunk-5FTEBU6O.js');var chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),jsxRuntime=require('react/jsx-runtime');chunkWO4IQUGO_js.e();var l=()=>jsxRuntime.jsx("div",{className:`pl-w-full pl-aspect-video ${!chunkHSAWK74H_js.fa("isTouchScreen")&&!chunkHSAWK74H_js.fa("isFullScreen")&&"!pl-rounded-[12px]"}`,children:jsxRuntime.jsx(chunkI5PCCWLZ_js.a,{})}),a=l;module.exports=a;//# sourceMappingURL=staticPlayer-XP5433B2.js.map
|
|
2
|
+
//# sourceMappingURL=staticPlayer-XP5433B2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_cjs_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"0aAAAA,kBAAAA,EAAAA,CAMA,IAAMC,CAAAA,CAAe,IAEbC,cAAAA,CAAC,KAAA,CAAA,CACD,SAAA,CAAW,CAAA,0BAAA,EAA6B,CAACC,mBAAAA,CAAAA,eAAsC,GAAK,CAACA,mBAAAA,CAAAA,cAAqC,CAAA,EAAK,oBAAoB,CAAA,CAAA,CAEnJ,QAAA,CAAAD,eAACE,kBAAAA,CAAA,EAAU,CAAA,CACf,CAAA,CAIGC,CAAAA,CAAQJ","file":"staticPlayer-
|
|
1
|
+
{"version":3,"sources":["../src/videoPlayerLibrary/components/videoPlayer/staticPlayer/staticPlayer.tsx"],"names":["init_cjs_shims","StaticPlayer","jsx","conditions","videoArea_default","staticPlayer_default"],"mappings":"0aAAAA,kBAAAA,EAAAA,CAMA,IAAMC,CAAAA,CAAe,IAEbC,cAAAA,CAAC,KAAA,CAAA,CACD,SAAA,CAAW,CAAA,0BAAA,EAA6B,CAACC,mBAAAA,CAAAA,eAAsC,GAAK,CAACA,mBAAAA,CAAAA,cAAqC,CAAA,EAAK,oBAAoB,CAAA,CAAA,CAEnJ,QAAA,CAAAD,eAACE,kBAAAA,CAAA,EAAU,CAAA,CACf,CAAA,CAIGC,CAAAA,CAAQJ","file":"staticPlayer-XP5433B2.js","sourcesContent":["\"use client\";\r\n\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName } from \"../../../helpers/interfaces/enums\";\r\nimport VideoArea from \"../../custom-components/videoArea/videoArea\";\r\n\r\nconst StaticPlayer = () => {\r\n return (\r\n <div\r\n className={`pl-w-full pl-aspect-video ${!conditions(ConditionName.isTouchScreen) && !conditions(ConditionName.isFullScreen) && \"!pl-rounded-[12px]\"}`}\r\n >\r\n <VideoArea />\r\n </div>\r\n )\r\n}\r\n\r\nexport default StaticPlayer;"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=staticVideoTag-
|
|
1
|
+
import {b,a}from'./chunk-R4YRPVUD.mjs';import {a as a$1,B,z,y,x,w,A}from'./chunk-MSI72J5J.mjs';import'./chunk-QZJECTZQ.mjs';import {ga,ha,_,fa,aa,ba,la,t}from'./chunk-FPUBUJN6.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {useRef,useEffect}from'react';import {shallowEqual}from'react-redux';import A$1 from'next/legacy/image';import {jsxs,jsx}from'react/jsx-runtime';e();var C=()=>{let T=ga(),{params:a$2}=ha(({videoData:{params:e}})=>({params:e}),shallowEqual);ha(({controller:{firstPlay:e}})=>({firstPlay:e}),shallowEqual);let r=useRef(0),l=useRef(0),d=useRef(null),s=useRef(null);return useEffect(()=>{_(r),l.current=Date.now();},[]),useEffect(()=>{let e=()=>{let m=la()?.getBoundingClientRect();m&&T(t(m));};return fa("isFirstPlay")&&e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearInterval(s.current);}},[a$2.id]),b(),a(),jsxs("video",{poster:a$2.banner?a$2.banner:void 0,preload:"metadata",autoPlay:fa("hasAutoPlay"),id:"player-tag",crossOrigin:"anonymous",className:"pl-w-full pl-h-full pl-items-center pl-flex-1",onCanPlay:A,onPause:w,onPlay:e=>x(e,d),onPlaying:()=>y(r,l,d),onTimeUpdate:z,onLoadedData:e=>B(e,s),onError:a$1,playsInline:true,children:[a$2.banner&&jsx(A$1,{layout:"fill",src:a$2.banner,alt:a$2.bannerAlt?a$2.bannerAlt:"\u0628\u0646\u0631 \u0648\u06CC\u062F\u06CC\u0648 \u067E\u0644\u06CC\u0631 \u06A9\u0627\u0641\u0647 \u0648\u06CC\u062F\u06CC\u0648"}),jsx("source",{src:a$2.id}),fa("hasSubtitlesInParams")&&aa(a$2.subtitles).map(e=>jsx("track",{id:`player-tracker-${e.lang}`,src:e.url,label:ba(e.lang),kind:"subtitles",srcLang:e.lang},e.id))]})},Q=C;export{Q as default};//# sourceMappingURL=staticVideoTag-AUESR2OF.mjs.map
|
|
2
|
+
//# sourceMappingURL=staticVideoTag-AUESR2OF.mjs.map
|