{"version":3,"file":"YouTubePlayer.D_DsFPRB.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/X0BoqNhbrTtjPiTF3eGA/fqlBbxrE2L5DQB8Rndme/YouTubePlayer.js"],"sourcesContent":["// YouTube video player with custom thumbnail that shows video on click\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 900\n * @framerIntrinsicHeight 506\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function YouTubePlayer(props){const{videoId,thumbnail,autoplay,showControls,muted}=props;const[isPlaying,setIsPlaying]=useState(false);const handleClick=()=>{startTransition(()=>setIsPlaying(true));};// Use custom thumbnail if provided, otherwise use YouTube's default thumbnail\nconst thumbnailSrc=thumbnail?.src||`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`;const embedUrl=`https://www.youtube.com/embed/${videoId}?autoplay=1&${showControls?\"controls=1\":\"controls=0\"}&rel=0&mute=${muted?\"1\":\"0\"}`;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",overflow:\"hidden\",cursor:isPlaying?\"default\":\"pointer\",backgroundColor:\"#000\"},onClick:isPlaying?undefined:handleClick,onKeyDown:e=>{if(!isPlaying&&(e.key===\"Enter\"||e.key===\" \")){e.preventDefault();handleClick();}},tabIndex:isPlaying?-1:0,role:isPlaying?undefined:\"button\",\"aria-label\":isPlaying?undefined:\"Play video\",children:[!isPlaying&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:thumbnailSrc,alt:thumbnail?.alt||\"Video thumbnail\",style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",width:\"68px\",height:\"48px\",backgroundColor:\"rgba(255, 255, 255, 0.95)\",borderRadius:\"12px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"background-color 0.2s\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:\"28\",height:\"28\",fill:\"#000\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})})})]}),isPlaying&&/*#__PURE__*/_jsx(\"iframe\",{src:embedUrl,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true,title:\"YouTube video player\"})]});}addPropertyControls(YouTubePlayer,{videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"dQw4w9WgXcQ\",placeholder:\"Enter YouTube video ID\"},thumbnail:{type:ControlType.ResponsiveImage,title:\"Thumbnail\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},showControls:{type:ControlType.Boolean,title:\"Controls\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YouTubePlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"506\",\"framerIntrinsicWidth\":\"900\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./YouTubePlayer.map"],"mappings":"+LAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,UAAQ,YAAU,WAAS,eAAa,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,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