{"version":3,"file":"VideoWithPlayButton.C5qOgdaG.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/5ph6sdUiJYS0GioXxpP2/osA7f5FPXo87ek7k4Wey/VideoWithPlayButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Video with a centered play button.\n * Click → video plays, button fades out.\n * Pause or end → button comes back.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 360\n */export default function VideoWithPlayButton(props){const{videoFile,videoUrl,poster,playIcon,iconSize,radius,fit,muted,loop,showControlsWhilePlaying,overlayColor,style}=props;const videoRef=useRef(null);const[playing,setPlaying]=useState(false);const src=videoFile||videoUrl;const play=()=>{const v=videoRef.current;if(!v)return;v.muted=muted;v.play().catch(()=>{});};const togglePause=()=>{const v=videoRef.current;if(!v||showControlsWhilePlaying)return;if(!v.paused)v.pause();};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:radius,overflow:\"hidden\",background:\"#000\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,poster:poster?.src,muted:muted,loop:loop,playsInline:true,preload:\"metadata\",controls:playing&&showControlsWhilePlaying,onPlay:()=>setPlaying(true),onPause:()=>setPlaying(false),onEnded:()=>setPlaying(false),onClick:togglePause,style:{width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"}}),/*#__PURE__*/_jsx(\"div\",{onClick:play,style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:overlayColor,cursor:\"pointer\",opacity:playing?0:1,pointerEvents:playing?\"none\":\"auto\",transition:\"opacity 0.25s ease\"},children:playIcon?.src?/*#__PURE__*/_jsx(\"img\",{src:playIcon.src,alt:playIcon.alt||\"Play video\",style:{width:iconSize,height:iconSize,objectFit:\"contain\",transition:\"transform 0.2s ease\"},onMouseEnter:e=>e.currentTarget.style.transform=\"scale(1.08)\",onMouseLeave:e=>e.currentTarget.style.transform=\"scale(1)\"}):/*#__PURE__*/_jsx(DefaultPlayIcon,{size:iconSize})})]});}function DefaultPlayIcon({size}){return /*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:\"0 0 100 100\",\"aria-label\":\"Play video\",style:{filter:\"drop-shadow(0 4px 14px rgba(0,0,0,0.25))\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:\"playGrad\",x1:\"0\",y1:\"0\",x2:\"1\",y2:\"1\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:\"#06C8FF\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"55%\",stopColor:\"#0A6CFF\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:\"#0018B0\"})]})}),/*#__PURE__*/_jsx(\"circle\",{cx:\"50\",cy:\"50\",r:\"46\",fill:\"white\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"50\",cy:\"50\",r:\"40\",fill:\"none\",stroke:\"url(#playGrad)\",strokeWidth:\"7\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M40 31.5 Q37 30 37 33.5 V66.5 Q37 70 40 68.5 L68 52.5 Q71 50 68 47.5 Z\",fill:\"url(#playGrad)\"})]});}addPropertyControls(VideoWithPlayButton,{videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},videoUrl:{type:ControlType.String,title:\"or URL\",placeholder:\"https://…/video.mp4\"},poster:{type:ControlType.ResponsiveImage,title:\"Poster\"},playIcon:{type:ControlType.ResponsiveImage,title:\"Play Icon\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:88,min:24,max:300,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:20,min:0,max:100,unit:\"px\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\"],defaultValue:\"cover\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:false},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false},showControlsWhilePlaying:{type:ControlType.Boolean,title:\"Controls\",enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true},overlayColor:{type:ControlType.Color,title:\"Overlay\",defaultValue:\"rgba(0,0,0,0.15)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoWithPlayButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"640\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"360\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoWithPlayButton.map"],"mappings":"wLASG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,YAAU,WAAS,SAAO,WAAS,WAAS,SAAO,MAAI,QAAM,OAAK,2BAAyB,eAAa,SAAO,EAAY,EAASA,EAAO,IAAI,EAAO,CAAC,EAAQ,GAAYC,EAAS,EAAK,EAAQ,EAAI,GAAW,EAAe,MAAS,CAAC,IAAM,EAAE,EAAS,QAAY,IAAS,EAAE,MAAM,EAAM,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,EAAQ,MAAgB,CAAC,IAAM,EAAE,EAAS,QAAW,CAAC,GAAG,GAAoC,EAAE,QAAO,EAAE,MAAM,CAAE,EAAE,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,aAAa,EAAO,SAAS,SAAS,WAAW,MAAM,EAAE,SAAS,CAAc,EAAK,QAAQ,CAAC,IAAI,EAAa,MAAI,OAAO,GAAQ,IAAU,Q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