1import{j as e,U as I}from"./index-ulJQSrBi.js";import{a0 as M,_ as P,Y as A,s as h,L as R,ab as p,W as r,ac as j,B as c,t as g,a8 as v,v as S,O as U,Q as B,R as T,U as D}from"./main-PG-dEEgK.js";import{u as $,a as q}from"./stableQueryData-BbGl7JVl.js";import{M as E}from"./MuxPlayer-BdC75QY5.js";import{R as J}from"./radio-5i0ImmHY.js";import{f as y}from"./format-DF7LNAoZ.js";import"./index-DDJOdvVc.js";import"./avatar-CifY7QVQ.js";import"./pause-WYhbreAT.js";import"./volume-2-DqnFQvuu.js";import"./en-US-B0J26mvj.js";function X(){var m,x;const{recordingId:a}=M(),[,f]=P(),{currentOrg:i}=A(),{data:s,isLoading:N,error:t}=h({queryKey:[`/api/recordings/${a}`],enabled:!!a&&!!(i!=null&&i.id)}),b=$(),{data:w}=h({queryKey:[`/api/recordings/${a}/live-stats`],refetchInterval:(s==null?void 0:s.status)==="recording"?5e3:!1,enabled:!!a&&(s==null?void 0:s.status)==="recording",select:b}),n=q(w),l=()=>{f("/app/meetings?tab=recordings")},k=()=>{var u;if((u=s==null?void 0:s.meeting)!=null&&u.slug){const L=`${window.location.origin}/meet/${s.meeting.slug}`;window.open(L,"_blank")}};if(N)return e.jsx("div",{className:"flex items-center justify-center min-h-[600px]",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(R,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading live stream..."})]})});if(t||!s)return e.jsx("div",{className:"flex items-center justify-center min-h-[600px]",children:e.jsxs(p,{variant:"destructive",className:"max-w-md",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx(j,{children:(t==null?void 0:t.message)||"Unable to load the live stream. The meeting may have ended or you may not have access."}),e.jsxs(c,{variant:"outline",className:"mt-4",onClick:l,children:[e.jsx(g,{className:"w-4 h-4 mr-2"}),"Back to Recordings"]})]})});const d=s.status==="recording",C=((m=s.meeting)==null?void 0:m.title)||s.roomName||"Untitled Meeting",o=new Date(s.startedAt);return e.jsxs("div",{className:"container mx-auto p-6 max-w-6xl",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs(c,{variant:"ghost",onClick:l,"data-testid":"button-back",children:[e.jsx(g,{className:"w-4 h-4 mr-2"}),"Back to Recordings"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[d&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:"destructive",className:"animate-pulse",children:[e.jsx(J,{className:"w-3 h-3 mr-1"}),"LIVE"]}),e.jsxs(v,{variant:"outline",children:[e.jsx(I,{className:"w-3 h-3 mr-1"}),(n==null?void 0:n.participantCount)||s.participantCount||0," viewers"]})]}),e.jsx(c,{variant:"default",onClick:k,disabled:!((x=s.meeting)!=null&&x.slug)||s.status!=="recording","data-testid":"button-join-meeting",children:"Join as Participant"})]})]}),e.jsxs(S,{children:[e.jsxs(U,{children:[e.jsx(B,{className:"text-2xl",children:C}),e.jsxs(T,{children:["Started ",y(o,"MMMM d, yyyy")," at ",y(o,"h:mm a")]})]}),e.jsx(D,{className:"p-0",children:d?e.jsx("div",{className:"aspect-video bg-black rounded-b-lg overflow-hidden",children:s.muxPlaybackId||s.publicPlaybackId?e.jsx(E,{playbackId:s.muxPlaybackId||s.publicPlaybackId,autoPlay:!0,muted:!1,streamType:"live"}):e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(r,{className:"w-8 h-8 mx-auto opacity-60"}),e.jsx("p",{className:"text-sm opacity-80",children:"Live stream is starting â video will appear shortly."})]})})}):e.jsxs(p,{className:"m-6",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsxs(j,{children:["This meeting is no longer live.",s.status==="ready"&&s.recordingUrl&&e.jsx("span",{children:" You can watch the recording instead."})]})]})})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx("div",{className:"lg:col-span-2"}),e.jsx("div",{className:"lg:col-span-1"})]})]})}export{X as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.