{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/jv2hSz0wnNWNz8QuJJGH/yntKscHY2eNYUSyO8hhe/TransparentMovies_Replay_and_Loop.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";export function TransparentLoopVideo(props){const videoRef=useRef(null);const containerRef=useRef(null);const[inView,setInView]=useState(false);// Intersection Observer to play when in view\nuseEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setInView(true);}},{threshold:.25});if(containerRef.current)observer.observe(containerRef.current);return()=>observer.disconnect();},[]);useEffect(()=>{if(inView&&videoRef.current){const vid=videoRef.current;if(vid.readyState>=2){vid.play().catch(()=>{});}else{const onCanPlay=()=>{vid.play().catch(()=>{});vid.removeEventListener(\"canplay\",onCanPlay);};vid.addEventListener(\"canplay\",onCanPlay);}}},[inView]);const handleReplay=()=>{const vid=videoRef.current;if(vid){vid.pause();vid.currentTime=0;vid.load();vid.play().catch(()=>{});}};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsxs(\"video\",{ref:videoRef,muted:true,loop:props.loop,playsInline:true,style:{objectFit:\"contain\",width:\"100%\",height:\"100%\",...props.style},children:[props.movFile&&/*#__PURE__*/_jsx(\"source\",{src:props.movFile,type:\"video/mp4; codecs=hvc1\"}),props.webmFile&&/*#__PURE__*/_jsx(\"source\",{src:props.webmFile,type:\"video/webm\"}),\"Your browser does not support the video tag.\"]}),/*#__PURE__*/_jsx(\"div\",{onClick:handleReplay,style:{position:\"absolute\",bottom:8,right:8,width:32,height:32,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"transparent\",borderRadius:\"50%\",zIndex:10},children:props.iconFile&&/*#__PURE__*/_jsx(\"img\",{src:props.iconFile,alt:\"Replay Video\",style:{width:20,height:20,pointerEvents:\"none\"}})})]});}TransparentLoopVideo.defaultProps={movFile:\"\",webmFile:\"\",loop:true,iconFile:\"\"};addPropertyControls(TransparentLoopVideo,{movFile:{type:ControlType.File,title:\"MP4\",allowedFileTypes:[\"mp4\"]},webmFile:{type:ControlType.File,title:\"WEBM\",allowedFileTypes:[\"webm\"]},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},iconFile:{type:ControlType.File,title:\"Replay Icon\",allowedFileTypes:[\"png\",\"jpg\",\"jpeg\",\"svg\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"TransparentLoopVideo\":{\"type\":\"reactComponent\",\"name\":\"TransparentLoopVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TransparentMovies_Replay_and_Loop.map"],
  "mappings": "4HAAAA,IAAiK,SAASC,EAAqBC,EAAM,CAAC,IAAMC,EAASC,EAAO,IAAI,EAAQC,EAAaD,EAAO,IAAI,EAAO,CAACE,EAAOC,CAAS,EAAEC,EAAS,EAAK,EACxSC,EAAU,IAAI,CAAC,IAAMC,EAAS,IAAI,qBAAqB,CAAC,CAACC,CAAK,IAAI,CAAIA,EAAM,gBAAgBJ,EAAU,EAAI,CAAG,EAAE,CAAC,UAAU,GAAG,CAAC,EAAE,OAAGF,EAAa,SAAQK,EAAS,QAAQL,EAAa,OAAO,EAAQ,IAAIK,EAAS,WAAW,CAAE,EAAE,CAAC,CAAC,EAAED,EAAU,IAAI,CAAC,GAAGH,GAAQH,EAAS,QAAQ,CAAC,IAAMS,EAAIT,EAAS,QAAQ,GAAGS,EAAI,YAAY,EAAGA,EAAI,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,MAAO,CAAC,IAAMC,EAAU,IAAI,CAACD,EAAI,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,EAAEA,EAAI,oBAAoB,UAAUC,CAAS,CAAE,EAAED,EAAI,iBAAiB,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SAAS,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,iBAAiB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,KAAKA,EAAY,QAAQ,MAAM,OAAO,aAAa,EAAI,EAAE,SAAS,CAAC,KAAKA,EAAY,KAAK,MAAM,cAAc,iBAAiB,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "TransparentLoopVideo", "props", "videoRef", "pe", "containerRef", "inView", "setInView", "ye", "ue", "observer", "entry", "vid", "onCanPlay", "handleReplay", "u", "p", "addPropertyControls", "ControlType"]
}
