{"version":3,"file":"AutoVideo.Dcmhe6ZT.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/69sMkWbtJqor2qYoexsY/BEdQndm63H8sDZW2l9xi/AutoVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 720\n */export default function AutoVideo(props){const{src,poster,ratio}=props;const ref=useRef(null);useEffect(()=>{const v=ref.current;if(!v)return;const tryPlay=()=>{const p=v.play();if(p&&p.catch)p.catch(()=>{});};tryPlay();const io=new IntersectionObserver(es=>{es.forEach(e=>{if(e.isIntersecting)tryPlay();});});io.observe(v);return()=>io.disconnect();},[]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",aspectRatio:String(ratio||\"16 / 9\"),borderRadius:14,overflow:\"hidden\",border:\"1px solid #E4E2DE\",boxShadow:\"0 8px 24px rgba(22,23,29,0.07)\",background:\"#FFFFFF\"},children:/*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,poster:poster,muted:true,autoPlay:true,loop:true,playsInline:true,preload:\"auto\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}})});}AutoVideo.defaultProps={src:\"https://framerusercontent.com/assets/BPosd0lz1JEzmrZa0mXWDwHz0.mp4\",poster:\"https://framerusercontent.com/assets/wmRVf05BKMQzg74rCi33venPMeo.webp\",ratio:\"16 / 9\"};addPropertyControls(AutoVideo,{src:{type:ControlType.String,title:\"Video URL\"},poster:{type:ControlType.String,title:\"Poster URL\"},ratio:{type:ControlType.String,title:\"Aspect ratio\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AutoVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntr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