Module 275687

1,852 characters · in d5bc32d65a8721f4.js, 438bd156785041c7.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,a){a.d(t,{A:()=>m});var n=a(627968),o=a(64700),i=a(503698),r=a.n(i),c=a(311907),l=a(776231),s=a(664111),_=a(734057),d=a(67281),u=a(581874);function m(e){let{attachment:t,posterUrl:a,className:i,active:m=!1,autoPlay:p,src:C,embed:b=!1,fillContainer:h=!1,minWidth:g=500,maxWidth:f=1/0,maxHeight:I=1/0,channelId:A,showTextContent:T=f>=250,showParticipants:v=!0,volume:y,autoMute:S,onVolumeChange:E,onMutedChange:x,onClick:M,onContextMenu:O}=e,P=t.width??0,N=t.height??0,w=(0,c.bG)([_.A],()=>_.A.getBasicChannel(A)?.guild_id,[A]),B=P>0&&N>0?P/N:16/9,R=Math.min(P>0?P:g,f),G=R/B;G>I&&(R=(G=I)*B),R<g&&(G=(R=g)/B);let D=Math.round(Math.min(R,f)),k=Math.round(Math.min(G,I)),L=P>0&&N>0?Math.min(D/P,k/N,1):1,j=(0,l.AE)({src:a,width:Math.round(P*L),height:Math.round(N*L)}),[F,H]=o.useState(!1),U=o.useCallback(e=>{let{playerState:a,isControlBarExpanded:o}=e;return(0,n.jsx)(d.A,{createdAt:null!=t.clip_created_at?Date.parse(t.clip_created_at):void 0,participantIds:v?t.clip_participants?.map(e=>{let{id:t}=e;return t})??[]:[],applicationId:t.application?.id,title:t.title,guildId:w,playerState:a,isControlBarExpanded:o,isFullScreen:F,showTextContent:T})},[t,w,F,v,T]);return(0,n.jsx)("div",{className:r()(u.k,{[u.H]:h},i),onClick:e=>e.stopPropagation(),onKeyUp:b?e=>e.stopPropagation():void 0,onKeyDown:b?e=>e.stopPropagation():void 0,onContextMenu:O,style:h?void 0:{width:D,height:k},children:(0,n.jsx)(s.A,{crossOrigin:null,src:C,downloadUrl:t.url,downloadContentType:t.content_type,poster:j,posterPlaceholder:t.placeholder,posterPlaceholderVersion:t.placeholder_version,active:m,autoplay:p,initialVolume:y,initialMuted:S,onVolumeChange:E,onMutedChange:x,orientation:"landscape",loadingSpinnerPosition:"center",renderPersistentOverlay:U,parentTransitionState:null,onFullscreenChange:H,onClick:M,withVideoHalo:!0,objectFit:h?"cover":void 0})})}}