{"version":3,"file":"Video_Component.BKemJnaG.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/NzDEWuBFjBzTrYIzHrJm/s57aq0NW7nMyYbX7GyQn/Video_Component.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Video_Component(props){const{videoURL,muted,controls,autoPause}=props;const containerRef=useRef(null);const videoRef=useRef(null);const isInView=useInView(containerRef,{amount:1})// 50% visibility\n;useEffect(()=>{if(videoRef.current){if(isInView){videoRef.current.play();}else if(autoPause){videoRef.current.pause();}}},[isInView]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoURL,muted:muted,controls:controls,loop:true,playsInline:true,style:{width:\"100%\",height:\"100%\"}})});}addPropertyControls(Video_Component,{videoURL:{title:\"Video URL\",type:ControlType.String,defaultValue:\"https://www.w3schools.com/html/mov_bbb.mp4\"},muted:{title:\"Muted\",type:ControlType.Boolean,defaultValue:true},controls:{title:\"Controls\",type:ControlType.Boolean,defaultValue:true},autoPause:{title:\"Pause when out of view\",type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Video_Component\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Video_Component.map"],"mappings":"6VAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,QAAM,WAAS,YAAU,CAAC,EAAY,EAAaA,EAAO,MAAY,EAASA,EAAO,MAAY,EAAS,EAAU,EAAa,CAAC,OAAO,EAAE,EACtE,OAAtI,MAAc,CAAI,EAAS,UAAY,EAAU,EAAS,QAAQ,OAAgB,GAAW,EAAS,QAAQ,QAAW,EAAC,CAAC,EAAS,EAAsB,EAAK,MAAM,CAAC,IAAI,EAAa,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,SAAsB,EAAK,QAAQ,CAAC,IAAI,EAAS,IAAI,EAAe,QAAe,WAAS,KAAK,GAAK,YAAY,GAAK,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,EAAE,CAAG,iCAAoB,EAAgB,CAAC,SAAS,CAAC,MAAM,YAAY,KAAK,EAAY,OAAO,aAAa,6CAA6C,CAAC,MAAM,CAAC,MAAM,QAAQ,KAAK,EAAY,QAAQ,aAAa,GAAK,CAAC,SAAS,CAAC,MAAM,WAAW,KAAK,EAAY,QAAQ,aAAa,GAAK,CAAC,UAAU,CAAC,MAAM,yBAAyB,KAAK,EAAY,QAAQ,aAAa,GAAK,CAAC"}