@soul-refiner/design-system 2.14.97 → 2.14.98
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/dist/components/media/video/video.js +1 -1
- package/dist/components/media/video-player/video.js +1 -1
- package/dist/src/components/media/video/video.d.ts +13 -1
- package/dist/src/components/media/video/video.d.ts.map +1 -1
- package/dist/src/components/media/video-player/video.d.ts +8 -1
- package/dist/src/components/media/video-player/video.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-player"),i=require("next/image"),a=require("../../atoms/typography/paragraph.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(t),s=l(r),n=l(i);exports.Video=({controls:t=!0,loop:r=!1,muted:i,playsInline:l,src:u,subtitles:c,style:d,thumbnail:p,thumbnailObjectFit:y="contain",forwardedRef:h,playing:f=!0,title:g,handleOnReady:m})=>{const
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-player"),i=require("next/image"),a=require("../../atoms/typography/paragraph.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(t),s=l(r),n=l(i);exports.Video=({controls:t=!0,loop:r=!1,muted:i,playsInline:l,src:u,subtitles:c,style:d,thumbnail:p,thumbnailObjectFit:y="contain",forwardedRef:h,playing:f=!0,title:g,handleOnReady:m,autoPlay:b=!1,crossOrigin:x="true"})=>{const j=o.default.useRef(null),v=h||j,q=(Array.isArray(u)?u[0]:u).includes(".m3u8");return e.jsx(s.default,{className:"player",config:{file:{attributes:{..."true"===x?{crossOrigin:"true"}:{}},forceHLS:q,hlsOptions:q?{autoStartLoad:!0}:void 0,tracks:c?.map(e=>({kind:"subtitles",label:e.label,src:e.src,srcLang:e.locale}))}},controls:t,height:"100%",light:!b&&(p?e.jsxs(e.Fragment,{children:[e.jsx(n.default,{alt:"thumbnail for trailer",layout:"fill",priority:!0,quality:100,src:p,style:{objectFit:y}}),g&&e.jsx(a.P,{$color:"white",sx:"position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; z-index: 100;",children:g})]}):void 0),loop:r,muted:!!b||i,pip:!1,playsinline:l,playing:!!b||f,ref:v,style:{backgroundColor:"var(--color-grey-0)",maxHeight:720,maxWidth:1280,minHeight:480,overflow:"hidden",position:"relative",...d||{}},url:u,width:"100%",onReady:m})};
|
|
@@ -135,4 +135,4 @@
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
${({$showingAll:e})=>e?"height: 100%; overflow-y:auto;":"max-height: 350px;"}
|
|
138
|
-
`;exports.VideoPlayer=({activeIndex:t,pip:n,playable:r,playlist:b,onClickPreview:L,onPipChange:M,onProgress:T,onStart:E,orientation:H,setMediaItem:R,onShowAllPlaylist:O,forwardedRef:F,subtitle:N,title:_,trailer:W,additionalMedia:V,autoPlay:X=!1})=>{const Y="undefined"!=typeof window?window:{innerHeight:0,innerWidth:600},K=Y.innerHeight/3,G=j*(Y.innerHeight/3),J=y.default.useRef(null),Q=F||J,U=y.default.useRef({}),Z=y.default.useRef(null),ee=y.default.useRef(null),[ie,te]=y.default.useState(0),[ne,re]=y.default.useState(!1),[oe,le]=y.default.useState(!r),[se,ae]=y.default.useState(b?.[t].id||null),[de,ce]=g.useLocalStorage("videoPipHeight",K),[pe,ue]=g.useLocalStorage("videoPipWidth",G),[ge,he]=g.useLocalStorage("video-volume",1),[xe,me]=g.useLocalStorage("videoPipRight",16),[fe,be]=g.useLocalStorage("videoPipBottom",16),[ye,we]=y.default.useState([0,0]),[ve,je]=y.default.useState([0,0]),[$e,Ie]=y.default.useState(!1),[ke,Se]=y.default.useState(0),[De,Pe]=y.default.useState([]),[Ae,ze]=y.default.useState([]),[qe,Ce]=y.default.useState([]),Be=oe?W:$e?De?.[ke]:b?.[t],Le=Array.isArray(Be?.src)?Be.src[0]:Be?.src,Me=Le?.includes(".m3u8")||!1;y.default.useEffect(()=>{V&&(Pe(V.filter(e=>"VIDEO"===e.type)),ze(V.filter(e=>"FILE"===e.type)),Ce(V.filter(e=>"LINK"===e.type)))},[V]),y.default.useEffect(()=>{const e=()=>{const e=U.current[se];e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"center"})},0)};return b?.length&&se&&("undefined"!=typeof window&&window.addEventListener("load",e),e()),()=>{"undefined"!=typeof window&&window.removeEventListener("load",e)}},[b,se]);const Te=(e,i=!1)=>{le(!1),Ie(i),i?Se(e):R(e)},Ee=()=>{re(e=>!e),O&&O(!ne)},He=(e,i)=>{if(!ee?.current)return;const t=ee.current.getBoundingClientRect();t.x<16||t.y<16||e>=2*Y.innerWidth/3||i>=2*Y.innerHeight/3||e<$||i<200||(ue(e),ce(i))},Re=()=>{if(!ee?.current)return;const e=ee.current.getBoundingClientRect();je([e.width,e.height])},Oe=e=>{if(!ee?.current)return;const i=e.currentTarget.getAttribute("class")?.split(" ")||[],t=window.innerWidth-e.clientX,n=window.innerHeight-e.clientY;if(!(e.clientX<0||e.clientY<0))if(e.stopPropagation(),e.preventDefault(),i.includes("top")){const e=Math.round(n-ye[1]+ve[1]),i=Math.round(e*j);He(i,e)}else if(i.includes("bottom")){const e=Math.round(ye[1]-n+ve[1]),i=Math.round(e*j);He(i,e)}else if(i.includes("left")){const e=Math.round(t-ye[0]+ve[0]),i=Math.round(e/j);He(e,i)}else if(i.includes("right")){const e=Math.round(ye[0]-t+ve[0]),i=Math.round(e/j);He(e,i)}},Fe=i.useMemo(()=>{let e=[{label:"All lessons",color:"dark"}];return V?.length&&e.push({label:"Resources",color:"dark"}),e.push({label:"Trailer",color:"dark"}),e},[V]),Ne=ie===Fe.length-1,_e=V&&ie>0&&ie<Fe.length-1;return y.default.useEffect(()=>{ie>=Fe.length&&te(0)},[Fe,ie]),Be?e.jsx(I,{$orientation:H,children:e.jsxs(P,{$orientation:H,$playable:r||oe||$e,children:["vertical"===H&&e.jsxs(l.Box,{className:"pip-trigger-vertical pip-trigger",$dir:"column",$gap:4,sx:"margin: 24px;",children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),n&&e.jsx(S,{}),e.jsxs(k,{$pip:!!n,draggable:n&&0===ve[0],onDrag:n?e=>{if(e.clientX<0||e.clientY<0)return;const i=window.innerWidth-e.clientX,t=window.innerHeight-e.clientY;((e,i)=>{if(!ee?.current)return;const t=ee.current.getBoundingClientRect();e&&e>=16&&e<=Y.innerWidth-16-t.width&&me(e),i&&i>=16&&i<=Y.innerHeight-16-t.height&&be(i)})(xe+(i-ye[0]),fe+(t-ye[1])),we([i,t])}:void 0,onMouseDown:e=>{we([window.innerWidth-e.clientX,window.innerHeight-e.clientY])},ref:ee,style:n?{bottom:fe,height:de,right:xe,width:pe}:void 0,children:[n&&e.jsx(o.Button,{className:"close-pip",icon:e.jsx(a.SelectItem,{color:"grey-0"}),onClick:e=>{e.stopPropagation(),M&&M(!1)},size:"large",sx:"\n display: none;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 10;\n svg {\n fill: var(--color-white);\n }\n ",type:"text"}),e.jsx(v.default,{className:"player",config:{file:{attributes:{crossOrigin:"true",disablePictureInPicture:"true"},forceHLS:Me,hlsOptions:Me?{autoStartLoad:!0}:void 0,tracks:(Be?.subtitles||[]).map(e=>({kind:"subtitles",label:e.label,src:e.src,srcLang:e.locale}))}},controls:!0,height:"100%",light:!X&&(Be.thumbnail&&e.jsx(w.default,{alt:`thumbnail for ${_}`,layout:"fill",priority:!0,quality:100,style:{objectFit:"cover"},src:Be.thumbnail})),progressInterval:4e3,onProgress:e=>T(e,$e?De[ke]?.id:void 0),onStart:E,onClickPreview:L,onReady:()=>{if(!oe){const e=Q?.current?.getCurrentTime();0===e&&($e?0!==De?.[ke]?.progress&&Q.current.seekTo(De?.[ke].progress):0!==Be?.progress&&Q.current.seekTo(Be.progress))}},pip:n,playIcon:r||oe||$e?e.jsx(u.PlaySolid,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}):e.jsx(p.LockCircle,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}),playing:X&&(r||oe||$e),muted:X,ref:Q,url:Be.src,width:"100%",volume:ge,onVolumeChange:e=>{he(e.target.volume)}}),n&&e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"top horizontal",draggable:"false",onDrag:Oe,onMouseDown:Re,onDragEnd:()=>je([0,0]),tabIndex:0}),e.jsx(D,{className:"bottom horizontal",draggable:"false",onDrag:Oe,onMouseDown:Re,onDragEnd:()=>je([0,0]),tabIndex:0}),e.jsx(D,{className:"right vertical",draggable:"false",onDrag:Oe,onMouseDown:Re,onDragEnd:()=>je([0,0]),tabIndex:0}),e.jsx(D,{className:"left vertical",draggable:"false",onDrag:Oe,onMouseDown:Re,onDragEnd:()=>je([0,0]),tabIndex:0})]})]}),"horizontal"===H&&e.jsx(A,{children:e.jsxs(z,{$showingAll:ne,children:[e.jsxs(l.Box,{$dir:"column",$gap:4,children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),e.jsxs(l.Box,{$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ie,onChange:e=>te(e),items:Fe,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:ne,orientation:H,toggleShowingAll:Ee})]}),0===ie?e.jsx(C,{ref:Z,$showingAll:ne,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{ae(i.id),Te(t)},title:i.title,thumbnail:i.thumbnail,shortDescription:i.shortDescription,duration:i.duration,progress:i.progress,playable:r,nowplaying:se,comingSoon:i.comingSoon||!1,ref:e=>{U.current[i.id]=e}},i.id))}):_e?e.jsxs(C,{$showingAll:ne,children:[!!De.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:De.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{ae(i.id),Te(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:se,ref:e=>{U.current[i.id]=e}},i.id))})},i))}),!!Ae.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...Ae].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:se,type:i.type,isFile:"FILE"===i.type,ref:e=>{U.current[i.id]=e}},i.id))})},i))}),!!qe.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Products"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...qe].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:se,type:i.type,isFile:"FILE"===i.type,ref:e=>{U.current[i.id]=e}},i.id))})},i))})]}):Ne&&W?e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:le,trailer:W}):null]})}),"vertical"===H&&e.jsx(l.Box,{$dir:"column",$gap:24,sx:ne?"z-index: 3; position:relative;":"height: auto",children:e.jsxs(q,{$showingAll:ne,children:[e.jsxs(l.Box,{sx:"padding: 0 1.5rem;",$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ie,onChange:e=>te(e),items:Fe,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:ne,orientation:H,toggleShowingAll:Ee})]}),[e.jsx(B,{ref:Z,$showingAll:ne,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{comingSoon:i.comingSoon||!1,nowplaying:se,playlistItemId:i.id,duration:i.duration,ref:e=>{U.current[i.id]=e},onClick:()=>{Te(t),ae(i.id)},playable:r,progress:i.progress,shortDescription:i.shortDescription,thumbnail:i.thumbnail,title:i.title},i.id))}),e.jsxs(B,{$showingAll:ne,children:[!!De.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})]}),sx:"flex-direction: column; gap: 24px;",children:De.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{ae(i.id),Te(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:se,ref:e=>{U.current[i.id]=e}},i.id))},i))}),(!!Ae.length||!!qe.length)&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})]}),sx:"flex-direction: column; gap: 24px;",children:[...Ae,...qe].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:se,type:i.type,isFile:"FILE"===i.type,ref:e=>{U.current[i.id]=e}},i.id))},i))})]}),!!W&&e.jsx(l.Box,{$dir:"column",$gap:8,sx:"margin: 0px 24px;",children:e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:le,trailer:W})})][ie]]})})]})}):null};
|
|
138
|
+
`;exports.VideoPlayer=({activeIndex:t,pip:n,playable:r,playlist:b,onClickPreview:L,onPipChange:M,onProgress:T,onStart:E,orientation:H,setMediaItem:R,onShowAllPlaylist:O,forwardedRef:F,subtitle:N,title:_,trailer:W,additionalMedia:V,autoPlay:X=!1,crossOrigin:Y="true"})=>{const K="undefined"!=typeof window?window:{innerHeight:0,innerWidth:600},G=K.innerHeight/3,J=j*(K.innerHeight/3),Q=y.default.useRef(null),U=F||Q,Z=y.default.useRef({}),ee=y.default.useRef(null),ie=y.default.useRef(null),[te,ne]=y.default.useState(0),[re,oe]=y.default.useState(!1),[le,se]=y.default.useState(!r),[ae,de]=y.default.useState(b?.[t].id||null),[ce,pe]=g.useLocalStorage("videoPipHeight",G),[ue,ge]=g.useLocalStorage("videoPipWidth",J),[he,xe]=g.useLocalStorage("video-volume",1),[me,fe]=g.useLocalStorage("videoPipRight",16),[be,ye]=g.useLocalStorage("videoPipBottom",16),[we,ve]=y.default.useState([0,0]),[je,$e]=y.default.useState([0,0]),[Ie,ke]=y.default.useState(!1),[Se,De]=y.default.useState(0),[Pe,Ae]=y.default.useState([]),[ze,qe]=y.default.useState([]),[Ce,Be]=y.default.useState([]),Le=le?W:Ie?Pe?.[Se]:b?.[t],Me=Array.isArray(Le?.src)?Le.src[0]:Le?.src,Te=Me?.includes(".m3u8")||!1;y.default.useEffect(()=>{V&&(Ae(V.filter(e=>"VIDEO"===e.type)),qe(V.filter(e=>"FILE"===e.type)),Be(V.filter(e=>"LINK"===e.type)))},[V]),y.default.useEffect(()=>{const e=()=>{const e=Z.current[ae];e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"center"})},0)};return b?.length&&ae&&("undefined"!=typeof window&&window.addEventListener("load",e),e()),()=>{"undefined"!=typeof window&&window.removeEventListener("load",e)}},[b,ae]);const Ee=(e,i=!1)=>{se(!1),ke(i),i?De(e):R(e)},He=()=>{oe(e=>!e),O&&O(!re)},Re=(e,i)=>{if(!ie?.current)return;const t=ie.current.getBoundingClientRect();t.x<16||t.y<16||e>=2*K.innerWidth/3||i>=2*K.innerHeight/3||e<$||i<200||(ge(e),pe(i))},Oe=()=>{if(!ie?.current)return;const e=ie.current.getBoundingClientRect();$e([e.width,e.height])},Fe=e=>{if(!ie?.current)return;const i=e.currentTarget.getAttribute("class")?.split(" ")||[],t=window.innerWidth-e.clientX,n=window.innerHeight-e.clientY;if(!(e.clientX<0||e.clientY<0))if(e.stopPropagation(),e.preventDefault(),i.includes("top")){const e=Math.round(n-we[1]+je[1]),i=Math.round(e*j);Re(i,e)}else if(i.includes("bottom")){const e=Math.round(we[1]-n+je[1]),i=Math.round(e*j);Re(i,e)}else if(i.includes("left")){const e=Math.round(t-we[0]+je[0]),i=Math.round(e/j);Re(e,i)}else if(i.includes("right")){const e=Math.round(we[0]-t+je[0]),i=Math.round(e/j);Re(e,i)}},Ne=i.useMemo(()=>{let e=[{label:"All lessons",color:"dark"}];return V?.length&&e.push({label:"Resources",color:"dark"}),e.push({label:"Trailer",color:"dark"}),e},[V]),_e=te===Ne.length-1,We=V&&te>0&&te<Ne.length-1;return y.default.useEffect(()=>{te>=Ne.length&&ne(0)},[Ne,te]),Le?e.jsx(I,{$orientation:H,children:e.jsxs(P,{$orientation:H,$playable:r||le||Ie,children:["vertical"===H&&e.jsxs(l.Box,{className:"pip-trigger-vertical pip-trigger",$dir:"column",$gap:4,sx:"margin: 24px;",children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),n&&e.jsx(S,{}),e.jsxs(k,{$pip:!!n,draggable:n&&0===je[0],onDrag:n?e=>{if(e.clientX<0||e.clientY<0)return;const i=window.innerWidth-e.clientX,t=window.innerHeight-e.clientY;((e,i)=>{if(!ie?.current)return;const t=ie.current.getBoundingClientRect();e&&e>=16&&e<=K.innerWidth-16-t.width&&fe(e),i&&i>=16&&i<=K.innerHeight-16-t.height&&ye(i)})(me+(i-we[0]),be+(t-we[1])),ve([i,t])}:void 0,onMouseDown:e=>{ve([window.innerWidth-e.clientX,window.innerHeight-e.clientY])},ref:ie,style:n?{bottom:be,height:ce,right:me,width:ue}:void 0,children:[n&&e.jsx(o.Button,{className:"close-pip",icon:e.jsx(a.SelectItem,{color:"grey-0"}),onClick:e=>{e.stopPropagation(),M&&M(!1)},size:"large",sx:"\n display: none;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 10;\n svg {\n fill: var(--color-white);\n }\n ",type:"text"}),e.jsx(v.default,{className:"player",config:{file:{attributes:{..."true"===Y?{crossOrigin:"true"}:{},disablePictureInPicture:"true"},forceHLS:Te,hlsOptions:Te?{autoStartLoad:!0}:void 0,tracks:(Le?.subtitles||[]).map(e=>({kind:"subtitles",label:e.label,src:e.src,srcLang:e.locale}))}},controls:!0,height:"100%",light:!X&&(Le.thumbnail&&e.jsx(w.default,{alt:`thumbnail for ${_}`,layout:"fill",priority:!0,quality:100,style:{objectFit:"cover"},src:Le.thumbnail})),progressInterval:4e3,onProgress:e=>T(e,Ie?Pe[Se]?.id:void 0),onStart:E,onClickPreview:L,onReady:()=>{if(!le){const e=U?.current?.getCurrentTime();0===e&&(Ie?0!==Pe?.[Se]?.progress&&U.current.seekTo(Pe?.[Se].progress):0!==Le?.progress&&U.current.seekTo(Le.progress))}},pip:n,playIcon:r||le||Ie?e.jsx(u.PlaySolid,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}):e.jsx(p.LockCircle,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}),playing:X&&(r||le||Ie),muted:X,ref:U,url:Le.src,width:"100%",volume:he,onVolumeChange:e=>{xe(e.target.volume)}}),n&&e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"top horizontal",draggable:"false",onDrag:Fe,onMouseDown:Oe,onDragEnd:()=>$e([0,0]),tabIndex:0}),e.jsx(D,{className:"bottom horizontal",draggable:"false",onDrag:Fe,onMouseDown:Oe,onDragEnd:()=>$e([0,0]),tabIndex:0}),e.jsx(D,{className:"right vertical",draggable:"false",onDrag:Fe,onMouseDown:Oe,onDragEnd:()=>$e([0,0]),tabIndex:0}),e.jsx(D,{className:"left vertical",draggable:"false",onDrag:Fe,onMouseDown:Oe,onDragEnd:()=>$e([0,0]),tabIndex:0})]})]}),"horizontal"===H&&e.jsx(A,{children:e.jsxs(z,{$showingAll:re,children:[e.jsxs(l.Box,{$dir:"column",$gap:4,children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),e.jsxs(l.Box,{$align:"center",children:[e.jsx(s.Tabs,{activeIndex:te,onChange:e=>ne(e),items:Ne,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:re,orientation:H,toggleShowingAll:He})]}),0===te?e.jsx(C,{ref:ee,$showingAll:re,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{de(i.id),Ee(t)},title:i.title,thumbnail:i.thumbnail,shortDescription:i.shortDescription,duration:i.duration,progress:i.progress,playable:r,nowplaying:ae,comingSoon:i.comingSoon||!1,ref:e=>{Z.current[i.id]=e}},i.id))}):We?e.jsxs(C,{$showingAll:re,children:[!!Pe.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:Pe.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{de(i.id),Ee(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:ae,ref:e=>{Z.current[i.id]=e}},i.id))})},i))}),!!ze.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...ze].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:ae,type:i.type,isFile:"FILE"===i.type,ref:e=>{Z.current[i.id]=e}},i.id))})},i))}),!!Ce.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Products"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...Ce].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:ae,type:i.type,isFile:"FILE"===i.type,ref:e=>{Z.current[i.id]=e}},i.id))})},i))})]}):_e&&W?e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:se,trailer:W}):null]})}),"vertical"===H&&e.jsx(l.Box,{$dir:"column",$gap:24,sx:re?"z-index: 3; position:relative;":"height: auto",children:e.jsxs(q,{$showingAll:re,children:[e.jsxs(l.Box,{sx:"padding: 0 1.5rem;",$align:"center",children:[e.jsx(s.Tabs,{activeIndex:te,onChange:e=>ne(e),items:Ne,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:re,orientation:H,toggleShowingAll:He})]}),[e.jsx(B,{ref:ee,$showingAll:re,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{comingSoon:i.comingSoon||!1,nowplaying:ae,playlistItemId:i.id,duration:i.duration,ref:e=>{Z.current[i.id]=e},onClick:()=>{Ee(t),de(i.id)},playable:r,progress:i.progress,shortDescription:i.shortDescription,thumbnail:i.thumbnail,title:i.title},i.id))}),e.jsxs(B,{$showingAll:re,children:[!!Pe.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})]}),sx:"flex-direction: column; gap: 24px;",children:Pe.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{de(i.id),Ee(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:ae,ref:e=>{Z.current[i.id]=e}},i.id))},i))}),(!!ze.length||!!Ce.length)&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})]}),sx:"flex-direction: column; gap: 24px;",children:[...ze,...Ce].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:ae,type:i.type,isFile:"FILE"===i.type,ref:e=>{Z.current[i.id]=e}},i.id))},i))})]}),!!W&&e.jsx(l.Box,{$dir:"column",$gap:8,sx:"margin: 0px 24px;",children:e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:se,trailer:W})})][te]]})})]})}):null};
|
|
@@ -15,6 +15,18 @@ export interface VideoProps {
|
|
|
15
15
|
playing?: boolean;
|
|
16
16
|
title?: string;
|
|
17
17
|
handleOnReady?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* @param autoPlay whether the video should automatically start playing when loaded
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
autoPlay?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @param crossOrigin CORS setting for the video element.
|
|
25
|
+
* - 'true': CORS request without credentials (default, converts to 'anonymous')
|
|
26
|
+
* - 'false': No CORS attribute (allows playback from any origin without CORS checks)
|
|
27
|
+
* @default 'true'
|
|
28
|
+
*/
|
|
29
|
+
crossOrigin?: 'true' | 'false';
|
|
18
30
|
}
|
|
19
|
-
export declare const Video: ({ controls, loop, muted, playsInline, src, subtitles, style, thumbnail, thumbnailObjectFit, forwardedRef, playing, title, handleOnReady, }: VideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const Video: ({ controls, loop, muted, playsInline, src, subtitles, style, thumbnail, thumbnailObjectFit, forwardedRef, playing, title, handleOnReady, autoPlay, crossOrigin, }: VideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
32
|
//# sourceMappingURL=video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video/video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,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6EZ,CAAC"}
|
|
@@ -74,11 +74,18 @@ export interface VideoPlayerProps {
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
autoPlay?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* @param crossOrigin CORS setting for the video element.
|
|
79
|
+
* - 'true': CORS request without credentials (default, converts to 'anonymous')
|
|
80
|
+
* - 'false': No CORS attribute (allows playback from any origin without CORS checks)
|
|
81
|
+
* @default 'true'
|
|
82
|
+
*/
|
|
83
|
+
crossOrigin?: 'true' | 'false';
|
|
77
84
|
onShowAllPlaylist?: (isOpen: boolean) => void;
|
|
78
85
|
}
|
|
79
86
|
/**
|
|
80
87
|
* ReactPlayer props reference -> https://www.npmjs.com/package/react-player#props
|
|
81
88
|
* HLS Option props reference -> https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning
|
|
82
89
|
*/
|
|
83
|
-
export declare const VideoPlayer: ({ activeIndex, pip, playable, playlist, onClickPreview, onPipChange, onProgress, onStart, orientation, setMediaItem, onShowAllPlaylist, forwardedRef, subtitle, title, trailer, additionalMedia, autoPlay, }: VideoPlayerProps) => import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export declare const VideoPlayer: ({ activeIndex, pip, playable, playlist, onClickPreview, onPipChange, onProgress, onStart, orientation, setMediaItem, onShowAllPlaylist, forwardedRef, subtitle, title, trailer, additionalMedia, autoPlay, crossOrigin, }: VideoPlayerProps) => import("react/jsx-runtime").JSX.Element;
|
|
84
91
|
//# sourceMappingURL=video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/video.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAavC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWhE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IACvD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,CACV,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,EACD,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/video.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAavC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWhE,MAAM,WA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