{"version":3,"file":"VideoPlayer.Cspr4tT3.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/QZwXiRlVp1y37glTbpdJ/9TgBQQIk2CaOlquOS8mE/VideoPlayer.js"],"sourcesContent":["// Video player component with all settings from the image plus border color and hover effects\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Video Player Component\n * \n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 225\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoPlayer(props){const{source=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",playing=false,radius=10,poster=true,posterImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video poster\"},background=\"#000000\",startTime=0,loop=false,fit=\"cover\",controls=true,muted=false,volume=25,borderColor=\"#CCCCCC\",cursor=\"pointer\"}=props;const videoRef=useRef(null);const[showPoster,setShowPoster]=useState(poster);const[hasStarted,setHasStarted]=useState(false);// Handle video properties\nuseEffect(()=>{if(!videoRef.current)return;const video=videoRef.current;video.currentTime=startTime/100*video.duration||0;video.volume=volume/100;video.muted=muted;video.loop=loop;if(playing&&!hasStarted){video.play().catch(()=>{// Handle autoplay restrictions\n});startTransition(()=>setHasStarted(true));}else if(!playing){video.pause();}},[playing,startTime,volume,muted,loop,hasStarted]);const handleVideoClick=()=>{if(!videoRef.current)return;if(videoRef.current.paused){videoRef.current.play();startTransition(()=>setHasStarted(true));if(poster){startTransition(()=>setShowPoster(false));}}else{videoRef.current.pause();}};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:`${radius}px`,overflow:\"hidden\",backgroundColor:background,border:`2px solid ${borderColor}`,cursor:cursor,...props.style},onClick:handleVideoClick,children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:source,style:{width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"},controls:controls,muted:muted,loop:loop,playsInline:true,onClick:handleVideoClick,onPlay:()=>{startTransition(()=>setHasStarted(true));if(poster){startTransition(()=>setShowPoster(false));}}}),poster&&showPoster&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundImage:`url(${posterImage.src})`,backgroundSize:fit,backgroundPosition:\"center\",backgroundRepeat:\"no-repeat\",pointerEvents:\"none\",zIndex:1},\"aria-label\":posterImage.alt}),poster&&showPoster&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",width:\"60px\",height:\"60px\",borderRadius:\"50%\",backgroundColor:\"rgba(0, 0, 0, 0.7)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",zIndex:2},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"white\",style:{marginLeft:\"2px\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})})})]});}addPropertyControls(VideoPlayer,{source:{type:ControlType.String,title:\"Source\",defaultValue:\"https://player.vimeo.com/video/123456789\",placeholder:\"Enter video URL (YouTube, Vimeo, Wistia, etc.)\"},playing:{type:ControlType.Boolean,title:\"Playing\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:10,min:0,max:50,step:1,unit:\"px\"},poster:{type:ControlType.Boolean,title:\"Poster\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},posterImage:{type:ControlType.ResponsiveImage,title:\"Poster Image\",hidden:({poster})=>!poster},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},startTime:{type:ControlType.Number,title:\"Start Time\",defaultValue:0,min:0,max:100,step:1,unit:\"%\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\"],defaultValue:\"cover\"},controls:{type:ControlType.Boolean,title:\"Controls\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},volume:{type:ControlType.Number,title:\"Volume\",defaultValue:25,min:0,max:100,step:1,unit:\"%\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#CCCCCC\"},cursor:{type:ControlType.Enum,title:\"Cursor\",options:[\"pointer\",\"default\",\"grab\",\"crosshair\",\"help\",\"move\",\"text\",\"wait\",\"zoom-in\"],optionTitles:[\"Pointer\",\"Default\",\"Grab\",\"Crosshair\",\"Help\",\"Move\",\"Text\",\"Wait\",\"Zoom In\"],defaultValue:\"pointer\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"225\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayer.map"],"mappings":"gSASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,uEAAuE,UAAQ,GAAM,SAAO,GAAG,SAAO,GAAK,cAAY,CAAC,IAAI,sEAAsE,IAAI,eAAe,CAAC,aAAW,UAAU,YAAU,EAAE,OAAK,GAAM,MAAI,QAAQ,WAAS,GAAK,QAAM,GAAM,SAAO,GAAG,cAAY,UAAU,SAAO,UAAU,CAAC,EAAY,EAASA,EAAO,MAAW,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