{"version":3,"file":"VideoPlayer.BFSPoSWs.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/Zk20haw3MsEOV0U8hP9d/j5yIddMjYI25zP1e7Frm/VideoPlayer.js"],"sourcesContent":["// Video player with play button overlay, thumbnail support, and mobile-specific thumbnail\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 with thumbnail and mobile support\n *\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 360\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoPlayer(props){const{useVideoUrl=false,videoUrl=\"\",videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",thumbnail={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video thumbnail\"},playButtonSize=80,playButtonBackground=\"#000000\",playButtonColor=\"#FFFFFF\",borderRadius=8}=props;const[isPlaying,setIsPlaying]=useState(false);const[isMobileOrTablet,setIsMobileOrTablet]=useState(false);const videoRef=useRef(null);useEffect(()=>{if(typeof window!==\"undefined\"){const checkDevice=()=>{const width=window.innerWidth;// Mobile and tablet breakpoint (typically <= 1024px)\nsetIsMobileOrTablet(width<=1024);};checkDevice();window.addEventListener(\"resize\",checkDevice);return()=>window.removeEventListener(\"resize\",checkDevice);}},[]);const handlePlay=async()=>{if(videoRef.current){await videoRef.current.play();startTransition(()=>{setIsPlaying(true);});// Request fullscreen on mobile/tablet\nif(isMobileOrTablet){try{if(videoRef.current.requestFullscreen){await videoRef.current.requestFullscreen();}else if(videoRef.current.webkitEnterFullscreen){videoRef.current.webkitEnterFullscreen();}else if(videoRef.current.webkitRequestFullscreen){await videoRef.current.webkitRequestFullscreen();}else if(videoRef.current.mozRequestFullScreen){await videoRef.current.mozRequestFullScreen();}else if(videoRef.current.msRequestFullscreen){await videoRef.current.msRequestFullscreen();}}catch(err){console.log(\"Fullscreen request failed:\",err);}}}};const handlePause=()=>{startTransition(()=>{setIsPlaying(false);});};const handleEnded=()=>{startTransition(()=>{setIsPlaying(false);});};const handleUserPause=()=>{// Only set to not playing if the video is actually paused by user\nif(videoRef.current&&videoRef.current.paused&&!videoRef.current.seeking){startTransition(()=>{setIsPlaying(false);});}};useEffect(()=>{const video=videoRef.current;if(!video)return;const handleFullscreenChange=()=>{const isFullscreen=!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement);// If we exit fullscreen on mobile/tablet, pause the video\nif(!isFullscreen&&isMobileOrTablet){video.pause();}};const handleOrientationChange=()=>{// Ensure video adapts to orientation changes when in fullscreen\nif(isMobileOrTablet&&isPlaying){// Force a re-render of the video element\nif(video){video.style.width=\"100%\";video.style.height=\"100%\";}}};document.addEventListener(\"fullscreenchange\",handleFullscreenChange);document.addEventListener(\"webkitfullscreenchange\",handleFullscreenChange);document.addEventListener(\"mozfullscreenchange\",handleFullscreenChange);document.addEventListener(\"MSFullscreenChange\",handleFullscreenChange);window.addEventListener(\"orientationchange\",handleOrientationChange);window.addEventListener(\"resize\",handleOrientationChange);return()=>{document.removeEventListener(\"fullscreenchange\",handleFullscreenChange);document.removeEventListener(\"webkitfullscreenchange\",handleFullscreenChange);document.removeEventListener(\"mozfullscreenchange\",handleFullscreenChange);document.removeEventListener(\"MSFullscreenChange\",handleFullscreenChange);window.removeEventListener(\"orientationchange\",handleOrientationChange);window.removeEventListener(\"resize\",handleOrientationChange);};},[isMobileOrTablet,isPlaying]);const videoSource=useVideoUrl?videoUrl:videoFile;// Don't render if no valid video source\nif(!videoSource||videoSource.trim()===\"\"){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius,overflow:\"hidden\",backgroundColor:\"#f0f0f0\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#666\",fontSize:14,textAlign:\"center\",padding:20},children:\"Please provide a video URL or upload a video file\"});}return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius,overflow:\"hidden\",backgroundColor:\"#000000\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoSource,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",position:\"absolute\",top:0,left:0,zIndex:isPlaying?3:0},onPause:handleUserPause,onEnded:handleEnded,controls:isPlaying,playsInline:true,preload:\"metadata\",poster:thumbnail.src}),!isPlaying&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:thumbnail.src,alt:thumbnail.alt,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"rgba(0, 0, 0, 0.3)\",zIndex:1}}),/*#__PURE__*/_jsx(\"button\",{onClick:handlePlay,style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",width:playButtonSize,height:playButtonSize,borderRadius:\"50%\",backgroundColor:playButtonBackground,border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.2s ease\",zIndex:2},onMouseEnter:e=>{e.currentTarget.style.transform=\"translate(-50%, -50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"translate(-50%, -50%) scale(1)\";},\"aria-label\":\"Play video\",children:/*#__PURE__*/_jsx(\"svg\",{width:playButtonSize*.4,height:playButtonSize*.4,viewBox:\"0 0 24 24\",fill:playButtonColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})})})]})]});}addPropertyControls(VideoPlayer,{useVideoUrl:{type:ControlType.Boolean,title:\"Video Source\",defaultValue:false,enabledTitle:\"URL\",disabledTitle:\"Upload\"},videoUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\",placeholder:\"https://example.com/video.mp4\",hidden:({useVideoUrl})=>!useVideoUrl},videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"],hidden:({useVideoUrl})=>useVideoUrl},thumbnail:{type:ControlType.ResponsiveImage,title:\"Thumbnail\"},playButtonSize:{type:ControlType.Number,title:\"Button Size\",defaultValue:80,min:40,max:150,step:5,unit:\"px\"},playButtonBackground:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#000000\"},playButtonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"360\",\"framerIntrinsicWidth\":\"640\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayer.map"],"mappings":"2NASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,cAAY,GAAM,WAAS,GAAG,YAAU,uEAAuE,YAAU,CAAC,IAAI,sEAAsE,IAAI,kBAAkB,CAAC,iBAAe,GAAG,uBAAqB,UAAU,kBAAgB,UAAU,eAAa,GAAG,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAiB,GAAqBA,EAAS,GAAM,CAAO,EAASC,EAAO,KAAK,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,MAAgB,CAAC,IAAM,EAAM,EAAO,WAC/kB,EAAoB,GAAO,KAAK,EAA+D,OAA5D,GAAa,CAAC,EAAO,iBAAiB,SAAS,EAAY,KAAW,EAAO,oBAAoB,SAAS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