{"version":3,"file":"iOS_Player.Bra81VTx.mjs","names":["useState","useRef","_Fragment","startTransition"],"sources":["https:/framerusercontent.com/modules/8Ltvlyp5VFWEK9EKTwE2/VQYu5eWYKKp2j6POp3C8/iOS_Player.js"],"sourcesContent":["// User request: Fix type errors where `showControls` is used but missing from `VideoPlayerProps` and property controls.\n// Normal video player with file/URL (including Vimeo) support and optional overlay play button\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Video Player\n * \n * A normal video player component with file/URL (including Vimeo) support.\n * \n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 360\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoPlayer(props){const{videoSourceType=\"file\",videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",videoUrl=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",posterImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video poster\"},showControls=false,autoplay=false,loop=true,muted=true,borderRadius=12,backgroundColor=\"#000000\",style}=props;const[isPlaying,setIsPlaying]=useState(autoplay);const videoRef=useRef(null);useEffect(()=>{const el=videoRef.current;if(!el)return;// Prevent iOS Safari from forcing fullscreen playback\nel.setAttribute(\"playsinline\",\"\");el.setAttribute(\"webkit-playsinline\",\"\");},[]);const handlePlayPause=()=>{if(videoRef.current){if(isPlaying){videoRef.current.pause();}else{videoRef.current.play();}startTransition(()=>setIsPlaying(!isPlaying));}};// Get the correct video source based on type\nconst videoSource=videoSourceType===\"file\"?videoFile:videoUrl;// Helper function to detect and convert Vimeo URLs\nconst getVimeoEmbedUrl=url=>{const vimeoRegex=/(?:vimeo\\.com\\/)(?:.*\\/)?(\\d+)/;const match=url.match(vimeoRegex);if(match&&match[1]){const videoId=match[1];const params=new URLSearchParams;if(autoplay)params.append(\"autoplay\",\"1\");if(loop)params.append(\"loop\",\"1\");if(muted)params.append(\"muted\",\"1\");params.append(\"controls\",showControls?\"1\":\"0\");params.append(\"playsinline\",\"1\");return`https://player.vimeo.com/video/${videoId}?${params.toString()}`;}return null;};const isVimeo=videoSourceType===\"url\"&&getVimeoEmbedUrl(videoUrl)!==null;const vimeoEmbedUrl=isVimeo?getVimeoEmbedUrl(videoUrl):null;return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,background:backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",background:backgroundColor},children:isVimeo?/*#__PURE__*/_jsx(\"iframe\",{src:vimeoEmbedUrl||\"\",style:{width:\"100%\",height:\"100%\",border:\"none\",borderRadius,background:backgroundColor},allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,title:posterImage?.alt||\"Video\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoSource,poster:posterImage.src,autoPlay:autoplay,loop:loop,muted:muted,playsInline:true,controls:showControls,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius,background:backgroundColor},onPlay:()=>startTransition(()=>setIsPlaying(true)),onPause:()=>startTransition(()=>setIsPlaying(false))}),!showControls&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",cursor:\"pointer\",backgroundColor:\"rgba(0, 0, 0, 0.1)\",opacity:isPlaying?0:1,transition:\"opacity 0.3s ease\",borderRadius},onClick:handlePlayPause,children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"60px\",height:\"60px\",borderRadius:\"50%\",backgroundColor:\"rgba(255, 255, 255, 0.8)\",backdropFilter:\"blur(10px)\",border:\"1px solid rgba(255, 255, 255, 0.3)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0.4px rgba(255, 255, 255, 1)\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",style:{marginLeft:isPlaying?\"0\":\"2px\"},children:isPlaying?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"rect\",{x:\"6\",y:\"4\",width:\"4\",height:\"16\",fill:\"#000\"}),/*#__PURE__*/_jsx(\"rect\",{x:\"14\",y:\"4\",width:\"4\",height:\"16\",fill:\"#000\"})]}):/*#__PURE__*/_jsx(\"polygon\",{points:\"8,5 19,12 8,19\",fill:\"#000\"})})})})]})})});}addPropertyControls(VideoPlayer,{videoSourceType:{type:ControlType.Enum,title:\"Video Source\",options:[\"file\",\"url\"],optionTitles:[\"File\",\"URL\"],defaultValue:\"file\",displaySegmentedControl:true},videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\",\"avi\"],hidden:({videoSourceType})=>videoSourceType!==\"file\"},videoUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",placeholder:\"Enter video URL...\",hidden:({videoSourceType})=>videoSourceType!==\"url\"},posterImage:{type:ControlType.ResponsiveImage,title:\"Image\",description:\"We recommend adding a poster image\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},showControls:{type:ControlType.Boolean,title:\"Controls\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},loop:{type:ControlType.Boolean,title:\"Loop Video\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:60,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"640\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"360\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./iOS_Player.map"],"mappings":"8MAYG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,kBAAgB,OAAO,YAAU,uEAAuE,WAAS,uEAAuE,cAAY,CAAC,IAAI,sEAAsE,IAAI,cAAc,EAAE,eAAa,GAAM,WAAS,GAAM,OAAK,GAAK,QAAM,GAAK,eAAa,GAAG,kBAAgB,UAAU,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,CAAQ,EAAQ,EAASC,EAAO,IAAI,EAAE,MAAc,CAAC,IAAM,EAAG,EAAS,QAAY,IAC/jB,EAAG,aAAa,cAAc,EAAE,EAAE,EAAG,aAAa,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAM,MAAoB,CAAI,EAAS,UAAY,EAAW,EAAS,QAAQ,MAAM,EAAQ,EAAS,QAAQ,KAAK,EAAG,MAAoB,EAAa,CAAC,CAAS,CAAC,EAAG,EAChP,EAAY,IAAkB,OAAO,EAAU,EAC/C,EAAiB,GAAK,CAAmD,IAAM,EAAM,EAAI,MAAM,gCAAU,EAAE,GAAG,GAAO,EAAM,GAAG,CAAC,IAAM,EAAQ,EAAM,GAAS,EAAO,IAAI,gBAAgN,OAA7L,GAAS,EAAO,OAAO,WAAW,GAAG,EAAK,GAAK,EAAO,OAAO,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