{"version":3,"file":"VideoPlayer.CX3HKPuN.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/k7jdXEkXiKjdSQv6tGNg/nLl9dESgZ5ZJJ1BQ7251/VideoPlayer.js"],"sourcesContent":["// Video component with play/pause controls, loop option, corner radius, and fallback poster\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoPlayer(props){const{videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",posterImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video poster\"},autoPlay=false,loop=false,cornerRadius=8,buttonSize=48,brightness=100}=props;const[isPlaying,setIsPlaying]=useState(autoPlay);const videoRef=useRef(null);const iconSize=buttonSize*.5;useEffect(()=>{if(typeof window===\"undefined\")return;const video=videoRef.current;if(!video)return;if(isPlaying){video.play().catch(()=>{startTransition(()=>setIsPlaying(false));});}else{video.pause();}},[isPlaying]);const togglePlayPause=()=>{startTransition(()=>setIsPlaying(!isPlaying));};const handleVideoEnded=()=>{startTransition(()=>setIsPlaying(false));};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:cornerRadius,overflow:\"hidden\",backgroundColor:\"#000\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoFile,poster:posterImage.src,loop:loop,autoPlay:autoPlay,muted:autoPlay,onEnded:handleVideoEnded,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",filter:`brightness(${brightness}%)`},playsInline:true}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"flex-end\",justifyContent:\"flex-start\"},children:/*#__PURE__*/_jsx(\"button\",{onClick:togglePlayPause,style:{width:buttonSize,height:buttonSize,borderRadius:0,backgroundColor:\"transparent\",border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";},\"aria-label\":isPlaying?\"Pause\":\"Play\",children:isPlaying?/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",children:[/*#__PURE__*/_jsx(\"rect\",{x:\"6\",y:\"5\",width:\"4\",height:\"14\",fill:\"#FFF\",rx:\"1\"}),/*#__PURE__*/_jsx(\"rect\",{x:\"14\",y:\"5\",width:\"4\",height:\"14\",fill:\"#FFF\",rx:\"1\"})]}):/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5.14v13.72L19 12L8 5.14z\",fill:\"#FFF\"})})})})]});}addPropertyControls(VideoPlayer,{videoFile:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},posterImage:{type:ControlType.ResponsiveImage,title:\"Poster Image\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},cornerRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},buttonSize:{type:ControlType.Number,title:\"Button Size\",defaultValue:48,min:24,max:128,step:4,unit:\"px\"},brightness:{type:ControlType.Number,title:\"Brightness\",defaultValue:100,min:0,max:200,step:1,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayer.map"],"mappings":"0MAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,YAAU,uEAAuE,cAAY,CAAC,IAAI,sEAAsE,IAAI,eAAe,CAAC,WAAS,GAAM,OAAK,GAAM,eAAa,EAAE,aAAW,GAAG,aAAW,KAAK,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAS,CAAO,EAASC,EAAO,KAAK,CAAO,EAAS,EAAW,GAA8W,OAA3W,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAM,EAAS,QAAY,IAAgB,EAAW,EAAM,MAAM,CAAC,UAAU,CAAC,MAAoB,EAAa,GAAM,CAAC,EAAG,CAAO,EAAM,OAAO,GAAI,CAAC,EAAU,CAAC,CAAuK,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,aAAa,EAAa,SAAS,SAAS,gBAAgB,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,IAAI,EAAS,IAAI,EAAU,OAAO,EAAY,IAAS,OAAc,WAAS,MAAM,EAAS,YAAzU,CAAC,MAAoB,EAAa,GAAM,CAAC,EAAyT,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,OAAO,cAAc,EAAW,IAAI,CAAC,YAAY,GAAK,CAAC,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,WAAW,eAAe,aAAa,CAAC,SAAsB,EAAK,SAAS,CAAC,YAA7tB,CAAC,MAAoB,EAAa,CAAC,EAAU,CAAC,EAAusB,MAAM,CAAC,MAAM,EAAW,OAAO,EAAW,aAAa,EAAE,gBAAgB,cAA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