Module 401901

1,176 characters · in 3ee4253b98e73f4f.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{$:()=>m,A:()=>A});var i,l=n(627968),a=n(64700),s=n(503698),r=n.n(s),o=n(397927),c=n(183325),d=n(778862),u=n(821589),h=n(473772),m=((i={}).CONTAIN="contain",i.COVER="cover",i);let A=a.memo(function(e){let{streamId:t,onResize:n,wrapperClassName:i,videoComponent:s,className:m,fit:A="contain",mirror:g=!1,paused:p=!1,streamPreviewURL:_,videoSpinnerContext:f,userId:E,streamKey:C}=e,[x,S]=a.useState(!0);(0,d.A)({location:"VideoStream",videoSpinnerContext:f,userId:E,streamId:t,loading:x,paused:p});let{onReady:I}=(0,c.A)({streamId:t,userId:E,loading:x,videoSpinnerContext:f,streamKey:C,paused:p}),T=a.useCallback(()=>{S(!1),I()},[I]);return(0,l.jsxs)("div",{className:r()(h.wrapper,i),children:[null!=t&&(0,l.jsx)(s,{className:r()(h.video,(0,u.t)(h,"video",A),{[h.mirror]:g},m),streamId:t,onResize:n,onReady:T,paused:p}),p?null:(0,l.jsx)("div",{className:r()(h.previewWrapper,{[h.loading]:x}),children:x&&(0,l.jsxs)(a.Fragment,{children:[null!=_?(0,l.jsx)("img",{src:_,alt:"",className:h.previewImage}):(0,l.jsx)("div",{className:h.emptyPreviewWrapper,children:(0,l.jsx)("div",{className:h.emptyPreview})}),(0,l.jsx)(o.y$y,{className:h.spinner})]})})]})})}