var m=Object.defineProperty;var s=(r,a)=>m(r,"name",{value:a,configurable:!0});import{defineComponent as C,ref as i,computed as y,watch as h,onMounted as P,openBlock as _,createElementBlock as k,createElementVNode as u,withModifiers as w}from"vue";const M=["controls","poster"],S=["src"],b=C({__name:"MediaVideoTop",props:{asset:{},context:{}},emits:["play","videoPlayingStateChanged","videoControlsChanged"],setup(r,{emit:a}){const o=a,v=i(),l=i(!1),t=i(!1),d=y(()=>!t.value||l.value);h(d,n=>{o("videoControlsChanged",n)}),P(()=>{o("videoControlsChanged",d.value)});const c=s(()=>{t.value=!0,o("videoPlayingStateChanged",!0)},"onVideoPlay"),p=s(()=>{t.value=!1,o("videoPlayingStateChanged",!1)},"onVideoPause"),f=s(()=>{t.value=!1,o("videoPlayingStateChanged",!1)},"onVideoEnded");return(n,e)=>(_(),k("div",{class:"relative size-full overflow-hidden rounded bg-black",onMouseenter:e[1]||(e[1]=g=>l.value=!0),onMouseleave:e[2]||(e[2]=g=>l.value=!1)},[u("video",{ref_key:"videoRef",ref:v,controls:d.value,preload:"metadata",autoplay:"",muted:"",loop:"",playsinline:"",poster:n.asset.preview_url,class:"relative size-full object-contain transition-transform duration-300 group-hover:scale-105 group-data-[selected=true]:scale-105",onClick:e[0]||(e[0]=w(()=>{},["stop"])),onPlay:c,onPause:p,onEnded:f},[u("source",{src:n.asset.src||""},null,8,S)],40,M)],32))}});export{b as default};
//# sourceMappingURL=MediaVideoTop-Bwav54Mi.js.map
