{"version":3,"file":"SmartVideoPlayer.BaLd1RFt.mjs","names":[],"sources":["https:/framerusercontent.com/modules/XV9khs85ST2Eirj2eKNh/FrxcbeS2ghHnao0QIA3r/SmartVideoPlayer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SmartVideoPlayer(props){const{videoUrl,style}=props;// Function to detect video type\nfunction getVideoType(url){if(!url)return\"none\";if(url.includes(\"youtube.com\")||url.includes(\"youtu.be\")){return\"youtube\";}if(url.includes(\"vimeo.com\")){return\"vimeo\";}return\"direct\";}// Function to get YouTube embed ID\nfunction getYouTubeId(url){const regExp=/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;const match=url.match(regExp);return match&&match[2].length===11?match[2]:null;}// Function to get Vimeo ID\nfunction getVimeoId(url){const regExp=/vimeo.*\\/(\\d+)/i;const match=url.match(regExp);return match?match[1]:null;}const videoType=getVideoType(videoUrl);// YouTube Player\nif(videoType===\"youtube\"){const videoId=getYouTubeId(videoUrl);if(videoId){return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",paddingBottom:\"56.25%\",height:0},children:/*#__PURE__*/_jsx(\"iframe\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"},src:`https://www.youtube.com/embed/${videoId}`,frameBorder:\"0\",allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true})});}}// Vimeo Player\nif(videoType===\"vimeo\"){const videoId=getVimeoId(videoUrl);if(videoId){return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",paddingBottom:\"56.25%\",height:0},children:/*#__PURE__*/_jsx(\"iframe\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"},src:`https://player.vimeo.com/video/${videoId}`,frameBorder:\"0\",allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true})});}}// Direct Video File\nif(videoType===\"direct\"&&videoUrl){return /*#__PURE__*/_jsx(\"video\",{style:{...style,width:\"100%\",height:\"100%\"},controls:true,src:videoUrl,children:\"Your browser does not support the video tag.\"});}// No URL - return null to hide component\nif(!videoUrl){return null;}// Invalid URL\nreturn /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"#f0f0f0\",color:\"#666\",padding:\"20px\",textAlign:\"center\"},children:\"Invalid video URL\"});}// Default props\nSmartVideoPlayer.defaultProps={videoUrl:\"\"};// Property controls\naddPropertyControls(SmartVideoPlayer,{videoUrl:{type:ControlType.String,title:\"Video URL\",placeholder:\"Paste YouTube, Vimeo, or direct video URL\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmartVideoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmartVideoPlayer.map"],"mappings":"4JAGG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,WAAS,SAAO,EACzE,SAAS,EAAa,EAAI,CAA8I,OAAzI,EAAoB,EAAI,SAAS,cAAc,EAAE,EAAI,SAAS,WAAW,CAAQ,UAAc,EAAI,SAAS,YAAY,CAAQ,QAAe,SAArI,OACzC,SAAS,EAAa,EAAI,CAA6E,IAAM,EAAM,EAAI,MAA/E,+DAA4F,CAAC,OAAO,GAAO,EAAM,GAAG,SAAS,GAAG,EAAM,GAAG,KACjL,SAAS,EAAW,EAAI,CAAgC,IAAM,EAAM,EAAI,MAAlC,kBAA+C,CAAC,OAAO,EAAM,EAAM,GAAG,KAAM,IAAM,EAAU,EAAa,EAAS,CACxJ,GAAG,IAAY,UAAU,CAAC,IAAM,EAAQ,EAAa,EAAS,CAAC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