cafe-video-player 2.7.2 → 2.7.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/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunk76V6A3GI_js=require('./chunk-76V6A3GI.js'),chunkYMTPNYEW_js=require('./chunk-YMTPNYEW.js'),chunk6W23FTCG_js=require('./chunk-6W23FTCG.js'),chunkQBSPLP2V_js=require('./chunk-QBSPLP2V.js'),chunkOJ6XD2ZQ_js=require('./chunk-OJ6XD2ZQ.js'),chunkNWBLCSO4_js=require('./chunk-NWBLCSO4.js'),chunkELIJO5CC_js=require('./chunk-ELIJO5CC.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),reactRedux=require('react-redux'),gr=require('react'),Q=require('next/dynamic'),Le=require('next/legacy/image'),jsxRuntime=require('react/jsx-runtime'),U=require('hls.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var gr__default=/*#__PURE__*/_interopDefault(gr);var Q__default=/*#__PURE__*/_interopDefault(Q);var Le__default=/*#__PURE__*/_interopDefault(Le);var U__default=/*#__PURE__*/_interopDefault(U);chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var lr=e=>{let o=chunkNWBLCSO4_js.ha(),i={},n=()=>{o(chunkNWBLCSO4_js.s(i)),o(chunkNWBLCSO4_js.x(true));},c=()=>{e.uuid&&(localStorage.setItem("hamrahiUUID",e.uuid),i.uuid=e.uuid);},s=()=>{i={provider:"cafevdo",...e};},m=async()=>{i={uuid:chunkNWBLCSO4_js.R(),provider:"cafevdo",...e,subtitles:void 0,id:e.id?window.atob(e.id):void 0,banner:e.banner&&e.banner!=="undefined"?e.banner:void 0};},E=async()=>{i={},Object.keys(e).includes("type")&&(String(e.type)==="vod"?s():String(e.type)==="static"&&m(),c(),n());};gr.useEffect(()=>{E();},[e]);},Ae=lr;chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var pr=(e,o)=>{let i=gr.useRef(o);gr.useEffect(()=>{i.current=o;},[]),gr.useEffect(()=>{let n=c=>{c.code===e&&!["INPUT","TEXTAREA"].includes(c.target.nodeName)&&!c.target.isContentEditable&&i.current(c);};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]);},b=pr;var mr=()=>{b("Space",e=>{chunkNWBLCSO4_js.ga("isPressKeySpace")&&chunkOJ6XD2ZQ_js.a(e);}),b("ArrowRight",e=>{chunkNWBLCSO4_js.ga("isPressKeyArrowRight")&&chunkOJ6XD2ZQ_js.e("forward",15,e);}),b("ArrowLeft",e=>{chunkNWBLCSO4_js.ga("isPressKeyArrowLeft")&&chunkOJ6XD2ZQ_js.e("backward",15,e);}),b("KeyI",()=>{chunkNWBLCSO4_js.ga("isPressKeyI")&&chunkNWBLCSO4_js.ja().requestPictureInPicture();}),b("KeyF",()=>{chunkNWBLCSO4_js.ga("isPressKeyF")&&chunkOJ6XD2ZQ_js.f();}),b("KeyM",()=>{if(chunkNWBLCSO4_js.ga("isPressKeyM")){let{settings:e}=chunkNWBLCSO4_js.Q.getState().user;chunkOJ6XD2ZQ_js.d(e.volume?0:50);}}),b("KeyC",()=>{chunkNWBLCSO4_js.ga("isPressKeyC")&&chunk6W23FTCG_js.b();});},Ce=mr;chunkWO4IQUGO_js.e();var dr=({progress:e,buffered:o})=>jsxRuntime.jsx("div",{className:`pl-relative pl-w-full pl-h-0.5 ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-h-1"} pl-bg-gray-highLight`,children:jsxRuntime.jsx("div",{className:"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear",style:{width:`${e}%`}})}),cr=({src:e,onEndAd:o,onSkipAd:i,skipDelay:n,adText:c="\u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631",onClickAd:s})=>{let m=chunkNWBLCSO4_js.ha(),E=gr.useRef(null),[Je,Qe]=gr.useState(0),[We,Xe]=gr.useState(0),[Ye,j]=gr.useState(false),V=n!==void 0&&n>0,[C,Ze]=gr.useState(V?n:null),[q,N]=gr.useState(false),[D,je]=gr.useState(0),[qe,er]=gr.useState(0),[rr,$]=gr.useState(true),I=gr.useRef(null),[ee,re]=gr.useState(false),L=(r=3e3)=>{if(ee){$(true);return}$(true),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{$(false);},r);};gr.useEffect(()=>{let r=E.current;if(!r)return;let l=()=>L(),w=()=>L();return r.addEventListener("mousemove",l),r.addEventListener("touchstart",w),L(),()=>{r.removeEventListener("mousemove",l),r.removeEventListener("touchstart",w),I.current&&clearTimeout(I.current);}},[ee]),gr.useEffect(()=>{if(!V||!q)return;let r=setInterval(()=>{Ze(l=>l===null?l:l<=1?(clearInterval(r),0):l-1);},1e3);return ()=>clearInterval(r)},[q,V]),gr.useEffect(()=>{let r=chunkNWBLCSO4_js.ja();if(!r)return;let l=()=>{N(true),re(false),L(1e3);},w=()=>{N(false),re(true),$(true),I.current&&clearTimeout(I.current);},ie=()=>N(false),oe=()=>N(false),ae=()=>er(r.duration);r.addEventListener("play",l),r.addEventListener("pause",w),r.addEventListener("waiting",ie),r.addEventListener("error",oe),r.addEventListener("loadedmetadata",ae);let ne=r.play();return m(chunkNWBLCSO4_js.a(true)),ne!==void 0&&ne.then(()=>chunkOJ6XD2ZQ_js.d(100)).catch(()=>chunkOJ6XD2ZQ_js.d(0)),()=>{r.removeEventListener("play",l),r.removeEventListener("pause",w),r.removeEventListener("waiting",ie),r.removeEventListener("error",oe),r.removeEventListener("loadedmetadata",ae);}},[e]),gr.useEffect(()=>{N(true);},[]);let tr=()=>{let r=chunkNWBLCSO4_js.ja();r?.duration&&(Qe(r.currentTime/r.duration*100),je(r.currentTime));},ir=()=>{let r=chunkNWBLCSO4_js.ja();r?.duration&&r.buffered.length>0&&Xe(r.buffered.end(r.buffered.length-1)/r.duration*100);},or=r=>{let l=chunkNWBLCSO4_js.ja();if(l){if(chunkNWBLCSO4_js.ga("isTouchScreen")){L();return}(r.target===E.current||r.target===l)&&(l.paused?(l.play(),m(chunkNWBLCSO4_js.a(true))):(l.pause(),m(chunkNWBLCSO4_js.a(false))));}},ar=()=>{s&&s(D);},te=r=>{let l=Math.floor(r/60).toString().padStart(2,"0"),w=Math.floor(r%60).toString().padStart(2,"0");return `${l}:${w}`};return jsxRuntime.jsxs("div",{id:"video-area",ref:E,onClick:or,onDoubleClick:()=>{chunkOJ6XD2ZQ_js.f(),chunkOJ6XD2ZQ_js.g();},className:`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"pl-rounded-[12px]"} ${chunkNWBLCSO4_js.ga("isFullScreen")&&"!pl-fixed !pl-w-screen dvh !pl-rounded-none"}`,style:{zIndex:chunkNWBLCSO4_js.ga("isFullScreen")?1e3:"unset"},children:[jsxRuntime.jsx("video",{src:e,autoPlay:true,playsInline:true,className:"pl-absolute pl-size-full",onEnded:()=>o&&o(D),onTimeUpdate:tr,onProgress:ir,id:"player-tag"}),jsxRuntime.jsxs("div",{className:`pl-relative pl-z-10 pl-flex pl-flex-col ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"pl-flex-col-reverse"} pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${rr?"pl-opacity-100":"pl-opacity-0 pl-pointer-events-none"}`,children:[jsxRuntime.jsx(dr,{progress:Je,buffered:We}),jsxRuntime.jsxs("div",{className:`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"pl-pb-3"}`,children:[jsxRuntime.jsx(chunkQBSPLP2V_js.c,{}),jsxRuntime.jsxs("div",{className:"pl-flex pl-items-center pl-gap-4",children:[jsxRuntime.jsxs("div",{className:"pl-text-white pl-text-[12px] pl-font-bold",children:[te(qe)," / ",te(D)]}),jsxRuntime.jsx(chunkQBSPLP2V_js.b,{}),jsxRuntime.jsxs("div",{className:"pl-relative pl-flex pl-items-center",onMouseOver:()=>!chunkNWBLCSO4_js.ga("isTouchScreen")&&j(true),onMouseLeave:()=>!chunkNWBLCSO4_js.ga("isTouchScreen")&&j(false),children:[jsxRuntime.jsx(chunkYMTPNYEW_js.b,{width:20,height:20}),Ye&&jsxRuntime.jsx(chunkQBSPLP2V_js.a,{className:"pl-left-0",title:chunkNWBLCSO4_js.ga("isPlay")?"\u067E\u062E\u0634":"\u062A\u0648\u0642\u0641"})]})]})]})]}),s&&jsxRuntime.jsxs("button",{onClick:ar,className:`pl-absolute pl-bottom-[73px] ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4"} pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsxRuntime.jsx(Le__default.default,{src:chunkELIJO5CC_js.a.export,alt:"export button",width:16,height:16}),jsxRuntime.jsx("span",{className:`pl-font-medium ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:c})]}),V&&jsxRuntime.jsxs("button",{onClick:()=>i&&i(D),disabled:!!C&&C>0,className:`pl-absolute pl-bottom-[73px] ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 "} pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsxRuntime.jsx(Le__default.default,{src:chunkELIJO5CC_js.a.next,alt:"next button",width:16,height:16}),jsxRuntime.jsx("span",{className:`pl-font-medium ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:C&&C>0?`${C} \u062B\u0627\u0646\u06CC\u0647`:"\u0631\u062F \u06A9\u0631\u062F\u0646"})]})]})},Ve=cr;var ur=Q__default.default(()=>import('./staticPlayer-JXFZGQDZ.js')),fr=Q__default.default(()=>import('./vodPlayer-EPI4JJHU.js')),yr=Q__default.default(()=>import('./VideoHighLighter-QC663PT7.js')),Pr=e=>{let o=chunkNWBLCSO4_js.ha(),{params:i}=chunkNWBLCSO4_js.ia(({videoData:{isReady:s,params:m,hiddenAd:E}})=>({isReady:s,params:m,hiddenAd:E}),reactRedux.shallowEqual);gr.useEffect(()=>(i.id&&e.params.id!==i.id&&chunkNWBLCSO4_js.Z(),()=>{i.id&&chunkNWBLCSO4_js.Z();}),[e.params.id]),Ae(e.params),Ce(),chunkNWBLCSO4_js.ia(({controller:{isFullScreen:s}})=>({isFullScreen:s}),reactRedux.shallowEqual);let n=async()=>{let s=await chunk6W23FTCG_js.c(e.params.subtitles);o(chunkNWBLCSO4_js.s({...i,subtitles:s}));};if(gr.useEffect(()=>{i.id&&String(e.params.type)==="static"&&e.params.subtitles&&e.params.subtitles.length&&setTimeout(()=>{n();},30);},[i.id]),e.params.vhl_status)return jsxRuntime.jsx(yr,{});if(chunkNWBLCSO4_js.ga("hasAdvertisement"))return jsxRuntime.jsx(Ve,{src:i.advertisement?.videoUrl,onSkipAd:s=>{o(chunkNWBLCSO4_js.D(true)),i.advertisement?.onSkipAd&&i.advertisement.onSkipAd(s);},onEndAd:s=>{o(chunkNWBLCSO4_js.D(true)),i.advertisement?.onEndAd&&i.advertisement.onEndAd(s);},skipDelay:i.advertisement?.skipDelay,adText:i.advertisement?.adText,onClickAd:i.advertisement?.onClickAd});let c=jsxRuntime.jsx(jsxRuntime.Fragment,{});return chunkNWBLCSO4_js.ga("isReady")&&(c=jsxRuntime.jsx("div",{className:`${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"pl-rounded-[12px]"}`,style:{touchAction:"pan-y",userSelect:"none"},children:chunkNWBLCSO4_js.ga("isStaticFormat")?jsxRuntime.jsx(ur,{}):jsxRuntime.jsx(fr,{})})),jsxRuntime.jsxs("div",{dir:"rtl",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${chunkNWBLCSO4_js.ga("isFullScreen")&&"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]"}`,style:{zIndex:1e3},id:"parent-player",children:[chunkNWBLCSO4_js.ga("isFirstPlay")&&jsxRuntime.jsx("div",{className:`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${!chunkNWBLCSO4_js.ga("isTouchScreen")&&!chunkNWBLCSO4_js.ga("isFullScreen")&&"pl-rounded-[12px]"}`,children:jsxRuntime.jsx(chunkYMTPNYEW_js.a,{})}),c]})},Re=Pr;chunkWO4IQUGO_js.e();var W=class extends gr__default.default.Component{state={hasError:false,error:null,errorInfo:null};static getDerivedStateFromError(o){return {hasError:true}}componentDidCatch(o,i){this.setState({error:o,errorInfo:i}),chunkNWBLCSO4_js.Ga({type:"OTHER_ERROR",message:o.message});}render(){return this.state.hasError?jsxRuntime.jsx(jsxRuntime.Fragment,{}):this.props.children}},z=W;var xr=({params:e})=>jsxRuntime.jsx(reactRedux.Provider,{store:chunkNWBLCSO4_js.Q,children:jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Re,{params:e})})});chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var wr=()=>(chunkNWBLCSO4_js.ia(({miniPlayer:{play:e}})=>({play:e}),reactRedux.shallowEqual),jsxRuntime.jsx("div",{className:`${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsxRuntime.jsx(Le__default.default,{alt:"",src:chunkNWBLCSO4_js.ga("isPlayMiniPlayer")?chunkELIJO5CC_js.a.bigPause:chunkELIJO5CC_js.a.bigPlay,width:20,height:20,onClick:e=>chunkOJ6XD2ZQ_js.c(e),onDoubleClick:e=>e.stopPropagation(),className:`${chunkNWBLCSO4_js.ga("isPlayMiniPlayer")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),Fe=wr;chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var Ar=()=>{let e=chunkNWBLCSO4_js.ha(),o=chunkNWBLCSO4_js.ia(n=>n.miniPlayer.details),i=chunkNWBLCSO4_js.ia(n=>n.miniPlayer.params);return gr.useEffect(()=>{let n=new U__default.default(chunk76V6A3GI_js.d());return U__default.default.isSupported()?(n.attachMedia(document.getElementById("mini-player-video-tag")),n.on(U__default.default.Events.MEDIA_ATTACHED,()=>chunk76V6A3GI_js.C(n))):chunkNWBLCSO4_js.ja().canPlayType("application/vnd.apple.mpegurl")&&(chunkNWBLCSO4_js.ja().src=o.stream_link,chunk76V6A3GI_js.b()),()=>{e(chunkNWBLCSO4_js.P()),n.detachMedia(),n.off(U__default.default.Events.MEDIA_ATTACHED,()=>chunk76V6A3GI_js.C(n));}},[]),gr.useEffect(()=>{i.currentTime&&(e(chunkNWBLCSO4_js.O(true)),chunkNWBLCSO4_js.ka().currentTime=i.currentTime,e(chunkNWBLCSO4_js.a(false)),chunkNWBLCSO4_js.ja()?.pause());},[i.currentTime]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("video",{onPlay:()=>e(chunkNWBLCSO4_js.O(true)),onEnded:()=>e(chunkNWBLCSO4_js.O(false)),onError:chunk76V6A3GI_js.a,poster:i.banner?i.banner:o.banner,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true,muted:true})})},ze=Ar;chunkWO4IQUGO_js.e();var Nr=()=>{let e=chunkNWBLCSO4_js.ha(),o=chunkNWBLCSO4_js.ia(i=>i.miniPlayer.params);return gr.useEffect(()=>{o.currentTime&&(e(chunkNWBLCSO4_js.O(true)),chunkNWBLCSO4_js.ka().currentTime=o.currentTime,e(chunkNWBLCSO4_js.a(false)),chunkNWBLCSO4_js.ja()?.pause());},[o.currentTime]),jsxRuntime.jsx("video",{poster:o.banner,onPlay:()=>e(chunkNWBLCSO4_js.O(true)),onEnded:()=>e(chunkNWBLCSO4_js.O(false)),onError:chunk76V6A3GI_js.a,src:o.id,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true})},Ue=Nr;var kr=()=>{let e=chunkNWBLCSO4_js.ia(o=>o.miniPlayer.params.type);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e==="static"?jsxRuntime.jsx(Ue,{}):jsxRuntime.jsx(ze,{})})},Be=kr;var Ge=({params:e})=>{let o=chunkNWBLCSO4_js.ha(),i=chunkNWBLCSO4_js.ia(m=>m.miniPlayer.details),n=chunkNWBLCSO4_js.ia(m=>m.miniPlayer.params);chunkNWBLCSO4_js.ia(m=>m.miniPlayer.play);let c=chunkNWBLCSO4_js.ia(m=>m.videoData.params);gr.useEffect(()=>{o(chunkNWBLCSO4_js.M(e));},[]);let s=async()=>await chunk6W23FTCG_js.a(e.id);return gr.useEffect(()=>{e.id&&e.type==="vod"&&s();},[e.id]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.stream_link||n.type==="static"&&n.id?jsxRuntime.jsxs("div",{id:"miniPlayer-video-area",style:{zIndex:1003},className:"pl-relative pl-w-full pl-h-full",children:[jsxRuntime.jsx("div",{className:`pl-absolute pl-z-[1000000] pl-top-3 pl-right-3 pl-cursor-pointer ${chunkNWBLCSO4_js.ga("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,onClick:()=>{c.id===n.id&&(chunkNWBLCSO4_js.ja().currentTime=chunkNWBLCSO4_js.ka().currentTime,o(chunkNWBLCSO4_js.c(chunkNWBLCSO4_js.ka().currentTime))),localStorage.setItem("close-miniPlayer","true"),e.onClose();},children:jsxRuntime.jsx(Le__default.default,{className:"pl-cursor-pointer",src:chunkELIJO5CC_js.a.closeSquare,alt:"close-square",width:16,height:16})}),jsxRuntime.jsx("div",{className:`pl-w-full pl-absolute pl-bottom-0 animate__animated animate__faster pl-z-[1000000] ${chunkNWBLCSO4_js.ga("isActiveElements")&&!chunkNWBLCSO4_js.ga("isLoading")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,children:jsxRuntime.jsx("div",{className:"pl-w-full pl-flex pl-justify-center",children:jsxRuntime.jsx(Fe,{})})}),jsxRuntime.jsx(Be,{})]}):jsxRuntime.jsx("div",{className:"pl-w-full pl-h-full pl-bg-white"})})};var Fr=({params:e})=>jsxRuntime.jsx(reactRedux.Provider,{store:chunkNWBLCSO4_js.Q,children:jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Ge,{params:e})})});exports.MiniPlayerLibrary=Fr;exports.VideoPlayerLibrary=xr;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var chunk76V6A3GI_js=require('./chunk-76V6A3GI.js'),chunkYMTPNYEW_js=require('./chunk-YMTPNYEW.js'),chunk6W23FTCG_js=require('./chunk-6W23FTCG.js'),chunkQBSPLP2V_js=require('./chunk-QBSPLP2V.js'),chunkOJ6XD2ZQ_js=require('./chunk-OJ6XD2ZQ.js'),chunkNWBLCSO4_js=require('./chunk-NWBLCSO4.js'),chunkELIJO5CC_js=require('./chunk-ELIJO5CC.js'),chunkWO4IQUGO_js=require('./chunk-WO4IQUGO.js'),reactRedux=require('react-redux'),br=require('react'),W=require('next/dynamic'),ke=require('next/legacy/image'),jsxRuntime=require('react/jsx-runtime'),z=require('hls.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var br__default=/*#__PURE__*/_interopDefault(br);var W__default=/*#__PURE__*/_interopDefault(W);var ke__default=/*#__PURE__*/_interopDefault(ke);var z__default=/*#__PURE__*/_interopDefault(z);chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var sr=e=>{let o=chunkNWBLCSO4_js.ha(),i={},n=()=>{o(chunkNWBLCSO4_js.s(i)),o(chunkNWBLCSO4_js.x(true));},c=()=>{e.uuid&&(localStorage.setItem("hamrahiUUID",e.uuid),i.uuid=e.uuid);},s=()=>{i={provider:"cafevdo",...e};},m=async()=>{i={uuid:chunkNWBLCSO4_js.R(),provider:"cafevdo",...e,subtitles:void 0,id:e.id?window.atob(e.id):void 0,banner:e.banner&&e.banner!=="undefined"?e.banner:void 0};},E=async()=>{i={},Object.keys(e).includes("type")&&(String(e.type)==="vod"?s():String(e.type)==="static"&&m(),c(),n());};br.useEffect(()=>{E();},[e]);},Me=sr;chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var mr=(e,o)=>{let i=br.useRef(o);br.useEffect(()=>{i.current=o;},[]),br.useEffect(()=>{let n=c=>{c.code===e&&!["INPUT","TEXTAREA"].includes(c.target.nodeName)&&!c.target.isContentEditable&&i.current(c);};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]);},b=mr;var dr=()=>{b("Space",e=>{chunkNWBLCSO4_js.ga("isPressKeySpace")&&chunkOJ6XD2ZQ_js.a(e);}),b("ArrowRight",e=>{chunkNWBLCSO4_js.ga("isPressKeyArrowRight")&&chunkOJ6XD2ZQ_js.e("forward",15,e);}),b("ArrowLeft",e=>{chunkNWBLCSO4_js.ga("isPressKeyArrowLeft")&&chunkOJ6XD2ZQ_js.e("backward",15,e);}),b("KeyI",()=>{chunkNWBLCSO4_js.ga("isPressKeyI")&&chunkNWBLCSO4_js.ja().requestPictureInPicture();}),b("KeyF",()=>{chunkNWBLCSO4_js.ga("isPressKeyF")&&chunkOJ6XD2ZQ_js.f();}),b("KeyM",()=>{if(chunkNWBLCSO4_js.ga("isPressKeyM")){let{settings:e}=chunkNWBLCSO4_js.Q.getState().user;chunkOJ6XD2ZQ_js.d(e.volume?0:50);}}),b("KeyC",()=>{chunkNWBLCSO4_js.ga("isPressKeyC")&&chunk6W23FTCG_js.b();});},Ne=dr;chunkWO4IQUGO_js.e();var cr=({progress:e,buffered:o})=>jsxRuntime.jsx("div",{className:`pl-relative pl-w-full pl-h-0.5 ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-h-1"} pl-bg-gray-highLight`,children:jsxRuntime.jsx("div",{className:"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear",style:{width:`${e}%`}})}),ur=({src:e,onEndAd:o,onSkipAd:i,skipDelay:n,adText:c="\u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631",onClickAd:s})=>{let m=chunkNWBLCSO4_js.ha(),E=br.useRef(null),[Qe,We]=br.useState(0),[Xe,Ye]=br.useState(0),[Ze,q]=br.useState(false),V=n!==void 0&&n>0,[C,je]=br.useState(V?n:null),[ee,N]=br.useState(false),[D,qe]=br.useState(0),[er,rr]=br.useState(0),[tr,$]=br.useState(true),I=br.useRef(null),[re,U]=br.useState(false),L=(r=3e3)=>{if(re){$(true);return}$(true),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{$(false);},r);};br.useEffect(()=>{let r=E.current;if(!r)return;let l=()=>L(),w=()=>L();return r.addEventListener("mousemove",l),r.addEventListener("touchstart",w),L(),()=>{r.removeEventListener("mousemove",l),r.removeEventListener("touchstart",w),I.current&&clearTimeout(I.current);}},[re]),br.useEffect(()=>{if(!V||!ee)return;let r=setInterval(()=>{je(l=>l===null?l:l<=1?(clearInterval(r),0):l-1);},1e3);return ()=>clearInterval(r)},[ee,V]),br.useEffect(()=>{let r=chunkNWBLCSO4_js.ja();if(!r)return;let l=()=>{N(true),U(false),L(1e3);},w=()=>{N(true),U(false);},ie=()=>{N(false),U(true),$(true),I.current&&clearTimeout(I.current);},oe=()=>N(false),ae=()=>N(false),ne=()=>rr(r.duration);r.addEventListener("play",l),r.addEventListener("playing",w),r.addEventListener("pause",ie),r.addEventListener("waiting",oe),r.addEventListener("error",ae),r.addEventListener("loadedmetadata",ne);let le=r.play();return m(chunkNWBLCSO4_js.a(true)),le!==void 0&&le.then(()=>chunkOJ6XD2ZQ_js.d(100)).catch(()=>chunkOJ6XD2ZQ_js.d(0)),()=>{r.removeEventListener("play",l),r.removeEventListener("playing",w),r.removeEventListener("pause",ie),r.removeEventListener("waiting",oe),r.removeEventListener("error",ae),r.removeEventListener("loadedmetadata",ne);}},[e]);let ir=()=>{let r=chunkNWBLCSO4_js.ja();r?.duration&&(We(r.currentTime/r.duration*100),qe(r.currentTime));},or=()=>{let r=chunkNWBLCSO4_js.ja();r?.duration&&r.buffered.length>0&&Ye(r.buffered.end(r.buffered.length-1)/r.duration*100);},ar=r=>{let l=chunkNWBLCSO4_js.ja();if(l){if(chunkNWBLCSO4_js.ga("isTouchScreen")){L();return}(r.target===E.current||r.target===l)&&(l.paused?(l.play(),m(chunkNWBLCSO4_js.a(true))):(l.pause(),m(chunkNWBLCSO4_js.a(false))));}},nr=()=>{s&&s(D);},te=r=>{let l=Math.floor(r/60).toString().padStart(2,"0"),w=Math.floor(r%60).toString().padStart(2,"0");return `${l}:${w}`};return jsxRuntime.jsxs("div",{id:"video-area",ref:E,onClick:ar,onDoubleClick:()=>{chunkOJ6XD2ZQ_js.f(),chunkOJ6XD2ZQ_js.g();},className:`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"pl-rounded-[12px]"} ${chunkNWBLCSO4_js.ga("isFullScreen")&&"!pl-fixed !pl-w-screen dvh !pl-rounded-none"}`,style:{zIndex:chunkNWBLCSO4_js.ga("isFullScreen")?1e3:"unset"},children:[jsxRuntime.jsx("video",{src:e,autoPlay:true,playsInline:true,className:"pl-absolute pl-size-full",onEnded:()=>o&&o(D),onTimeUpdate:ir,onProgress:or,id:"player-tag"}),jsxRuntime.jsxs("div",{className:`pl-relative pl-z-10 pl-flex pl-flex-col ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"pl-flex-col-reverse"} pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${tr?"pl-opacity-100":"pl-opacity-0 pl-pointer-events-none"}`,children:[jsxRuntime.jsx(cr,{progress:Qe,buffered:Xe}),jsxRuntime.jsxs("div",{className:`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"pl-pb-3"}`,children:[jsxRuntime.jsx(chunkQBSPLP2V_js.c,{}),jsxRuntime.jsxs("div",{className:"pl-flex pl-items-center pl-gap-4",children:[jsxRuntime.jsxs("div",{className:"pl-text-white pl-text-[12px] pl-font-bold",children:[te(er)," / ",te(D)]}),jsxRuntime.jsx(chunkQBSPLP2V_js.b,{}),jsxRuntime.jsxs("div",{className:"pl-relative pl-flex pl-items-center",onMouseOver:()=>!chunkNWBLCSO4_js.ga("isTouchScreen")&&q(true),onMouseLeave:()=>!chunkNWBLCSO4_js.ga("isTouchScreen")&&q(false),children:[jsxRuntime.jsx(chunkYMTPNYEW_js.b,{width:20,height:20}),Ze&&jsxRuntime.jsx(chunkQBSPLP2V_js.a,{className:"pl-left-0",title:chunkNWBLCSO4_js.ga("isPlay")?"\u067E\u062E\u0634":"\u062A\u0648\u0642\u0641"})]})]})]})]}),s&&jsxRuntime.jsxs("button",{onClick:nr,className:`pl-absolute pl-bottom-[73px] ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4"} pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsxRuntime.jsx(ke__default.default,{src:chunkELIJO5CC_js.a.export,alt:"export button",width:16,height:16}),jsxRuntime.jsx("span",{className:`pl-font-medium ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:c})]}),V&&jsxRuntime.jsxs("button",{onClick:()=>i&&i(D),disabled:!!C&&C>0,className:`pl-absolute pl-bottom-[73px] ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 "} pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsxRuntime.jsx(ke__default.default,{src:chunkELIJO5CC_js.a.next,alt:"next button",width:16,height:16}),jsxRuntime.jsx("span",{className:`pl-font-medium ${chunkNWBLCSO4_js.ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:C&&C>0?`${C} \u062B\u0627\u0646\u06CC\u0647`:"\u0631\u062F \u06A9\u0631\u062F\u0646"})]})]})},De=ur;var fr=W__default.default(()=>import('./staticPlayer-JXFZGQDZ.js')),yr=W__default.default(()=>import('./vodPlayer-EPI4JJHU.js')),Pr=W__default.default(()=>import('./VideoHighLighter-QC663PT7.js')),hr=e=>{let o=chunkNWBLCSO4_js.ha(),{params:i}=chunkNWBLCSO4_js.ia(({videoData:{isReady:s,params:m,hiddenAd:E}})=>({isReady:s,params:m,hiddenAd:E}),reactRedux.shallowEqual);br.useEffect(()=>(i.id&&e.params.id!==i.id&&chunkNWBLCSO4_js.Z(),()=>{i.id&&chunkNWBLCSO4_js.Z();}),[e.params.id]),Me(e.params),Ne(),chunkNWBLCSO4_js.ia(({controller:{isFullScreen:s}})=>({isFullScreen:s}),reactRedux.shallowEqual);let n=async()=>{let s=await chunk6W23FTCG_js.c(e.params.subtitles);o(chunkNWBLCSO4_js.s({...i,subtitles:s}));};if(br.useEffect(()=>{i.id&&String(e.params.type)==="static"&&e.params.subtitles&&e.params.subtitles.length&&setTimeout(()=>{n();},30);},[i.id]),e.params.vhl_status)return jsxRuntime.jsx(Pr,{});if(chunkNWBLCSO4_js.ga("hasAdvertisement"))return jsxRuntime.jsx(De,{src:i.advertisement?.videoUrl,onSkipAd:s=>{o(chunkNWBLCSO4_js.D(true)),i.advertisement?.onSkipAd&&i.advertisement.onSkipAd(s);},onEndAd:s=>{o(chunkNWBLCSO4_js.D(true)),i.advertisement?.onEndAd&&i.advertisement.onEndAd(s);},skipDelay:i.advertisement?.skipDelay,adText:i.advertisement?.adText,onClickAd:i.advertisement?.onClickAd});let c=jsxRuntime.jsx(jsxRuntime.Fragment,{});return chunkNWBLCSO4_js.ga("isReady")&&(c=jsxRuntime.jsx("div",{className:`${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"pl-rounded-[12px]"}`,style:{touchAction:"pan-y",userSelect:"none"},children:chunkNWBLCSO4_js.ga("isStaticFormat")?jsxRuntime.jsx(fr,{}):jsxRuntime.jsx(yr,{})})),jsxRuntime.jsxs("div",{dir:"rtl",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${chunkNWBLCSO4_js.ga("isFullScreen")&&"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]"}`,style:{zIndex:1e3},id:"parent-player",children:[chunkNWBLCSO4_js.ga("isFirstPlay")&&jsxRuntime.jsx("div",{className:`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${!chunkNWBLCSO4_js.ga("isTouchScreen")&&!chunkNWBLCSO4_js.ga("isFullScreen")&&"pl-rounded-[12px]"}`,children:jsxRuntime.jsx(chunkYMTPNYEW_js.a,{})}),c]})},_e=hr;chunkWO4IQUGO_js.e();var X=class extends br__default.default.Component{state={hasError:false,error:null,errorInfo:null};static getDerivedStateFromError(o){return {hasError:true}}componentDidCatch(o,i){this.setState({error:o,errorInfo:i}),chunkNWBLCSO4_js.Ga({type:"OTHER_ERROR",message:o.message});}render(){return this.state.hasError?jsxRuntime.jsx(jsxRuntime.Fragment,{}):this.props.children}},K=X;var Er=({params:e})=>jsxRuntime.jsx(reactRedux.Provider,{store:chunkNWBLCSO4_js.Q,children:jsxRuntime.jsx(K,{children:jsxRuntime.jsx(_e,{params:e})})});chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var Ar=()=>(chunkNWBLCSO4_js.ia(({miniPlayer:{play:e}})=>({play:e}),reactRedux.shallowEqual),jsxRuntime.jsx("div",{className:`${!chunkNWBLCSO4_js.ga("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsxRuntime.jsx(ke__default.default,{alt:"",src:chunkNWBLCSO4_js.ga("isPlayMiniPlayer")?chunkELIJO5CC_js.a.bigPause:chunkELIJO5CC_js.a.bigPlay,width:20,height:20,onClick:e=>chunkOJ6XD2ZQ_js.c(e),onDoubleClick:e=>e.stopPropagation(),className:`${chunkNWBLCSO4_js.ga("isPlayMiniPlayer")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),He=Ar;chunkWO4IQUGO_js.e();chunkWO4IQUGO_js.e();var Mr=()=>{let e=chunkNWBLCSO4_js.ha(),o=chunkNWBLCSO4_js.ia(n=>n.miniPlayer.details),i=chunkNWBLCSO4_js.ia(n=>n.miniPlayer.params);return br.useEffect(()=>{let n=new z__default.default(chunk76V6A3GI_js.d());return z__default.default.isSupported()?(n.attachMedia(document.getElementById("mini-player-video-tag")),n.on(z__default.default.Events.MEDIA_ATTACHED,()=>chunk76V6A3GI_js.C(n))):chunkNWBLCSO4_js.ja().canPlayType("application/vnd.apple.mpegurl")&&(chunkNWBLCSO4_js.ja().src=o.stream_link,chunk76V6A3GI_js.b()),()=>{e(chunkNWBLCSO4_js.P()),n.detachMedia(),n.off(z__default.default.Events.MEDIA_ATTACHED,()=>chunk76V6A3GI_js.C(n));}},[]),br.useEffect(()=>{i.currentTime&&(e(chunkNWBLCSO4_js.O(true)),chunkNWBLCSO4_js.ka().currentTime=i.currentTime,e(chunkNWBLCSO4_js.a(false)),chunkNWBLCSO4_js.ja()?.pause());},[i.currentTime]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("video",{onPlay:()=>e(chunkNWBLCSO4_js.O(true)),onEnded:()=>e(chunkNWBLCSO4_js.O(false)),onError:chunk76V6A3GI_js.a,poster:i.banner?i.banner:o.banner,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true,muted:true})})},Ue=Mr;chunkWO4IQUGO_js.e();var Lr=()=>{let e=chunkNWBLCSO4_js.ha(),o=chunkNWBLCSO4_js.ia(i=>i.miniPlayer.params);return br.useEffect(()=>{o.currentTime&&(e(chunkNWBLCSO4_js.O(true)),chunkNWBLCSO4_js.ka().currentTime=o.currentTime,e(chunkNWBLCSO4_js.a(false)),chunkNWBLCSO4_js.ja()?.pause());},[o.currentTime]),jsxRuntime.jsx("video",{poster:o.banner,onPlay:()=>e(chunkNWBLCSO4_js.O(true)),onEnded:()=>e(chunkNWBLCSO4_js.O(false)),onError:chunk76V6A3GI_js.a,src:o.id,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true})},Be=Lr;var Vr=()=>{let e=chunkNWBLCSO4_js.ia(o=>o.miniPlayer.params.type);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e==="static"?jsxRuntime.jsx(Be,{}):jsxRuntime.jsx(Ue,{})})},Oe=Vr;var Je=({params:e})=>{let o=chunkNWBLCSO4_js.ha(),i=chunkNWBLCSO4_js.ia(m=>m.miniPlayer.details),n=chunkNWBLCSO4_js.ia(m=>m.miniPlayer.params);chunkNWBLCSO4_js.ia(m=>m.miniPlayer.play);let c=chunkNWBLCSO4_js.ia(m=>m.videoData.params);br.useEffect(()=>{o(chunkNWBLCSO4_js.M(e));},[]);let s=async()=>await chunk6W23FTCG_js.a(e.id);return br.useEffect(()=>{e.id&&e.type==="vod"&&s();},[e.id]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.stream_link||n.type==="static"&&n.id?jsxRuntime.jsxs("div",{id:"miniPlayer-video-area",style:{zIndex:1003},className:"pl-relative pl-w-full pl-h-full",children:[jsxRuntime.jsx("div",{className:`pl-absolute pl-z-[1000000] pl-top-3 pl-right-3 pl-cursor-pointer ${chunkNWBLCSO4_js.ga("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,onClick:()=>{c.id===n.id&&(chunkNWBLCSO4_js.ja().currentTime=chunkNWBLCSO4_js.ka().currentTime,o(chunkNWBLCSO4_js.c(chunkNWBLCSO4_js.ka().currentTime))),localStorage.setItem("close-miniPlayer","true"),e.onClose();},children:jsxRuntime.jsx(ke__default.default,{className:"pl-cursor-pointer",src:chunkELIJO5CC_js.a.closeSquare,alt:"close-square",width:16,height:16})}),jsxRuntime.jsx("div",{className:`pl-w-full pl-absolute pl-bottom-0 animate__animated animate__faster pl-z-[1000000] ${chunkNWBLCSO4_js.ga("isActiveElements")&&!chunkNWBLCSO4_js.ga("isLoading")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,children:jsxRuntime.jsx("div",{className:"pl-w-full pl-flex pl-justify-center",children:jsxRuntime.jsx(He,{})})}),jsxRuntime.jsx(Oe,{})]}):jsxRuntime.jsx("div",{className:"pl-w-full pl-h-full pl-bg-white"})})};var Hr=({params:e})=>jsxRuntime.jsx(reactRedux.Provider,{store:chunkNWBLCSO4_js.Q,children:jsxRuntime.jsx(K,{children:jsxRuntime.jsx(Je,{params:e})})});exports.MiniPlayerLibrary=Hr;exports.VideoPlayerLibrary=Er;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.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/components/custom-components/advertisement/Advertisement.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_cjs_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","ProgressBar","progress","buffered","jsx","Advertisement","src","onEndAd","onSkipAd","skipDelay","adText","onClickAd","containerRef","setProgress","useState","setBuffered","showTooltip","setShowTooltip","hasSkip","skipCounter","setSkipCounter","isCounting","setIsCounting","currentTime","setCurrentTime","duration","setDuration","showControls","setShowControls","hideControlsTimeout","isPaused","setIsPaused","resetHideControlsTimer","delay","videoContainer","mouseMoveHandler","touchStartHandler","interval","prev","video","handlePlay","handlePause","handleWaiting","handleError","handleLoadedMetadata","playPromise","setPlay","handleTimeUpdate","handleProgress","handleClick","e","handleAdClick","formatTime","time","minutes","seconds","jsxs","handleLockOrientation","fullScreen_default","soundVolume_default","playPause_default","controllbarTooltip_default","Image","importImages_default","Advertisement_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","hiddenAd","shallowEqual","clearRedux","isFullScreen","handleValidateSubtitlesInStatic","validSubtitles","filterValidSubtitles","setHiddenAd","element","Fragment","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","MiniPlayerLibrary"],"mappings":"8zBAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CASA,IAAMC,GAAmBC,CAAAA,EAAe,CACtC,IAAMC,CAAAA,CAAWC,mBAAAA,EAAe,CAE5BC,CAAAA,CAAuB,EAAC,CAEtBC,CAAAA,CAAyB,IAAM,CACnCH,CAAAA,CAASI,kBAAAA,CAAgBF,CAAW,CAAC,EACrCF,CAAAA,CAASK,kBAAAA,CAAW,IAAI,CAAC,EAC3B,CAAA,CAEMC,CAAAA,CAAgB,IAAM,CACpBP,CAAAA,CAAM,IAAA,GACV,YAAA,CAAa,OAAA,CAAQ,aAAA,CAAeA,CAAAA,CAAM,IAAK,EAC/CG,CAAAA,CAAY,IAAA,CAAOH,CAAAA,CAAM,IAAA,EAE7B,CAAA,CAE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A,CAAKC,kBAAAA,CAAO,WAAA,CACZ,IAAI,cAAA,CACJ,KAAA,CAAO,EAAA,CACP,MAAA,CAAQ,EAAA,CACZ,CAAA,CACJ,CAAA,CACA3D,cAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAW,CAAA,mFAAA,EAAsFb,mBAAAA,CAAAA,kBAAyC,CAAA,EAAK,CAACA,mBAAAA,CAAAA,WAAkC,CAAA,CACjL,yCACA,yCACF,CAAA,CAAA,CACI,QAAA,CAAAa,cAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qCAAA,CACX,QAAA,CAAAA,cAAAA,CAAC6F,EAAAA,CAAA,EAAoB,CAAA,CACzB,CAAA,CACR,CAAA,CACA7F,cAAAA,CAAC+G,EAAAA,CAAA,EAAS,CAAA,CAAA,CACd,CAAA,CAEA/G,cAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,iCAAA,CAAkC,CAAA,CAGzD,CAER,CAAA,CDhEO,IAAMsH,EAAAA,CAAoB,CAAC,CAChC,OAAAnD,CACF,CAAA,GAIInE,cAAAA,CAACyF,mBAAAA,CAAA,CAAS,KAAA,CAAOhG,kBAAAA,CACf,QAAA,CAAAO,eAACuF,CAAAA,CAAA,CACC,QAAA,CAAAvF,cAAAA,CAACgH,EAAAA,CAAA,CAAW,MAAA,CAAQ7C,CAAAA,CAAQ,EAC9B,CAAA,CACF","file":"index.js","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 { useAppDispatch, 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 Loader from \"../custom-components/loader/loader\";\r\nimport { filterValidSubtitles } from \"../../helpers/redux/actions/videoData.actions\";\r\nimport { setPlayerParams, setHiddenAd } from \"../../helpers/redux/slices/videoDataSlice\";\r\nimport Advertisement from \"../custom-components/advertisement/Advertisement\";\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 dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { isReady, params, hiddenAd } }) => ({ isReady, params, hiddenAd }), 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 const handleValidateSubtitlesInStatic = async () => {\r\n const validSubtitles = await filterValidSubtitles(props.params.subtitles!);\r\n dispatch(setPlayerParams({ ...params, subtitles: validSubtitles }));\r\n };\r\n\r\n useEffect(() => {\r\n if (params.id) {\r\n if (String(props.params.type) === PlayerTypes.static && props.params.subtitles && props.params.subtitles.length) {\r\n setTimeout(() => {\r\n handleValidateSubtitlesInStatic();\r\n }, 30);\r\n }\r\n }\r\n }, [params.id]);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n if (conditions(ConditionName.hasAdvertisement))\r\n return (\r\n <Advertisement\r\n src={params.advertisement?.videoUrl!}\r\n onSkipAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onSkipAd) params.advertisement.onSkipAd(currentTime);\r\n }}\r\n onEndAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onEndAd) params.advertisement.onEndAd(currentTime);\r\n }}\r\n skipDelay={params.advertisement?.skipDelay}\r\n adText={params.advertisement?.adText}\r\n onClickAd={params.advertisement?.onClickAd}\r\n />\r\n );\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`} style={{ touchAction: \"pan-y\", userSelect: \"none\" }}>\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) &&\r\n \"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]\"\r\n }`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen }}\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 = async () => {\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n subtitles: undefined,\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 { useRef, useState, useEffect } from \"react\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport SoundVolume from \"../soundVolume/soundVolume\";\r\nimport FullScreen from \"../fullScreen/fullScreen\";\r\nimport PlayPause from \"../playPause/playPause\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { useAppDispatch } from \"../../../helpers/redux/hooks\";\r\nimport { handleChangeSoundVolume, handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { setPlay } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\n\r\ninterface ProgressBarProps {\r\n progress: number;\r\n buffered: number;\r\n}\r\n\r\nconst ProgressBar: React.FC<ProgressBarProps> = ({ progress, buffered }) => (\r\n <div className={`pl-relative pl-w-full pl-h-0.5 ${conditions(ConditionName.isTouchScreenPortrait) && \"!pl-h-1\"} pl-bg-gray-highLight`}>\r\n {/* <div className=\"pl-absolute pl-top-0 pl-left-0 pl-h-0.5 pl-bg-gray-400\" style={{ width: `${buffered}%` }} /> */}\r\n <div\r\n className=\"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear\"\r\n style={{ width: `${progress}%` }}\r\n />\r\n </div>\r\n);\r\n\r\ninterface AdvertisementProps {\r\n src: string;\r\n onEndAd?: (currentTime: number) => void;\r\n onSkipAd?: (currentTime: number) => void;\r\n skipDelay?: number;\r\n adText?: string;\r\n onClickAd?: (currentTime: number) => void;\r\n}\r\n\r\nconst Advertisement: React.FC<AdvertisementProps> = ({ src, onEndAd, onSkipAd, skipDelay, adText = \"اطلاعات بیشتر\", onClickAd }) => {\r\n const dispatch = useAppDispatch();\r\n const containerRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [progress, setProgress] = useState(0);\r\n const [buffered, setBuffered] = useState(0);\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const hasSkip = skipDelay !== undefined && skipDelay > 0;\r\n const [skipCounter, setSkipCounter] = useState<number | null>(hasSkip ? skipDelay! : null);\r\n const [isCounting, setIsCounting] = useState(false);\r\n\r\n const [currentTime, setCurrentTime] = useState(0);\r\n const [duration, setDuration] = useState(0);\r\n\r\n const [showControls, setShowControls] = useState(true);\r\n const hideControlsTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const [isPaused, setIsPaused] = useState(false);\r\n\r\n const resetHideControlsTimer = (delay = 3000) => {\r\n if (isPaused) {\r\n setShowControls(true);\r\n return;\r\n }\r\n\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n hideControlsTimeout.current = setTimeout(() => {\r\n setShowControls(false);\r\n }, delay);\r\n };\r\n\r\n useEffect(() => {\r\n const videoContainer = containerRef.current;\r\n if (!videoContainer) return;\r\n\r\n const mouseMoveHandler = () => resetHideControlsTimer();\r\n const touchStartHandler = () => resetHideControlsTimer();\r\n\r\n videoContainer.addEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.addEventListener(\"touchstart\", touchStartHandler);\r\n\r\n resetHideControlsTimer();\r\n\r\n return () => {\r\n videoContainer.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.removeEventListener(\"touchstart\", touchStartHandler);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n }, [isPaused]);\r\n\r\n useEffect(() => {\r\n if (!hasSkip || !isCounting) return;\r\n\r\n const interval = setInterval(() => {\r\n setSkipCounter((prev) => {\r\n if (prev === null) return prev;\r\n if (prev <= 1) {\r\n clearInterval(interval);\r\n return 0;\r\n }\r\n return prev - 1;\r\n });\r\n }, 1000);\r\n\r\n return () => clearInterval(interval);\r\n }, [isCounting, hasSkip]);\r\n\r\n useEffect(() => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n const handlePlay = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n resetHideControlsTimer(1000);\r\n };\r\n\r\n const handlePause = () => {\r\n setIsCounting(false);\r\n setIsPaused(true);\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n\r\n const handleWaiting = () => setIsCounting(false);\r\n const handleError = () => setIsCounting(false);\r\n const handleLoadedMetadata = () => setDuration(video.duration);\r\n\r\n video.addEventListener(\"play\", handlePlay);\r\n video.addEventListener(\"pause\", handlePause);\r\n video.addEventListener(\"waiting\", handleWaiting);\r\n video.addEventListener(\"error\", handleError);\r\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n\r\n const playPromise = video.play();\r\n dispatch(setPlay(true));\r\n if (playPromise !== undefined) playPromise.then(() => handleChangeSoundVolume(100)).catch(() => handleChangeSoundVolume(0));\r\n\r\n return () => {\r\n video.removeEventListener(\"play\", handlePlay);\r\n video.removeEventListener(\"pause\", handlePause);\r\n video.removeEventListener(\"waiting\", handleWaiting);\r\n video.removeEventListener(\"error\", handleError);\r\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n };\r\n }, [src]);\r\n\r\n useEffect(() => {\r\n setIsCounting(true);\r\n }, []);\r\n\r\n const handleTimeUpdate = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration) {\r\n setProgress((video.currentTime / video.duration) * 100);\r\n setCurrentTime(video.currentTime);\r\n }\r\n };\r\n\r\n const handleProgress = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration && video.buffered.length > 0) {\r\n setBuffered((video.buffered.end(video.buffered.length - 1) / video.duration) * 100);\r\n }\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n if (conditions(ConditionName.isTouchScreen)) {\r\n resetHideControlsTimer();\r\n return;\r\n }\r\n\r\n if (e.target === containerRef.current || e.target === video) {\r\n if (video.paused) {\r\n video.play();\r\n dispatch(setPlay(true));\r\n } else {\r\n video.pause();\r\n dispatch(setPlay(false));\r\n }\r\n }\r\n };\r\n\r\n const handleAdClick = () => {\r\n if (onClickAd) {\r\n onClickAd(currentTime);\r\n }\r\n };\r\n\r\n const formatTime = (time: number) => {\r\n const minutes = Math.floor(time / 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n const seconds = Math.floor(time % 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n return `${minutes}:${seconds}`;\r\n };\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n ref={containerRef}\r\n onClick={handleClick}\r\n onDoubleClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n className={`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-fixed !pl-w-screen dvh !pl-rounded-none\"}`}\r\n style={{\r\n zIndex: conditions(ConditionName.isFullScreen) ? zIndex.videoPlayerInFullScreen : \"unset\",\r\n }}\r\n >\r\n <video\r\n src={src}\r\n autoPlay\r\n playsInline\r\n className=\"pl-absolute pl-size-full\"\r\n onEnded={() => onEndAd && onEndAd(currentTime)}\r\n onTimeUpdate={handleTimeUpdate}\r\n onProgress={handleProgress}\r\n id=\"player-tag\"\r\n />\r\n\r\n <div\r\n className={`pl-relative pl-z-10 pl-flex pl-flex-col ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"pl-flex-col-reverse\"\r\n } pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${showControls ? \"pl-opacity-100\" : \"pl-opacity-0 pl-pointer-events-none\"}`}\r\n >\r\n <ProgressBar progress={progress} buffered={buffered} />\r\n\r\n <div\r\n className={`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!conditions(ConditionName.isTouchScreenPortrait) && \"pl-pb-3\"}`}\r\n >\r\n <FullScreen />\r\n <div className=\"pl-flex pl-items-center pl-gap-4\">\r\n <div className=\"pl-text-white pl-text-[12px] pl-font-bold\">\r\n {formatTime(duration)} / {formatTime(currentTime)}\r\n </div>\r\n <SoundVolume />\r\n <div\r\n className=\"pl-relative pl-flex pl-items-center\"\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n >\r\n <PlayPause width={20} height={20} />\r\n {showTooltip && <ControllbarTooltip className=\"pl-left-0\" title={conditions(ConditionName.isPlay) ? \"پخش\" : \"توقف\"} />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {onClickAd && (\r\n <button\r\n onClick={handleAdClick}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4\"\r\n } pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.export} alt=\"export button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>{adText}</span>\r\n </button>\r\n )}\r\n\r\n {hasSkip && (\r\n <button\r\n onClick={() => onSkipAd && onSkipAd(currentTime)}\r\n disabled={!!skipCounter && skipCounter > 0}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 \"\r\n } pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.next} alt=\"next button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>\r\n {skipCounter && skipCounter > 0 ? `${skipCounter} ثانیه` : \"رد کردن\"}\r\n </span>\r\n </button>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Advertisement;\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/components/custom-components/advertisement/Advertisement.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_cjs_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","ProgressBar","progress","buffered","jsx","Advertisement","src","onEndAd","onSkipAd","skipDelay","adText","onClickAd","containerRef","setProgress","useState","setBuffered","showTooltip","setShowTooltip","hasSkip","skipCounter","setSkipCounter","isCounting","setIsCounting","currentTime","setCurrentTime","duration","setDuration","showControls","setShowControls","hideControlsTimeout","isPaused","setIsPaused","resetHideControlsTimer","delay","videoContainer","mouseMoveHandler","touchStartHandler","interval","prev","video","handlePlay","handlePlaying","handlePause","handleWaiting","handleError","handleLoadedMetadata","playPromise","setPlay","handleTimeUpdate","handleProgress","handleClick","e","handleAdClick","formatTime","time","minutes","seconds","jsxs","handleLockOrientation","fullScreen_default","soundVolume_default","playPause_default","controllbarTooltip_default","Image","importImages_default","Advertisement_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","hiddenAd","shallowEqual","clearRedux","isFullScreen","handleValidateSubtitlesInStatic","validSubtitles","filterValidSubtitles","setHiddenAd","element","Fragment","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","MiniPlayerLibrary"],"mappings":"8zBAAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,CCAAA,kBAAAA,EAAAA,C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CAAAO,eAACwF,CAAAA,CAAA,CACC,QAAA,CAAAxF,cAAAA,CAACiH,EAAAA,CAAA,CAAW,MAAA,CAAQ7C,CAAAA,CAAQ,EAC9B,CAAA,CACF","file":"index.js","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 { useAppDispatch, 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 Loader from \"../custom-components/loader/loader\";\r\nimport { filterValidSubtitles } from \"../../helpers/redux/actions/videoData.actions\";\r\nimport { setPlayerParams, setHiddenAd } from \"../../helpers/redux/slices/videoDataSlice\";\r\nimport Advertisement from \"../custom-components/advertisement/Advertisement\";\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 dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { isReady, params, hiddenAd } }) => ({ isReady, params, hiddenAd }), 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 const handleValidateSubtitlesInStatic = async () => {\r\n const validSubtitles = await filterValidSubtitles(props.params.subtitles!);\r\n dispatch(setPlayerParams({ ...params, subtitles: validSubtitles }));\r\n };\r\n\r\n useEffect(() => {\r\n if (params.id) {\r\n if (String(props.params.type) === PlayerTypes.static && props.params.subtitles && props.params.subtitles.length) {\r\n setTimeout(() => {\r\n handleValidateSubtitlesInStatic();\r\n }, 30);\r\n }\r\n }\r\n }, [params.id]);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n if (conditions(ConditionName.hasAdvertisement))\r\n return (\r\n <Advertisement\r\n src={params.advertisement?.videoUrl!}\r\n onSkipAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onSkipAd) params.advertisement.onSkipAd(currentTime);\r\n }}\r\n onEndAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onEndAd) params.advertisement.onEndAd(currentTime);\r\n }}\r\n skipDelay={params.advertisement?.skipDelay}\r\n adText={params.advertisement?.adText}\r\n onClickAd={params.advertisement?.onClickAd}\r\n />\r\n );\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`} style={{ touchAction: \"pan-y\", userSelect: \"none\" }}>\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) &&\r\n \"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]\"\r\n }`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen }}\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 = async () => {\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n subtitles: undefined,\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 { useRef, useState, useEffect } from \"react\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport SoundVolume from \"../soundVolume/soundVolume\";\r\nimport FullScreen from \"../fullScreen/fullScreen\";\r\nimport PlayPause from \"../playPause/playPause\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { useAppDispatch } from \"../../../helpers/redux/hooks\";\r\nimport { handleChangeSoundVolume, handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { setPlay } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\n\r\ninterface ProgressBarProps {\r\n progress: number;\r\n buffered: number;\r\n}\r\n\r\nconst ProgressBar: React.FC<ProgressBarProps> = ({ progress, buffered }) => (\r\n <div className={`pl-relative pl-w-full pl-h-0.5 ${conditions(ConditionName.isTouchScreenPortrait) && \"!pl-h-1\"} pl-bg-gray-highLight`}>\r\n {/* <div className=\"pl-absolute pl-top-0 pl-left-0 pl-h-0.5 pl-bg-gray-400\" style={{ width: `${buffered}%` }} /> */}\r\n <div\r\n className=\"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear\"\r\n style={{ width: `${progress}%` }}\r\n />\r\n </div>\r\n);\r\n\r\ninterface AdvertisementProps {\r\n src: string;\r\n onEndAd?: (currentTime: number) => void;\r\n onSkipAd?: (currentTime: number) => void;\r\n skipDelay?: number;\r\n adText?: string;\r\n onClickAd?: (currentTime: number) => void;\r\n}\r\n\r\nconst Advertisement: React.FC<AdvertisementProps> = ({ src, onEndAd, onSkipAd, skipDelay, adText = \"اطلاعات بیشتر\", onClickAd }) => {\r\n const dispatch = useAppDispatch();\r\n const containerRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [progress, setProgress] = useState(0);\r\n const [buffered, setBuffered] = useState(0);\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const hasSkip = skipDelay !== undefined && skipDelay > 0;\r\n const [skipCounter, setSkipCounter] = useState<number | null>(hasSkip ? skipDelay! : null);\r\n const [isCounting, setIsCounting] = useState(false);\r\n\r\n const [currentTime, setCurrentTime] = useState(0);\r\n const [duration, setDuration] = useState(0);\r\n\r\n const [showControls, setShowControls] = useState(true);\r\n const hideControlsTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const [isPaused, setIsPaused] = useState(false);\r\n\r\n const resetHideControlsTimer = (delay = 3000) => {\r\n if (isPaused) {\r\n setShowControls(true);\r\n return;\r\n }\r\n\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n hideControlsTimeout.current = setTimeout(() => {\r\n setShowControls(false);\r\n }, delay);\r\n };\r\n\r\n useEffect(() => {\r\n const videoContainer = containerRef.current;\r\n if (!videoContainer) return;\r\n\r\n const mouseMoveHandler = () => resetHideControlsTimer();\r\n const touchStartHandler = () => resetHideControlsTimer();\r\n\r\n videoContainer.addEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.addEventListener(\"touchstart\", touchStartHandler);\r\n\r\n resetHideControlsTimer();\r\n\r\n return () => {\r\n videoContainer.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.removeEventListener(\"touchstart\", touchStartHandler);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n }, [isPaused]);\r\n\r\n useEffect(() => {\r\n if (!hasSkip || !isCounting) return;\r\n\r\n const interval = setInterval(() => {\r\n setSkipCounter((prev) => {\r\n if (prev === null) return prev;\r\n if (prev <= 1) {\r\n clearInterval(interval);\r\n return 0;\r\n }\r\n return prev - 1;\r\n });\r\n }, 1000);\r\n\r\n return () => clearInterval(interval);\r\n }, [isCounting, hasSkip]);\r\n\r\n useEffect(() => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n const handlePlay = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n resetHideControlsTimer(1000);\r\n };\r\n\r\n const handlePlaying = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n };\r\n\r\n const handlePause = () => {\r\n setIsCounting(false);\r\n setIsPaused(true);\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n\r\n const handleWaiting = () => setIsCounting(false);\r\n const handleError = () => setIsCounting(false);\r\n const handleLoadedMetadata = () => setDuration(video.duration);\r\n\r\n video.addEventListener(\"play\", handlePlay);\r\n video.addEventListener(\"playing\", handlePlaying);\r\n video.addEventListener(\"pause\", handlePause);\r\n video.addEventListener(\"waiting\", handleWaiting);\r\n video.addEventListener(\"error\", handleError);\r\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n\r\n const playPromise = video.play();\r\n dispatch(setPlay(true));\r\n if (playPromise !== undefined) playPromise.then(() => handleChangeSoundVolume(100)).catch(() => handleChangeSoundVolume(0));\r\n\r\n return () => {\r\n video.removeEventListener(\"play\", handlePlay);\r\n video.removeEventListener(\"playing\", handlePlaying);\r\n video.removeEventListener(\"pause\", handlePause);\r\n video.removeEventListener(\"waiting\", handleWaiting);\r\n video.removeEventListener(\"error\", handleError);\r\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n };\r\n }, [src]);\r\n\r\n const handleTimeUpdate = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration) {\r\n setProgress((video.currentTime / video.duration) * 100);\r\n setCurrentTime(video.currentTime);\r\n }\r\n };\r\n\r\n const handleProgress = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration && video.buffered.length > 0) {\r\n setBuffered((video.buffered.end(video.buffered.length - 1) / video.duration) * 100);\r\n }\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n if (conditions(ConditionName.isTouchScreen)) {\r\n resetHideControlsTimer();\r\n return;\r\n }\r\n\r\n if (e.target === containerRef.current || e.target === video) {\r\n if (video.paused) {\r\n video.play();\r\n dispatch(setPlay(true));\r\n } else {\r\n video.pause();\r\n dispatch(setPlay(false));\r\n }\r\n }\r\n };\r\n\r\n const handleAdClick = () => {\r\n if (onClickAd) {\r\n onClickAd(currentTime);\r\n }\r\n };\r\n\r\n const formatTime = (time: number) => {\r\n const minutes = Math.floor(time / 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n const seconds = Math.floor(time % 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n return `${minutes}:${seconds}`;\r\n };\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n ref={containerRef}\r\n onClick={handleClick}\r\n onDoubleClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n className={`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-fixed !pl-w-screen dvh !pl-rounded-none\"}`}\r\n style={{\r\n zIndex: conditions(ConditionName.isFullScreen) ? zIndex.videoPlayerInFullScreen : \"unset\",\r\n }}\r\n >\r\n <video\r\n src={src}\r\n autoPlay\r\n playsInline\r\n className=\"pl-absolute pl-size-full\"\r\n onEnded={() => onEndAd && onEndAd(currentTime)}\r\n onTimeUpdate={handleTimeUpdate}\r\n onProgress={handleProgress}\r\n id=\"player-tag\"\r\n />\r\n\r\n <div\r\n className={`pl-relative pl-z-10 pl-flex pl-flex-col ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"pl-flex-col-reverse\"\r\n } pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${showControls ? \"pl-opacity-100\" : \"pl-opacity-0 pl-pointer-events-none\"}`}\r\n >\r\n <ProgressBar progress={progress} buffered={buffered} />\r\n\r\n <div\r\n className={`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!conditions(ConditionName.isTouchScreenPortrait) && \"pl-pb-3\"}`}\r\n >\r\n <FullScreen />\r\n <div className=\"pl-flex pl-items-center pl-gap-4\">\r\n <div className=\"pl-text-white pl-text-[12px] pl-font-bold\">\r\n {formatTime(duration)} / {formatTime(currentTime)}\r\n </div>\r\n <SoundVolume />\r\n <div\r\n className=\"pl-relative pl-flex pl-items-center\"\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n >\r\n <PlayPause width={20} height={20} />\r\n {showTooltip && <ControllbarTooltip className=\"pl-left-0\" title={conditions(ConditionName.isPlay) ? \"پخش\" : \"توقف\"} />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {onClickAd && (\r\n <button\r\n onClick={handleAdClick}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4\"\r\n } pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.export} alt=\"export button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>{adText}</span>\r\n </button>\r\n )}\r\n\r\n {hasSkip && (\r\n <button\r\n onClick={() => onSkipAd && onSkipAd(currentTime)}\r\n disabled={!!skipCounter && skipCounter > 0}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 \"\r\n } pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.next} alt=\"next button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>\r\n {skipCounter && skipCounter > 0 ? `${skipCounter} ثانیه` : \"رد کردن\"}\r\n </span>\r\n </button>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Advertisement;\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;"]}
|
package/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$5,d as d$1,C,b as b$2}from'./chunk-YOPXJMDB.mjs';import {a,b as b$1}from'./chunk-MZ7MYO2W.mjs';import {a as a$1,c as c$1,b as b$3}from'./chunk-X2CXB4EG.mjs';import {c as c$2,b,a as a$4}from'./chunk-PSWIQAQW.mjs';import {d,f,g,c as c$3,a as a$6,e as e$1}from'./chunk-RMMLEFXE.mjs';import {Ga,Q,ha,ia,Z,ga,D,M,ka,ja,c,s,a as a$3,O,P,R,x}from'./chunk-Z7KJT5TM.mjs';import {a as a$2}from'./chunk-5A5K7UGN.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {Provider,shallowEqual}from'react-redux';import br,{useEffect,useRef,useState}from'react';import W from'next/dynamic';import ke from'next/legacy/image';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import B from'hls.js';e();e();e();e();var sr=e=>{let o=ha(),i={},n=()=>{o(s(i)),o(x(true));},c=()=>{e.uuid&&(localStorage.setItem("hamrahiUUID",e.uuid),i.uuid=e.uuid);},s$1=()=>{i={provider:"cafevdo",...e};},m=async()=>{i={uuid:R(),provider:"cafevdo",...e,subtitles:void 0,id:e.id?window.atob(e.id):void 0,banner:e.banner&&e.banner!=="undefined"?e.banner:void 0};},I=async()=>{i={},Object.keys(e).includes("type")&&(String(e.type)==="vod"?s$1():String(e.type)==="static"&&m(),c(),n());};useEffect(()=>{I();},[e]);},Me=sr;e();e();var mr=(e,o)=>{let i=useRef(o);useEffect(()=>{i.current=o;},[]),useEffect(()=>{let n=c=>{c.code===e&&!["INPUT","TEXTAREA"].includes(c.target.nodeName)&&!c.target.isContentEditable&&i.current(c);};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]);},T=mr;var dr=()=>{T("Space",e=>{ga("isPressKeySpace")&&a$6(e);}),T("ArrowRight",e=>{ga("isPressKeyArrowRight")&&e$1("forward",15,e);}),T("ArrowLeft",e=>{ga("isPressKeyArrowLeft")&&e$1("backward",15,e);}),T("KeyI",()=>{ga("isPressKeyI")&&ja().requestPictureInPicture();}),T("KeyF",()=>{ga("isPressKeyF")&&f();}),T("KeyM",()=>{if(ga("isPressKeyM")){let{settings:e}=Q.getState().user;d(e.volume?0:50);}}),T("KeyC",()=>{ga("isPressKeyC")&&b$3();});},Ne=dr;e();var cr=({progress:e,buffered:o})=>jsx("div",{className:`pl-relative pl-w-full pl-h-0.5 ${ga("isTouchScreenPortrait")&&"!pl-h-1"} pl-bg-gray-highLight`,children:jsx("div",{className:"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear",style:{width:`${e}%`}})}),ur=({src:e,onEndAd:o,onSkipAd:i,skipDelay:n,adText:c="\u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631",onClickAd:s})=>{let m=ha(),I=useRef(null),[Qe,We]=useState(0),[Xe,Ye]=useState(0),[Ze,q]=useState(false),D=n!==void 0&&n>0,[N,je]=useState(D?n:null),[ee,L]=useState(false),[$,qe]=useState(0),[er,rr]=useState(0),[tr,R]=useState(true),w=useRef(null),[re,te]=useState(false),k=(r=3e3)=>{if(re){R(true);return}R(true),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{R(false);},r);};useEffect(()=>{let r=I.current;if(!r)return;let l=()=>k(),A=()=>k();return r.addEventListener("mousemove",l),r.addEventListener("touchstart",A),k(),()=>{r.removeEventListener("mousemove",l),r.removeEventListener("touchstart",A),w.current&&clearTimeout(w.current);}},[re]),useEffect(()=>{if(!D||!ee)return;let r=setInterval(()=>{je(l=>l===null?l:l<=1?(clearInterval(r),0):l-1);},1e3);return ()=>clearInterval(r)},[ee,D]),useEffect(()=>{let r=ja();if(!r)return;let l=()=>{L(true),te(false),k(1e3);},A=()=>{L(false),te(true),R(true),w.current&&clearTimeout(w.current);},oe=()=>L(false),ae=()=>L(false),ne=()=>rr(r.duration);r.addEventListener("play",l),r.addEventListener("pause",A),r.addEventListener("waiting",oe),r.addEventListener("error",ae),r.addEventListener("loadedmetadata",ne);let le=r.play();return m(a$3(true)),le!==void 0&&le.then(()=>d(100)).catch(()=>d(0)),()=>{r.removeEventListener("play",l),r.removeEventListener("pause",A),r.removeEventListener("waiting",oe),r.removeEventListener("error",ae),r.removeEventListener("loadedmetadata",ne);}},[e]),useEffect(()=>{L(true);},[]);let ir=()=>{let r=ja();r?.duration&&(We(r.currentTime/r.duration*100),qe(r.currentTime));},or=()=>{let r=ja();r?.duration&&r.buffered.length>0&&Ye(r.buffered.end(r.buffered.length-1)/r.duration*100);},ar=r=>{let l=ja();if(l){if(ga("isTouchScreen")){k();return}(r.target===I.current||r.target===l)&&(l.paused?(l.play(),m(a$3(true))):(l.pause(),m(a$3(false))));}},nr=()=>{s&&s($);},ie=r=>{let l=Math.floor(r/60).toString().padStart(2,"0"),A=Math.floor(r%60).toString().padStart(2,"0");return `${l}:${A}`};return jsxs("div",{id:"video-area",ref:I,onClick:ar,onDoubleClick:()=>{f(),g();},className:`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${!ga("isTouchScreen")&&"pl-rounded-[12px]"} ${ga("isFullScreen")&&"!pl-fixed !pl-w-screen dvh !pl-rounded-none"}`,style:{zIndex:ga("isFullScreen")?1e3:"unset"},children:[jsx("video",{src:e,autoPlay:true,playsInline:true,className:"pl-absolute pl-size-full",onEnded:()=>o&&o($),onTimeUpdate:ir,onProgress:or,id:"player-tag"}),jsxs("div",{className:`pl-relative pl-z-10 pl-flex pl-flex-col ${ga("isTouchScreenPortrait")&&"pl-flex-col-reverse"} pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${tr?"pl-opacity-100":"pl-opacity-0 pl-pointer-events-none"}`,children:[jsx(cr,{progress:Qe,buffered:Xe}),jsxs("div",{className:`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!ga("isTouchScreenPortrait")&&"pl-pb-3"}`,children:[jsx(c$2,{}),jsxs("div",{className:"pl-flex pl-items-center pl-gap-4",children:[jsxs("div",{className:"pl-text-white pl-text-[12px] pl-font-bold",children:[ie(er)," / ",ie($)]}),jsx(b,{}),jsxs("div",{className:"pl-relative pl-flex pl-items-center",onMouseOver:()=>!ga("isTouchScreen")&&q(true),onMouseLeave:()=>!ga("isTouchScreen")&&q(false),children:[jsx(b$1,{width:20,height:20}),Ze&&jsx(a$4,{className:"pl-left-0",title:ga("isPlay")?"\u067E\u062E\u0634":"\u062A\u0648\u0642\u0641"})]})]})]})]}),s&&jsxs("button",{onClick:nr,className:`pl-absolute pl-bottom-[73px] ${ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4"} pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsx(ke,{src:a$2.export,alt:"export button",width:16,height:16}),jsx("span",{className:`pl-font-medium ${ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:c})]}),D&&jsxs("button",{onClick:()=>i&&i($),disabled:!!N&&N>0,className:`pl-absolute pl-bottom-[73px] ${ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 "} pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsx(ke,{src:a$2.next,alt:"next button",width:16,height:16}),jsx("span",{className:`pl-font-medium ${ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:N&&N>0?`${N} \u062B\u0627\u0646\u06CC\u0647`:"\u0631\u062F \u06A9\u0631\u062F\u0646"})]})]})},De=ur;var fr=W(()=>import('./staticPlayer-7YI5JM76.mjs')),yr=W(()=>import('./vodPlayer-TQDB54I6.mjs')),Pr=W(()=>import('./VideoHighLighter-HFNGQEYD.mjs')),hr=e=>{let o=ha(),{params:i}=ia(({videoData:{isReady:s,params:m,hiddenAd:I}})=>({isReady:s,params:m,hiddenAd:I}),shallowEqual);useEffect(()=>(i.id&&e.params.id!==i.id&&Z(),()=>{i.id&&Z();}),[e.params.id]),Me(e.params),Ne(),ia(({controller:{isFullScreen:s}})=>({isFullScreen:s}),shallowEqual);let n=async()=>{let s$1=await c$1(e.params.subtitles);o(s({...i,subtitles:s$1}));};if(useEffect(()=>{i.id&&String(e.params.type)==="static"&&e.params.subtitles&&e.params.subtitles.length&&setTimeout(()=>{n();},30);},[i.id]),e.params.vhl_status)return jsx(Pr,{});if(ga("hasAdvertisement"))return jsx(De,{src:i.advertisement?.videoUrl,onSkipAd:s=>{o(D(true)),i.advertisement?.onSkipAd&&i.advertisement.onSkipAd(s);},onEndAd:s=>{o(D(true)),i.advertisement?.onEndAd&&i.advertisement.onEndAd(s);},skipDelay:i.advertisement?.skipDelay,adText:i.advertisement?.adText,onClickAd:i.advertisement?.onClickAd});let c=jsx(Fragment,{});return ga("isReady")&&(c=jsx("div",{className:`${!ga("isTouchScreen")&&"pl-rounded-[12px]"}`,style:{touchAction:"pan-y",userSelect:"none"},children:ga("isStaticFormat")?jsx(fr,{}):jsx(yr,{})})),jsxs("div",{dir:"rtl",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${ga("isFullScreen")&&"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]"}`,style:{zIndex:1e3},id:"parent-player",children:[ga("isFirstPlay")&&jsx("div",{className:`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${!ga("isTouchScreen")&&!ga("isFullScreen")&&"pl-rounded-[12px]"}`,children:jsx(a,{})}),c]})},_e=hr;e();var X=class extends br.Component{state={hasError:false,error:null,errorInfo:null};static getDerivedStateFromError(o){return {hasError:true}}componentDidCatch(o,i){this.setState({error:o,errorInfo:i}),Ga({type:"OTHER_ERROR",message:o.message});}render(){return this.state.hasError?jsx(Fragment,{}):this.props.children}},U=X;var Er=({params:e})=>jsx(Provider,{store:Q,children:jsx(U,{children:jsx(_e,{params:e})})});e();e();e();var Ar=()=>(ia(({miniPlayer:{play:e}})=>({play:e}),shallowEqual),jsx("div",{className:`${!ga("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsx(ke,{alt:"",src:ga("isPlayMiniPlayer")?a$2.bigPause:a$2.bigPlay,width:20,height:20,onClick:e=>c$3(e),onDoubleClick:e=>e.stopPropagation(),className:`${ga("isPlayMiniPlayer")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),He=Ar;e();e();var Mr=()=>{let e=ha(),o=ia(n=>n.miniPlayer.details),i=ia(n=>n.miniPlayer.params);return useEffect(()=>{let n=new B(d$1());return B.isSupported()?(n.attachMedia(document.getElementById("mini-player-video-tag")),n.on(B.Events.MEDIA_ATTACHED,()=>C(n))):ja().canPlayType("application/vnd.apple.mpegurl")&&(ja().src=o.stream_link,b$2()),()=>{e(P()),n.detachMedia(),n.off(B.Events.MEDIA_ATTACHED,()=>C(n));}},[]),useEffect(()=>{i.currentTime&&(e(O(true)),ka().currentTime=i.currentTime,e(a$3(false)),ja()?.pause());},[i.currentTime]),jsx(Fragment,{children:jsx("video",{onPlay:()=>e(O(true)),onEnded:()=>e(O(false)),onError:a$5,poster:i.banner?i.banner:o.banner,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true,muted:true})})},Ue=Mr;e();var Lr=()=>{let e=ha(),o=ia(i=>i.miniPlayer.params);return useEffect(()=>{o.currentTime&&(e(O(true)),ka().currentTime=o.currentTime,e(a$3(false)),ja()?.pause());},[o.currentTime]),jsx("video",{poster:o.banner,onPlay:()=>e(O(true)),onEnded:()=>e(O(false)),onError:a$5,src:o.id,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true})},Be=Lr;var Vr=()=>{let e=ia(o=>o.miniPlayer.params.type);return jsx(Fragment,{children:e==="static"?jsx(Be,{}):jsx(Ue,{})})},Oe=Vr;var Je=({params:e})=>{let o=ha(),i=ia(m=>m.miniPlayer.details),n=ia(m=>m.miniPlayer.params);ia(m=>m.miniPlayer.play);let c$1=ia(m=>m.videoData.params);useEffect(()=>{o(M(e));},[]);let s=async()=>await a$1(e.id);return useEffect(()=>{e.id&&e.type==="vod"&&s();},[e.id]),jsx(Fragment,{children:i.stream_link||n.type==="static"&&n.id?jsxs("div",{id:"miniPlayer-video-area",style:{zIndex:1003},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 ${ga("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,onClick:()=>{c$1.id===n.id&&(ja().currentTime=ka().currentTime,o(c(ka().currentTime))),localStorage.setItem("close-miniPlayer","true"),e.onClose();},children:jsx(ke,{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] ${ga("isActiveElements")&&!ga("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(He,{})})}),jsx(Oe,{})]}):jsx("div",{className:"pl-w-full pl-h-full pl-bg-white"})})};var Hr=({params:e})=>jsx(Provider,{store:Q,children:jsx(U,{children:jsx(Je,{params:e})})});export{Hr as MiniPlayerLibrary,Er as VideoPlayerLibrary};//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import {a as a$5,d as d$1,C,b as b$2}from'./chunk-YOPXJMDB.mjs';import {a,b as b$1}from'./chunk-MZ7MYO2W.mjs';import {a as a$1,c as c$1,b as b$3}from'./chunk-X2CXB4EG.mjs';import {c as c$2,b,a as a$4}from'./chunk-PSWIQAQW.mjs';import {d,f,g,c as c$3,a as a$6,e as e$1}from'./chunk-RMMLEFXE.mjs';import {Ga,Q,ha,ia,Z,ga,D,M,ka,ja,c,s,a as a$3,O,P,R,x}from'./chunk-Z7KJT5TM.mjs';import {a as a$2}from'./chunk-5A5K7UGN.mjs';import {e}from'./chunk-NXC6LNWJ.mjs';import {Provider,shallowEqual}from'react-redux';import Tr,{useEffect,useRef,useState}from'react';import X from'next/dynamic';import Ve from'next/legacy/image';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import U from'hls.js';e();e();e();e();var pr=e=>{let o=ha(),i={},n=()=>{o(s(i)),o(x(true));},c=()=>{e.uuid&&(localStorage.setItem("hamrahiUUID",e.uuid),i.uuid=e.uuid);},s$1=()=>{i={provider:"cafevdo",...e};},m=async()=>{i={uuid:R(),provider:"cafevdo",...e,subtitles:void 0,id:e.id?window.atob(e.id):void 0,banner:e.banner&&e.banner!=="undefined"?e.banner:void 0};},I=async()=>{i={},Object.keys(e).includes("type")&&(String(e.type)==="vod"?s$1():String(e.type)==="static"&&m(),c(),n());};useEffect(()=>{I();},[e]);},Ce=pr;e();e();var dr=(e,o)=>{let i=useRef(o);useEffect(()=>{i.current=o;},[]),useEffect(()=>{let n=c=>{c.code===e&&!["INPUT","TEXTAREA"].includes(c.target.nodeName)&&!c.target.isContentEditable&&i.current(c);};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]);},T=dr;var cr=()=>{T("Space",e=>{ga("isPressKeySpace")&&a$6(e);}),T("ArrowRight",e=>{ga("isPressKeyArrowRight")&&e$1("forward",15,e);}),T("ArrowLeft",e=>{ga("isPressKeyArrowLeft")&&e$1("backward",15,e);}),T("KeyI",()=>{ga("isPressKeyI")&&ja().requestPictureInPicture();}),T("KeyF",()=>{ga("isPressKeyF")&&f();}),T("KeyM",()=>{if(ga("isPressKeyM")){let{settings:e}=Q.getState().user;d(e.volume?0:50);}}),T("KeyC",()=>{ga("isPressKeyC")&&b$3();});},Le=cr;e();var ur=({progress:e,buffered:o})=>jsx("div",{className:`pl-relative pl-w-full pl-h-0.5 ${ga("isTouchScreenPortrait")&&"!pl-h-1"} pl-bg-gray-highLight`,children:jsx("div",{className:"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear",style:{width:`${e}%`}})}),fr=({src:e,onEndAd:o,onSkipAd:i,skipDelay:n,adText:c="\u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631",onClickAd:s})=>{let m=ha(),I=useRef(null),[We,Xe]=useState(0),[Ye,Ze]=useState(0),[je,ee]=useState(false),D=n!==void 0&&n>0,[N,qe]=useState(D?n:null),[re,L]=useState(false),[$,er]=useState(0),[rr,tr]=useState(0),[ir,R]=useState(true),w=useRef(null),[te,B]=useState(false),k=(r=3e3)=>{if(te){R(true);return}R(true),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{R(false);},r);};useEffect(()=>{let r=I.current;if(!r)return;let l=()=>k(),A=()=>k();return r.addEventListener("mousemove",l),r.addEventListener("touchstart",A),k(),()=>{r.removeEventListener("mousemove",l),r.removeEventListener("touchstart",A),w.current&&clearTimeout(w.current);}},[te]),useEffect(()=>{if(!D||!re)return;let r=setInterval(()=>{qe(l=>l===null?l:l<=1?(clearInterval(r),0):l-1);},1e3);return ()=>clearInterval(r)},[re,D]),useEffect(()=>{let r=ja();if(!r)return;let l=()=>{L(true),B(false),k(1e3);},A=()=>{L(true),B(false);},oe=()=>{L(false),B(true),R(true),w.current&&clearTimeout(w.current);},ae=()=>L(false),ne=()=>L(false),le=()=>tr(r.duration);r.addEventListener("play",l),r.addEventListener("playing",A),r.addEventListener("pause",oe),r.addEventListener("waiting",ae),r.addEventListener("error",ne),r.addEventListener("loadedmetadata",le);let se=r.play();return m(a$3(true)),se!==void 0&&se.then(()=>d(100)).catch(()=>d(0)),()=>{r.removeEventListener("play",l),r.removeEventListener("playing",A),r.removeEventListener("pause",oe),r.removeEventListener("waiting",ae),r.removeEventListener("error",ne),r.removeEventListener("loadedmetadata",le);}},[e]);let or=()=>{let r=ja();r?.duration&&(Xe(r.currentTime/r.duration*100),er(r.currentTime));},ar=()=>{let r=ja();r?.duration&&r.buffered.length>0&&Ze(r.buffered.end(r.buffered.length-1)/r.duration*100);},nr=r=>{let l=ja();if(l){if(ga("isTouchScreen")){k();return}(r.target===I.current||r.target===l)&&(l.paused?(l.play(),m(a$3(true))):(l.pause(),m(a$3(false))));}},lr=()=>{s&&s($);},ie=r=>{let l=Math.floor(r/60).toString().padStart(2,"0"),A=Math.floor(r%60).toString().padStart(2,"0");return `${l}:${A}`};return jsxs("div",{id:"video-area",ref:I,onClick:nr,onDoubleClick:()=>{f(),g();},className:`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${!ga("isTouchScreen")&&"pl-rounded-[12px]"} ${ga("isFullScreen")&&"!pl-fixed !pl-w-screen dvh !pl-rounded-none"}`,style:{zIndex:ga("isFullScreen")?1e3:"unset"},children:[jsx("video",{src:e,autoPlay:true,playsInline:true,className:"pl-absolute pl-size-full",onEnded:()=>o&&o($),onTimeUpdate:or,onProgress:ar,id:"player-tag"}),jsxs("div",{className:`pl-relative pl-z-10 pl-flex pl-flex-col ${ga("isTouchScreenPortrait")&&"pl-flex-col-reverse"} pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${ir?"pl-opacity-100":"pl-opacity-0 pl-pointer-events-none"}`,children:[jsx(ur,{progress:We,buffered:Ye}),jsxs("div",{className:`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!ga("isTouchScreenPortrait")&&"pl-pb-3"}`,children:[jsx(c$2,{}),jsxs("div",{className:"pl-flex pl-items-center pl-gap-4",children:[jsxs("div",{className:"pl-text-white pl-text-[12px] pl-font-bold",children:[ie(rr)," / ",ie($)]}),jsx(b,{}),jsxs("div",{className:"pl-relative pl-flex pl-items-center",onMouseOver:()=>!ga("isTouchScreen")&&ee(true),onMouseLeave:()=>!ga("isTouchScreen")&&ee(false),children:[jsx(b$1,{width:20,height:20}),je&&jsx(a$4,{className:"pl-left-0",title:ga("isPlay")?"\u067E\u062E\u0634":"\u062A\u0648\u0642\u0641"})]})]})]})]}),s&&jsxs("button",{onClick:lr,className:`pl-absolute pl-bottom-[73px] ${ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4"} pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsx(Ve,{src:a$2.export,alt:"export button",width:16,height:16}),jsx("span",{className:`pl-font-medium ${ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:c})]}),D&&jsxs("button",{onClick:()=>i&&i($),disabled:!!N&&N>0,className:`pl-absolute pl-bottom-[73px] ${ga("isTouchScreenPortrait")&&"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 "} pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`,children:[jsx(Ve,{src:a$2.next,alt:"next button",width:16,height:16}),jsx("span",{className:`pl-font-medium ${ga("isTouchScreenPortrait")?"pl-text-[10px]":"pl-text-[12px]"}`,children:N&&N>0?`${N} \u062B\u0627\u0646\u06CC\u0647`:"\u0631\u062F \u06A9\u0631\u062F\u0646"})]})]})},$e=fr;var yr=X(()=>import('./staticPlayer-7YI5JM76.mjs')),Pr=X(()=>import('./vodPlayer-TQDB54I6.mjs')),hr=X(()=>import('./VideoHighLighter-HFNGQEYD.mjs')),vr=e=>{let o=ha(),{params:i}=ia(({videoData:{isReady:s,params:m,hiddenAd:I}})=>({isReady:s,params:m,hiddenAd:I}),shallowEqual);useEffect(()=>(i.id&&e.params.id!==i.id&&Z(),()=>{i.id&&Z();}),[e.params.id]),Ce(e.params),Le(),ia(({controller:{isFullScreen:s}})=>({isFullScreen:s}),shallowEqual);let n=async()=>{let s$1=await c$1(e.params.subtitles);o(s({...i,subtitles:s$1}));};if(useEffect(()=>{i.id&&String(e.params.type)==="static"&&e.params.subtitles&&e.params.subtitles.length&&setTimeout(()=>{n();},30);},[i.id]),e.params.vhl_status)return jsx(hr,{});if(ga("hasAdvertisement"))return jsx($e,{src:i.advertisement?.videoUrl,onSkipAd:s=>{o(D(true)),i.advertisement?.onSkipAd&&i.advertisement.onSkipAd(s);},onEndAd:s=>{o(D(true)),i.advertisement?.onEndAd&&i.advertisement.onEndAd(s);},skipDelay:i.advertisement?.skipDelay,adText:i.advertisement?.adText,onClickAd:i.advertisement?.onClickAd});let c=jsx(Fragment,{});return ga("isReady")&&(c=jsx("div",{className:`${!ga("isTouchScreen")&&"pl-rounded-[12px]"}`,style:{touchAction:"pan-y",userSelect:"none"},children:ga("isStaticFormat")?jsx(yr,{}):jsx(Pr,{})})),jsxs("div",{dir:"rtl",className:`pl-relative pl-rounded-[12px] pl-w-full pl-h-full pl-aspect-video ${ga("isFullScreen")&&"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]"}`,style:{zIndex:1e3},id:"parent-player",children:[ga("isFirstPlay")&&jsx("div",{className:`pl-absolute pl-bg-black pl-w-full pl-h-full pl-aspect-video ${!ga("isTouchScreen")&&!ga("isFullScreen")&&"pl-rounded-[12px]"}`,children:jsx(a,{})}),c]})},Fe=vr;e();var Y=class extends Tr.Component{state={hasError:false,error:null,errorInfo:null};static getDerivedStateFromError(o){return {hasError:true}}componentDidCatch(o,i){this.setState({error:o,errorInfo:i}),Ga({type:"OTHER_ERROR",message:o.message});}render(){return this.state.hasError?jsx(Fragment,{}):this.props.children}},z=Y;var Ir=({params:e})=>jsx(Provider,{store:Q,children:jsx(z,{children:jsx(Fe,{params:e})})});e();e();e();var Mr=()=>(ia(({miniPlayer:{play:e}})=>({play:e}),shallowEqual),jsx("div",{className:`${!ga("isTouchScreen")&&"hover:pl-scale-125"} pl-transition-transform pl-ease-in-out pl-cursor-pointer`,onContextMenu:e=>e.preventDefault(),children:jsx(Ve,{alt:"",src:ga("isPlayMiniPlayer")?a$2.bigPause:a$2.bigPlay,width:20,height:20,onClick:e=>c$3(e),onDoubleClick:e=>e.stopPropagation(),className:`${ga("isPlayMiniPlayer")?"pl-big-play-icon":"pl-big-pause-icon"}`})})),Ke=Mr;e();e();var Cr=()=>{let e=ha(),o=ia(n=>n.miniPlayer.details),i=ia(n=>n.miniPlayer.params);return useEffect(()=>{let n=new U(d$1());return U.isSupported()?(n.attachMedia(document.getElementById("mini-player-video-tag")),n.on(U.Events.MEDIA_ATTACHED,()=>C(n))):ja().canPlayType("application/vnd.apple.mpegurl")&&(ja().src=o.stream_link,b$2()),()=>{e(P()),n.detachMedia(),n.off(U.Events.MEDIA_ATTACHED,()=>C(n));}},[]),useEffect(()=>{i.currentTime&&(e(O(true)),ka().currentTime=i.currentTime,e(a$3(false)),ja()?.pause());},[i.currentTime]),jsx(Fragment,{children:jsx("video",{onPlay:()=>e(O(true)),onEnded:()=>e(O(false)),onError:a$5,poster:i.banner?i.banner:o.banner,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true,muted:true})})},Be=Cr;e();var kr=()=>{let e=ha(),o=ia(i=>i.miniPlayer.params);return useEffect(()=>{o.currentTime&&(e(O(true)),ka().currentTime=o.currentTime,e(a$3(false)),ja()?.pause());},[o.currentTime]),jsx("video",{poster:o.banner,onPlay:()=>e(O(true)),onEnded:()=>e(O(false)),onError:a$5,src:o.id,id:"mini-player-video-tag",className:"pl-absolute pl-bg-black pl-w-full pl-h-full",autoPlay:true})},Oe=kr;var Dr=()=>{let e=ia(o=>o.miniPlayer.params.type);return jsx(Fragment,{children:e==="static"?jsx(Oe,{}):jsx(Be,{})})},Ge=Dr;var Qe=({params:e})=>{let o=ha(),i=ia(m=>m.miniPlayer.details),n=ia(m=>m.miniPlayer.params);ia(m=>m.miniPlayer.play);let c$1=ia(m=>m.videoData.params);useEffect(()=>{o(M(e));},[]);let s=async()=>await a$1(e.id);return useEffect(()=>{e.id&&e.type==="vod"&&s();},[e.id]),jsx(Fragment,{children:i.stream_link||n.type==="static"&&n.id?jsxs("div",{id:"miniPlayer-video-area",style:{zIndex:1003},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 ${ga("isActiveElements")?"animate__fadeIn pl-pointer-events-auto":"animate__fadeOut pl-pointer-events-none"}`,onClick:()=>{c$1.id===n.id&&(ja().currentTime=ka().currentTime,o(c(ka().currentTime))),localStorage.setItem("close-miniPlayer","true"),e.onClose();},children:jsx(Ve,{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] ${ga("isActiveElements")&&!ga("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(Ke,{})})}),jsx(Ge,{})]}):jsx("div",{className:"pl-w-full pl-h-full pl-bg-white"})})};var Kr=({params:e})=>jsx(Provider,{store:Q,children:jsx(z,{children:jsx(Qe,{params:e})})});export{Kr as MiniPlayerLibrary,Ir 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/components/custom-components/advertisement/Advertisement.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","ProgressBar","progress","buffered","jsx","Advertisement","src","onEndAd","onSkipAd","skipDelay","adText","onClickAd","containerRef","setProgress","useState","setBuffered","showTooltip","setShowTooltip","hasSkip","skipCounter","setSkipCounter","isCounting","setIsCounting","currentTime","setCurrentTime","duration","setDuration","showControls","setShowControls","hideControlsTimeout","isPaused","setIsPaused","resetHideControlsTimer","delay","videoContainer","mouseMoveHandler","touchStartHandler","interval","prev","video","handlePlay","handlePause","handleWaiting","handleError","handleLoadedMetadata","playPromise","setPlay","handleTimeUpdate","handleProgress","handleClick","e","handleAdClick","formatTime","time","minutes","seconds","jsxs","handleLockOrientation","fullScreen_default","soundVolume_default","playPause_default","controllbarTooltip_default","Image","importImages_default","Advertisement_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","hiddenAd","shallowEqual","clearRedux","isFullScreen","handleValidateSubtitlesInStatic","validSubtitles","filterValidSubtitles","setHiddenAd","element","Fragment","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","MiniPlayerLibrary"],"mappings":"irBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CASA,IAAMC,GAAmBC,CAAAA,EAAe,CACtC,IAAMC,CAAAA,CAAWC,EAAAA,EAAe,CAE5BC,CAAAA,CAAuB,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,aAAA,CAAeA,CAAAA,CAAM,IAAK,EAC/CG,CAAAA,CAAY,IAAA,CAAOH,CAAAA,CAAM,IAAA,EAE7B,CAAA,CAEMQ,GAAAA,CAAkB,IAAM,CAC5BL,CAAAA,CAAc,CACZ,QAAA,CAAU,SAAA,CACV,GAAGH,CACL,EACF,CAAA,CAEMS,EAAqB,SAAY,CACrCN,CAAAA,CAAc,CACZ,IAAA,CAAMO,CAAAA,EAAQ,CACd,QAAA,CAAU,SAAA,CACV,GAAGV,CAAAA,CACH,SAAA,CAAW,MAAA,CACX,EAAA,CAAIA,CAAAA,CAAM,EAAA,CAAK,OAAO,IAAA,CAAKA,CAAAA,CAAM,EAAE,CAAA,CA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ACd,CAAA,CAEA/G,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,iCAAA,CAAkC,CAAA,CAGzD,CAER,CAAA,CDhEO,IAAMsH,EAAAA,CAAoB,CAAC,CAChC,OAAAnD,CACF,CAAA,GAIInE,GAAAA,CAACyF,QAAAA,CAAA,CAAS,KAAA,CAAOhG,CAAAA,CACf,QAAA,CAAAO,IAACuF,CAAAA,CAAA,CACC,QAAA,CAAAvF,GAAAA,CAACgH,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 { useAppDispatch, 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 Loader from \"../custom-components/loader/loader\";\r\nimport { filterValidSubtitles } from \"../../helpers/redux/actions/videoData.actions\";\r\nimport { setPlayerParams, setHiddenAd } from \"../../helpers/redux/slices/videoDataSlice\";\r\nimport Advertisement from \"../custom-components/advertisement/Advertisement\";\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 dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { isReady, params, hiddenAd } }) => ({ isReady, params, hiddenAd }), 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 const handleValidateSubtitlesInStatic = async () => {\r\n const validSubtitles = await filterValidSubtitles(props.params.subtitles!);\r\n dispatch(setPlayerParams({ ...params, subtitles: validSubtitles }));\r\n };\r\n\r\n useEffect(() => {\r\n if (params.id) {\r\n if (String(props.params.type) === PlayerTypes.static && props.params.subtitles && props.params.subtitles.length) {\r\n setTimeout(() => {\r\n handleValidateSubtitlesInStatic();\r\n }, 30);\r\n }\r\n }\r\n }, [params.id]);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n if (conditions(ConditionName.hasAdvertisement))\r\n return (\r\n <Advertisement\r\n src={params.advertisement?.videoUrl!}\r\n onSkipAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onSkipAd) params.advertisement.onSkipAd(currentTime);\r\n }}\r\n onEndAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onEndAd) params.advertisement.onEndAd(currentTime);\r\n }}\r\n skipDelay={params.advertisement?.skipDelay}\r\n adText={params.advertisement?.adText}\r\n onClickAd={params.advertisement?.onClickAd}\r\n />\r\n );\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`} style={{ touchAction: \"pan-y\", userSelect: \"none\" }}>\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) &&\r\n \"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]\"\r\n }`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen }}\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 = async () => {\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n subtitles: undefined,\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 { useRef, useState, useEffect } from \"react\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport SoundVolume from \"../soundVolume/soundVolume\";\r\nimport FullScreen from \"../fullScreen/fullScreen\";\r\nimport PlayPause from \"../playPause/playPause\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { useAppDispatch } from \"../../../helpers/redux/hooks\";\r\nimport { handleChangeSoundVolume, handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { setPlay } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\n\r\ninterface ProgressBarProps {\r\n progress: number;\r\n buffered: number;\r\n}\r\n\r\nconst ProgressBar: React.FC<ProgressBarProps> = ({ progress, buffered }) => (\r\n <div className={`pl-relative pl-w-full pl-h-0.5 ${conditions(ConditionName.isTouchScreenPortrait) && \"!pl-h-1\"} pl-bg-gray-highLight`}>\r\n {/* <div className=\"pl-absolute pl-top-0 pl-left-0 pl-h-0.5 pl-bg-gray-400\" style={{ width: `${buffered}%` }} /> */}\r\n <div\r\n className=\"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear\"\r\n style={{ width: `${progress}%` }}\r\n />\r\n </div>\r\n);\r\n\r\ninterface AdvertisementProps {\r\n src: string;\r\n onEndAd?: (currentTime: number) => void;\r\n onSkipAd?: (currentTime: number) => void;\r\n skipDelay?: number;\r\n adText?: string;\r\n onClickAd?: (currentTime: number) => void;\r\n}\r\n\r\nconst Advertisement: React.FC<AdvertisementProps> = ({ src, onEndAd, onSkipAd, skipDelay, adText = \"اطلاعات بیشتر\", onClickAd }) => {\r\n const dispatch = useAppDispatch();\r\n const containerRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [progress, setProgress] = useState(0);\r\n const [buffered, setBuffered] = useState(0);\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const hasSkip = skipDelay !== undefined && skipDelay > 0;\r\n const [skipCounter, setSkipCounter] = useState<number | null>(hasSkip ? skipDelay! : null);\r\n const [isCounting, setIsCounting] = useState(false);\r\n\r\n const [currentTime, setCurrentTime] = useState(0);\r\n const [duration, setDuration] = useState(0);\r\n\r\n const [showControls, setShowControls] = useState(true);\r\n const hideControlsTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const [isPaused, setIsPaused] = useState(false);\r\n\r\n const resetHideControlsTimer = (delay = 3000) => {\r\n if (isPaused) {\r\n setShowControls(true);\r\n return;\r\n }\r\n\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n hideControlsTimeout.current = setTimeout(() => {\r\n setShowControls(false);\r\n }, delay);\r\n };\r\n\r\n useEffect(() => {\r\n const videoContainer = containerRef.current;\r\n if (!videoContainer) return;\r\n\r\n const mouseMoveHandler = () => resetHideControlsTimer();\r\n const touchStartHandler = () => resetHideControlsTimer();\r\n\r\n videoContainer.addEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.addEventListener(\"touchstart\", touchStartHandler);\r\n\r\n resetHideControlsTimer();\r\n\r\n return () => {\r\n videoContainer.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.removeEventListener(\"touchstart\", touchStartHandler);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n }, [isPaused]);\r\n\r\n useEffect(() => {\r\n if (!hasSkip || !isCounting) return;\r\n\r\n const interval = setInterval(() => {\r\n setSkipCounter((prev) => {\r\n if (prev === null) return prev;\r\n if (prev <= 1) {\r\n clearInterval(interval);\r\n return 0;\r\n }\r\n return prev - 1;\r\n });\r\n }, 1000);\r\n\r\n return () => clearInterval(interval);\r\n }, [isCounting, hasSkip]);\r\n\r\n useEffect(() => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n const handlePlay = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n resetHideControlsTimer(1000);\r\n };\r\n\r\n const handlePause = () => {\r\n setIsCounting(false);\r\n setIsPaused(true);\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n\r\n const handleWaiting = () => setIsCounting(false);\r\n const handleError = () => setIsCounting(false);\r\n const handleLoadedMetadata = () => setDuration(video.duration);\r\n\r\n video.addEventListener(\"play\", handlePlay);\r\n video.addEventListener(\"pause\", handlePause);\r\n video.addEventListener(\"waiting\", handleWaiting);\r\n video.addEventListener(\"error\", handleError);\r\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n\r\n const playPromise = video.play();\r\n dispatch(setPlay(true));\r\n if (playPromise !== undefined) playPromise.then(() => handleChangeSoundVolume(100)).catch(() => handleChangeSoundVolume(0));\r\n\r\n return () => {\r\n video.removeEventListener(\"play\", handlePlay);\r\n video.removeEventListener(\"pause\", handlePause);\r\n video.removeEventListener(\"waiting\", handleWaiting);\r\n video.removeEventListener(\"error\", handleError);\r\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n };\r\n }, [src]);\r\n\r\n useEffect(() => {\r\n setIsCounting(true);\r\n }, []);\r\n\r\n const handleTimeUpdate = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration) {\r\n setProgress((video.currentTime / video.duration) * 100);\r\n setCurrentTime(video.currentTime);\r\n }\r\n };\r\n\r\n const handleProgress = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration && video.buffered.length > 0) {\r\n setBuffered((video.buffered.end(video.buffered.length - 1) / video.duration) * 100);\r\n }\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n if (conditions(ConditionName.isTouchScreen)) {\r\n resetHideControlsTimer();\r\n return;\r\n }\r\n\r\n if (e.target === containerRef.current || e.target === video) {\r\n if (video.paused) {\r\n video.play();\r\n dispatch(setPlay(true));\r\n } else {\r\n video.pause();\r\n dispatch(setPlay(false));\r\n }\r\n }\r\n };\r\n\r\n const handleAdClick = () => {\r\n if (onClickAd) {\r\n onClickAd(currentTime);\r\n }\r\n };\r\n\r\n const formatTime = (time: number) => {\r\n const minutes = Math.floor(time / 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n const seconds = Math.floor(time % 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n return `${minutes}:${seconds}`;\r\n };\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n ref={containerRef}\r\n onClick={handleClick}\r\n onDoubleClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n className={`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-fixed !pl-w-screen dvh !pl-rounded-none\"}`}\r\n style={{\r\n zIndex: conditions(ConditionName.isFullScreen) ? zIndex.videoPlayerInFullScreen : \"unset\",\r\n }}\r\n >\r\n <video\r\n src={src}\r\n autoPlay\r\n playsInline\r\n className=\"pl-absolute pl-size-full\"\r\n onEnded={() => onEndAd && onEndAd(currentTime)}\r\n onTimeUpdate={handleTimeUpdate}\r\n onProgress={handleProgress}\r\n id=\"player-tag\"\r\n />\r\n\r\n <div\r\n className={`pl-relative pl-z-10 pl-flex pl-flex-col ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"pl-flex-col-reverse\"\r\n } pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${showControls ? \"pl-opacity-100\" : \"pl-opacity-0 pl-pointer-events-none\"}`}\r\n >\r\n <ProgressBar progress={progress} buffered={buffered} />\r\n\r\n <div\r\n className={`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!conditions(ConditionName.isTouchScreenPortrait) && \"pl-pb-3\"}`}\r\n >\r\n <FullScreen />\r\n <div className=\"pl-flex pl-items-center pl-gap-4\">\r\n <div className=\"pl-text-white pl-text-[12px] pl-font-bold\">\r\n {formatTime(duration)} / {formatTime(currentTime)}\r\n </div>\r\n <SoundVolume />\r\n <div\r\n className=\"pl-relative pl-flex pl-items-center\"\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n >\r\n <PlayPause width={20} height={20} />\r\n {showTooltip && <ControllbarTooltip className=\"pl-left-0\" title={conditions(ConditionName.isPlay) ? \"پخش\" : \"توقف\"} />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {onClickAd && (\r\n <button\r\n onClick={handleAdClick}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4\"\r\n } pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.export} alt=\"export button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>{adText}</span>\r\n </button>\r\n )}\r\n\r\n {hasSkip && (\r\n <button\r\n onClick={() => onSkipAd && onSkipAd(currentTime)}\r\n disabled={!!skipCounter && skipCounter > 0}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 \"\r\n } pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.next} alt=\"next button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>\r\n {skipCounter && skipCounter > 0 ? `${skipCounter} ثانیه` : \"رد کردن\"}\r\n </span>\r\n </button>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Advertisement;\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/components/custom-components/advertisement/Advertisement.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","ProgressBar","progress","buffered","jsx","Advertisement","src","onEndAd","onSkipAd","skipDelay","adText","onClickAd","containerRef","setProgress","useState","setBuffered","showTooltip","setShowTooltip","hasSkip","skipCounter","setSkipCounter","isCounting","setIsCounting","currentTime","setCurrentTime","duration","setDuration","showControls","setShowControls","hideControlsTimeout","isPaused","setIsPaused","resetHideControlsTimer","delay","videoContainer","mouseMoveHandler","touchStartHandler","interval","prev","video","handlePlay","handlePlaying","handlePause","handleWaiting","handleError","handleLoadedMetadata","playPromise","setPlay","handleTimeUpdate","handleProgress","handleClick","e","handleAdClick","formatTime","time","minutes","seconds","jsxs","handleLockOrientation","fullScreen_default","soundVolume_default","playPause_default","controllbarTooltip_default","Image","importImages_default","Advertisement_default","StaticPlayer","dynamic","VodPlayer","VideoHighLighter","VideoPlayer","props","params","useAppSelector","isReady","hiddenAd","shallowEqual","clearRedux","isFullScreen","handleValidateSubtitlesInStatic","validSubtitles","filterValidSubtitles","setHiddenAd","element","Fragment","loader_default","videoPlayer_default","ErrorBoundary","React","error","errorInfo","errorLogProvider","errorBoundary_default","VideoPlayerLibrary","Provider","MiniPlayerPlayPause","play","handlePlayerPauseMiniPlayer","miniPlayerPlayPause_default","MiniPlayerNonStaticVideoTag","details","state","hls","Hls","handleMiniPlayerHlsConfig","handleMiniPlayerMediaAttached","appendQueryParamsToChunksIOS","setClearMiniPlayerSlice","setPlayMiniPlayer","miniPlayerVideoTag","handleVideoError","miniPlayerNonStaticVideoTag_default","MiniPlayerStaticVideoTag","miniPlayerStaticVideoTag_default","VideoTag","type","videoTag_default","MiniPlayer","miniPlayerParams","mainPlayerParams","setMiniPlayerInfo","handleGetDetail","getVodDetails","MiniPlayerLibrary"],"mappings":"irBAAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CCAAA,CAAAA,EAAAA,CASA,IAAMC,GAAmBC,CAAAA,EAAe,CACtC,IAAMC,CAAAA,CAAWC,EAAAA,EAAe,CAE5BC,CAAAA,CAAuB,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,aAAA,CAAeA,CAAAA,CAAM,IAAK,EAC/CG,CAAAA,CAAY,IAAA,CAAOH,CAAAA,CAAM,IAAA,EAE7B,CAAA,CAEMQ,GAAAA,CAAkB,IAAM,CAC5BL,CAAAA,CAAc,CACZ,QAAA,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AAA,CAAAA,kBAAyC,CAAA,EAAK,CAACA,EAAAA,CAAAA,WAAkC,CAAA,CACjL,yCACA,yCACF,CAAA,CAAA,CACI,QAAA,CAAAa,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qCAAA,CACX,QAAA,CAAAA,GAAAA,CAAC8F,EAAAA,CAAA,EAAoB,CAAA,CACzB,CAAA,CACR,CAAA,CACA9F,GAAAA,CAACgH,EAAAA,CAAA,EAAS,CAAA,CAAA,CACd,CAAA,CAEAhH,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,iCAAA,CAAkC,CAAA,CAGzD,CAER,CAAA,CDhEO,IAAMuH,EAAAA,CAAoB,CAAC,CAChC,OAAAnD,CACF,CAAA,GAIIpE,GAAAA,CAAC0F,QAAAA,CAAA,CAAS,KAAA,CAAOjG,CAAAA,CACf,QAAA,CAAAO,IAACwF,CAAAA,CAAA,CACC,QAAA,CAAAxF,GAAAA,CAACiH,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 { useAppDispatch, 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 Loader from \"../custom-components/loader/loader\";\r\nimport { filterValidSubtitles } from \"../../helpers/redux/actions/videoData.actions\";\r\nimport { setPlayerParams, setHiddenAd } from \"../../helpers/redux/slices/videoDataSlice\";\r\nimport Advertisement from \"../custom-components/advertisement/Advertisement\";\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 dispatch = useAppDispatch();\r\n const { params } = useAppSelector(({ videoData: { isReady, params, hiddenAd } }) => ({ isReady, params, hiddenAd }), 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 const handleValidateSubtitlesInStatic = async () => {\r\n const validSubtitles = await filterValidSubtitles(props.params.subtitles!);\r\n dispatch(setPlayerParams({ ...params, subtitles: validSubtitles }));\r\n };\r\n\r\n useEffect(() => {\r\n if (params.id) {\r\n if (String(props.params.type) === PlayerTypes.static && props.params.subtitles && props.params.subtitles.length) {\r\n setTimeout(() => {\r\n handleValidateSubtitlesInStatic();\r\n }, 30);\r\n }\r\n }\r\n }, [params.id]);\r\n\r\n if (props.params.vhl_status) return <VideoHighLighter />;\r\n if (conditions(ConditionName.hasAdvertisement))\r\n return (\r\n <Advertisement\r\n src={params.advertisement?.videoUrl!}\r\n onSkipAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onSkipAd) params.advertisement.onSkipAd(currentTime);\r\n }}\r\n onEndAd={(currentTime) => {\r\n dispatch(setHiddenAd(true));\r\n if (params.advertisement?.onEndAd) params.advertisement.onEndAd(currentTime);\r\n }}\r\n skipDelay={params.advertisement?.skipDelay}\r\n adText={params.advertisement?.adText}\r\n onClickAd={params.advertisement?.onClickAd}\r\n />\r\n );\r\n\r\n let element = <></>;\r\n if (conditions(ConditionName.isReady)) {\r\n element = (\r\n <div className={`${!conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"}`} style={{ touchAction: \"pan-y\", userSelect: \"none\" }}>\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) &&\r\n \"!pl-overflow-hidden !pl-fixed !pl-top-0 !pl-right-0 !pl-w-screen !pl-h-screen !pl-rounded-none !pl-z-[1000000]\"\r\n }`}\r\n style={{ zIndex: zIndex.videoPlayerInFullScreen }}\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 = async () => {\r\n queryParams = {\r\n uuid: getUUID(),\r\n provider: \"cafevdo\",\r\n ...query,\r\n subtitles: undefined,\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 { useRef, useState, useEffect } from \"react\";\r\nimport { conditions } from \"../../../helpers/conditions/conditions\";\r\nimport { ConditionName, zIndex } from \"../../../helpers/interfaces/enums\";\r\nimport SoundVolume from \"../soundVolume/soundVolume\";\r\nimport FullScreen from \"../fullScreen/fullScreen\";\r\nimport PlayPause from \"../playPause/playPause\";\r\nimport { mainPlayerVideoTag } from \"../../../helpers/constants\";\r\nimport { useAppDispatch } from \"../../../helpers/redux/hooks\";\r\nimport { handleChangeSoundVolume, handleFullScreen, handleLockOrientation } from \"../../../helpers/redux/actions/controller.actions\";\r\nimport { setPlay } from \"../../../helpers/redux/slices/controllerSlice\";\r\nimport Image from \"next/legacy/image\";\r\nimport IMAGES from \"../../../images/importImages\";\r\nimport ControllbarTooltip from \"../footer/controllbar/controllbarTooltip\";\r\n\r\ninterface ProgressBarProps {\r\n progress: number;\r\n buffered: number;\r\n}\r\n\r\nconst ProgressBar: React.FC<ProgressBarProps> = ({ progress, buffered }) => (\r\n <div className={`pl-relative pl-w-full pl-h-0.5 ${conditions(ConditionName.isTouchScreenPortrait) && \"!pl-h-1\"} pl-bg-gray-highLight`}>\r\n {/* <div className=\"pl-absolute pl-top-0 pl-left-0 pl-h-0.5 pl-bg-gray-400\" style={{ width: `${buffered}%` }} /> */}\r\n <div\r\n className=\"pl-absolute pl-top-0 pl-left-0 pl-h-full pl-bg-primary pl-transition-all pl-duration-150 pl-ease-linear\"\r\n style={{ width: `${progress}%` }}\r\n />\r\n </div>\r\n);\r\n\r\ninterface AdvertisementProps {\r\n src: string;\r\n onEndAd?: (currentTime: number) => void;\r\n onSkipAd?: (currentTime: number) => void;\r\n skipDelay?: number;\r\n adText?: string;\r\n onClickAd?: (currentTime: number) => void;\r\n}\r\n\r\nconst Advertisement: React.FC<AdvertisementProps> = ({ src, onEndAd, onSkipAd, skipDelay, adText = \"اطلاعات بیشتر\", onClickAd }) => {\r\n const dispatch = useAppDispatch();\r\n const containerRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [progress, setProgress] = useState(0);\r\n const [buffered, setBuffered] = useState(0);\r\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\r\n\r\n const hasSkip = skipDelay !== undefined && skipDelay > 0;\r\n const [skipCounter, setSkipCounter] = useState<number | null>(hasSkip ? skipDelay! : null);\r\n const [isCounting, setIsCounting] = useState(false);\r\n\r\n const [currentTime, setCurrentTime] = useState(0);\r\n const [duration, setDuration] = useState(0);\r\n\r\n const [showControls, setShowControls] = useState(true);\r\n const hideControlsTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const [isPaused, setIsPaused] = useState(false);\r\n\r\n const resetHideControlsTimer = (delay = 3000) => {\r\n if (isPaused) {\r\n setShowControls(true);\r\n return;\r\n }\r\n\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n hideControlsTimeout.current = setTimeout(() => {\r\n setShowControls(false);\r\n }, delay);\r\n };\r\n\r\n useEffect(() => {\r\n const videoContainer = containerRef.current;\r\n if (!videoContainer) return;\r\n\r\n const mouseMoveHandler = () => resetHideControlsTimer();\r\n const touchStartHandler = () => resetHideControlsTimer();\r\n\r\n videoContainer.addEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.addEventListener(\"touchstart\", touchStartHandler);\r\n\r\n resetHideControlsTimer();\r\n\r\n return () => {\r\n videoContainer.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n videoContainer.removeEventListener(\"touchstart\", touchStartHandler);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n }, [isPaused]);\r\n\r\n useEffect(() => {\r\n if (!hasSkip || !isCounting) return;\r\n\r\n const interval = setInterval(() => {\r\n setSkipCounter((prev) => {\r\n if (prev === null) return prev;\r\n if (prev <= 1) {\r\n clearInterval(interval);\r\n return 0;\r\n }\r\n return prev - 1;\r\n });\r\n }, 1000);\r\n\r\n return () => clearInterval(interval);\r\n }, [isCounting, hasSkip]);\r\n\r\n useEffect(() => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n const handlePlay = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n resetHideControlsTimer(1000);\r\n };\r\n\r\n const handlePlaying = () => {\r\n setIsCounting(true);\r\n setIsPaused(false);\r\n };\r\n\r\n const handlePause = () => {\r\n setIsCounting(false);\r\n setIsPaused(true);\r\n setShowControls(true);\r\n if (hideControlsTimeout.current) clearTimeout(hideControlsTimeout.current);\r\n };\r\n\r\n const handleWaiting = () => setIsCounting(false);\r\n const handleError = () => setIsCounting(false);\r\n const handleLoadedMetadata = () => setDuration(video.duration);\r\n\r\n video.addEventListener(\"play\", handlePlay);\r\n video.addEventListener(\"playing\", handlePlaying);\r\n video.addEventListener(\"pause\", handlePause);\r\n video.addEventListener(\"waiting\", handleWaiting);\r\n video.addEventListener(\"error\", handleError);\r\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n\r\n const playPromise = video.play();\r\n dispatch(setPlay(true));\r\n if (playPromise !== undefined) playPromise.then(() => handleChangeSoundVolume(100)).catch(() => handleChangeSoundVolume(0));\r\n\r\n return () => {\r\n video.removeEventListener(\"play\", handlePlay);\r\n video.removeEventListener(\"playing\", handlePlaying);\r\n video.removeEventListener(\"pause\", handlePause);\r\n video.removeEventListener(\"waiting\", handleWaiting);\r\n video.removeEventListener(\"error\", handleError);\r\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\r\n };\r\n }, [src]);\r\n\r\n const handleTimeUpdate = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration) {\r\n setProgress((video.currentTime / video.duration) * 100);\r\n setCurrentTime(video.currentTime);\r\n }\r\n };\r\n\r\n const handleProgress = () => {\r\n const video = mainPlayerVideoTag();\r\n if (video?.duration && video.buffered.length > 0) {\r\n setBuffered((video.buffered.end(video.buffered.length - 1) / video.duration) * 100);\r\n }\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n const video = mainPlayerVideoTag();\r\n if (!video) return;\r\n\r\n if (conditions(ConditionName.isTouchScreen)) {\r\n resetHideControlsTimer();\r\n return;\r\n }\r\n\r\n if (e.target === containerRef.current || e.target === video) {\r\n if (video.paused) {\r\n video.play();\r\n dispatch(setPlay(true));\r\n } else {\r\n video.pause();\r\n dispatch(setPlay(false));\r\n }\r\n }\r\n };\r\n\r\n const handleAdClick = () => {\r\n if (onClickAd) {\r\n onClickAd(currentTime);\r\n }\r\n };\r\n\r\n const formatTime = (time: number) => {\r\n const minutes = Math.floor(time / 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n const seconds = Math.floor(time % 60)\r\n .toString()\r\n .padStart(2, \"0\");\r\n return `${minutes}:${seconds}`;\r\n };\r\n\r\n return (\r\n <div\r\n id=\"video-area\"\r\n ref={containerRef}\r\n onClick={handleClick}\r\n onDoubleClick={() => {\r\n handleFullScreen();\r\n handleLockOrientation();\r\n }}\r\n className={`pl-relative pl-h-full pl-bg-black pl-max-h-screen pl-aspect-video pl-flex pl-flex-col pl-justify-end ${\r\n !conditions(ConditionName.isTouchScreen) && \"pl-rounded-[12px]\"\r\n } ${conditions(ConditionName.isFullScreen) && \"!pl-fixed !pl-w-screen dvh !pl-rounded-none\"}`}\r\n style={{\r\n zIndex: conditions(ConditionName.isFullScreen) ? zIndex.videoPlayerInFullScreen : \"unset\",\r\n }}\r\n >\r\n <video\r\n src={src}\r\n autoPlay\r\n playsInline\r\n className=\"pl-absolute pl-size-full\"\r\n onEnded={() => onEndAd && onEndAd(currentTime)}\r\n onTimeUpdate={handleTimeUpdate}\r\n onProgress={handleProgress}\r\n id=\"player-tag\"\r\n />\r\n\r\n <div\r\n className={`pl-relative pl-z-10 pl-flex pl-flex-col ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"pl-flex-col-reverse\"\r\n } pl-gap-4 pl-transition-opacity pl-duration-500 pl-ease-in-out ${showControls ? \"pl-opacity-100\" : \"pl-opacity-0 pl-pointer-events-none\"}`}\r\n >\r\n <ProgressBar progress={progress} buffered={buffered} />\r\n\r\n <div\r\n className={`pl-flex pl-justify-between pl-items-center pl-gap-3 pl-px-4 ${!conditions(ConditionName.isTouchScreenPortrait) && \"pl-pb-3\"}`}\r\n >\r\n <FullScreen />\r\n <div className=\"pl-flex pl-items-center pl-gap-4\">\r\n <div className=\"pl-text-white pl-text-[12px] pl-font-bold\">\r\n {formatTime(duration)} / {formatTime(currentTime)}\r\n </div>\r\n <SoundVolume />\r\n <div\r\n className=\"pl-relative pl-flex pl-items-center\"\r\n onMouseOver={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(true)}\r\n onMouseLeave={() => !conditions(ConditionName.isTouchScreen) && setShowTooltip(false)}\r\n >\r\n <PlayPause width={20} height={20} />\r\n {showTooltip && <ControllbarTooltip className=\"pl-left-0\" title={conditions(ConditionName.isPlay) ? \"پخش\" : \"توقف\"} />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {onClickAd && (\r\n <button\r\n onClick={handleAdClick}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-left-4\"\r\n } pl-left-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-2 pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.export} alt=\"export button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>{adText}</span>\r\n </button>\r\n )}\r\n\r\n {hasSkip && (\r\n <button\r\n onClick={() => onSkipAd && onSkipAd(currentTime)}\r\n disabled={!!skipCounter && skipCounter > 0}\r\n className={`pl-absolute pl-bottom-[73px] ${\r\n conditions(ConditionName.isTouchScreenPortrait) && \"!pl-bottom-[60px] !pl-border-gray-controls-secondary !pl-right-4 \"\r\n } pl-right-[18px] pl-px-3 pl-py-[6px] pl-flex pl-items-center pl-gap-[5px] pl-rounded-[4px] pl-transition-colors pl-border pl-border-white pl-text-white pl-bg-black/[0.8]`}\r\n >\r\n <Image src={IMAGES.next} alt=\"next button\" width={16} height={16} />\r\n <span className={`pl-font-medium ${conditions(ConditionName.isTouchScreenPortrait) ? \"pl-text-[10px]\" : \"pl-text-[12px]\"}`}>\r\n {skipCounter && skipCounter > 0 ? `${skipCounter} ثانیه` : \"رد کردن\"}\r\n </span>\r\n </button>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Advertisement;\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;"]}
|