{"version":3,"file":"VideoPlayer_5.BOlIlryu.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/StMGtSpB3pEmaq9VMxZM/IsBuDAv03HexP4Ry6eCn/VideoPlayer_5.js"],"sourcesContent":["// Responsive video player component with fullscreen support for ConvertEai\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function VideoPlayer(props){const{playerId=\"68cb2633151f30ecba562e76\",accountId=\"f99c43f4-2d21-4769-a9cf-9bc71cbe7fd1\",aspectRatio=\"16/9\",backgroundColor=\"#000000\",borderRadius=8}=props;const wrapperRef=useRef(null);const iframeRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;// Load ConvertEai SDK\nconst existingScript=document.querySelector('script[src*=\"smartplayer-wc\"]');if(!existingScript){const script=document.createElement(\"script\");script.src=\"https://scripts.converteai.net/lib/js/smartplayer-wc/v4/sdk.js\";script.async=true;document.head.appendChild(script);}// Set iframe source after component mounts\nconst iframe=iframeRef.current;if(iframe&&iframe.src===\"about:blank\"){const baseUrl=`https://scripts.converteai.net/${accountId}/players/${playerId}/v4/embed.html`;const search=window.location.search||\"?\";const currentUrl=encodeURIComponent(window.location.href);iframe.src=`${baseUrl}${search}&vl=${currentUrl}`;}// Handle fullscreen events to prevent body scrolling\nconst handleFullscreenChange=()=>{if(document.fullscreenElement){// Entering fullscreen - disable body scroll\ndocument.body.style.overflow=\"hidden\";document.documentElement.style.overflow=\"hidden\";// Additional mobile scroll prevention\ndocument.body.style.position=\"fixed\";document.body.style.width=\"100%\";document.body.style.height=\"100%\";// Ensure video stays on top of all components\nif(iframe){iframe.style.zIndex=\"999999\";}}else{// Exiting fullscreen - restore body scroll\ndocument.body.style.overflow=\"\";document.documentElement.style.overflow=\"\";document.body.style.position=\"\";document.body.style.width=\"\";document.body.style.height=\"\";// Reset z-index\nif(iframe){iframe.style.zIndex=\"\";}}};// Listen for play events from the iframe to trigger fullscreen\nconst handleMessage=event=>{// Check if message is from our iframe\nif(event.source===iframe?.contentWindow){// Check for play event or similar trigger\nif(event.data&&(event.data.type===\"play\"||event.data.action===\"play\")){// Request fullscreen on the iframe\nif(iframe.requestFullscreen){iframe.requestFullscreen();}else if(iframe.webkitRequestFullscreen){iframe.webkitRequestFullscreen();}else if(iframe.mozRequestFullScreen){iframe.mozRequestFullScreen();}else if(iframe.msRequestFullscreen){iframe.msRequestFullscreen();}}}};// Add click listener to iframe wrapper to trigger fullscreen on play\nconst handleWrapperClick=()=>{// Small delay to allow the video to start playing first\nsetTimeout(()=>{if(iframe&&iframe.requestFullscreen){iframe.requestFullscreen().catch(err=>{console.log(\"Fullscreen request failed:\",err);});}else if(iframe&&iframe.webkitRequestFullscreen){iframe.webkitRequestFullscreen();}else if(iframe&&iframe.mozRequestFullScreen){iframe.mozRequestFullScreen();}else if(iframe&&iframe.msRequestFullscreen){iframe.msRequestFullscreen();}},100);};// Add event listeners\nwindow.addEventListener(\"message\",handleMessage);document.addEventListener(\"fullscreenchange\",handleFullscreenChange);document.addEventListener(\"webkitfullscreenchange\",handleFullscreenChange);document.addEventListener(\"mozfullscreenchange\",handleFullscreenChange);document.addEventListener(\"MSFullscreenChange\",handleFullscreenChange);// Add click listener to wrapper\nconst wrapper=wrapperRef.current;if(wrapper){wrapper.addEventListener(\"click\",handleWrapperClick);}// Cleanup function\nreturn()=>{window.removeEventListener(\"message\",handleMessage);document.removeEventListener(\"fullscreenchange\",handleFullscreenChange);document.removeEventListener(\"webkitfullscreenchange\",handleFullscreenChange);document.removeEventListener(\"mozfullscreenchange\",handleFullscreenChange);document.removeEventListener(\"MSFullscreenChange\",handleFullscreenChange);if(wrapper){wrapper.removeEventListener(\"click\",handleWrapperClick);}// Restore scroll on unmount\ndocument.body.style.overflow=\"\";document.documentElement.style.overflow=\"\";document.body.style.position=\"\";document.body.style.width=\"\";document.body.style.height=\"\";};},[accountId,playerId]);const isFixedWidth=props?.style?.width===\"100%\";const isFixedHeight=props?.style?.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{ref:wrapperRef,id:`ifr_${playerId}_wrapper`,style:{margin:\"0 auto\",width:\"100%\",maxWidth:\"100%\",position:\"relative\",overflow:\"visible\",backgroundColor,borderRadius,...isFixedWidth&&isFixedHeight?props.style:{},...!isFixedWidth&&!isFixedHeight?{minWidth:\"320px\",minHeight:\"180px\"}:{}},children:/*#__PURE__*/_jsx(\"div\",{id:`ifr_${playerId}_aspect`,style:{position:\"relative\",aspectRatio:aspectRatio,height:\"auto\",width:\"100%\"},children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,id:`ifr_${playerId}`,src:\"about:blank\",frameBorder:\"0\",referrerPolicy:\"origin\",loading:\"lazy\",allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen\",allowFullScreen:true,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:0,borderRadius:\"inherit\"},onLoad:e=>{const iframe=e.target;if(iframe.src===\"about:blank\"){const baseUrl=`https://scripts.converteai.net/${accountId}/players/${playerId}/v4/embed.html`;const search=typeof window!==\"undefined\"?window.location.search||\"?\":\"?\";const currentUrl=typeof window!==\"undefined\"?encodeURIComponent(window.location.href):\"\";iframe.src=`${baseUrl}${search}&vl=${currentUrl}`;}}})})});}addPropertyControls(VideoPlayer,{playerId:{type:ControlType.String,title:\"Player ID\",defaultValue:\"68cb2633151f30ecba562e76\",placeholder:\"Enter player ID...\"},accountId:{type:ControlType.String,title:\"Account ID\",defaultValue:\"f99c43f4-2d21-4769-a9cf-9bc71cbe7fd1\",placeholder:\"Enter account ID...\"},aspectRatio:{type:ControlType.Enum,title:\"Aspect Ratio\",options:[\"16/9\",\"4/3\",\"1/1\",\"21/9\"],optionTitles:[\"16:9 (Widescreen)\",\"4:3 (Standard)\",\"1:1 (Square)\",\"21:9 (Ultrawide)\"],defaultValue:\"16/9\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayer_5.map"],"mappings":"kTAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,2BAA2B,YAAU,uCAAuC,cAAY,OAAO,kBAAgB,UAAU,eAAa,GAAG,EAAY,EAAWA,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OACxO,GAAG,CAA3D,SAAS,cAAc,gCAAgC,CAAoB,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,IAAI,iEAAiE,EAAO,MAAM,GAAK,SAAS,KAAK,YAAY,EAAO,CAC9Q,IAAM,EAAO,EAAU,QAAQ,GAAG,GAAQ,EAAO,MAAM,cAAc,CAAC,IAAM,EAAQ,kCAAkC,EAAU,WAAW,EAAS,gBAAsB,EAAO,EAAO,SAAS,QAAQ,IAAU,EAAW,mBAAmB,EAAO,SAAS,KAAK,CAAC,EAAO,IAAI,GAAG,IAAU,EAAO,MAAM,IAC5S,IAAM,MAA2B,CAAI,SAAS,mBAC9C,SAAS,KAAK,MAAM,SAAS,SAAS,SAAS,gBAAgB,MAAM,SAAS,SAC9E,SAAS,KAAK,MAAM,SAAS,QAAQ,SAAS,KAAK,MAAM,MAAM,OAAO,SAAS,KAAK,MAAM,OAAO,OAC9F,IAAQ,EAAO,MAAM,OAAO,YAC/B,SAAS,KAAK,MAAM,SAAS,GAAG,SAAS,gBAAgB,MAAM,SAAS,GAAG,SAAS,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