{"version":3,"file":"AutoplayVideo.Cq3gBZaP.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/DKb465Y0ni3Lkst0jGmu/l1u1WEtm7VaFIjdaQaWd/AutoplayVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef}from\"react\";export function AutoplayVideo({src,borderRadius,objectFit}){const ref=useRef(null);useEffect(()=>{const video=ref.current;if(!video)return;// Safari-kompatibles Autoplay\nvideo.muted=true;video.playsInline=true;video.defaultMuted=true;const tryPlay=()=>{video.play().catch(()=>{});};// Sofort versuchen\ntryPlay();// Nach erstem User-Klick nochmal – für Safari\nconst handleInteraction=()=>{video.muted=true;tryPlay();};document.addEventListener(\"click\",handleInteraction,{once:true});document.addEventListener(\"touchstart\",handleInteraction,{once:true});return()=>{document.removeEventListener(\"click\",handleInteraction);document.removeEventListener(\"touchstart\",handleInteraction);};},[src]);if(!src){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor:\"#e8e8e8\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:borderRadius,color:\"#999\",fontSize:14},children:\"Video hochladen\"});}return /*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,autoPlay:true,muted:true,loop:true,playsInline:true,style:{width:\"100%\",height:\"100%\",objectFit:objectFit,borderRadius:borderRadius,display:\"block\"}});}addPropertyControls(AutoplayVideo,{src:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"mov\",\"webm\"],title:\"Video\"},objectFit:{type:ControlType.Enum,defaultValue:\"cover\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\"],title:\"Bildanpassung\",displaySegmentedControl:true},borderRadius:{type:ControlType.Number,defaultValue:0,min:0,max:100,step:1,unit:\"px\",title:\"Eckenradius\",displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"AutoplayVideo\":{\"type\":\"reactComponent\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