{"version":3,"file":"VideoPlayer.BCPfvntZ.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/FueLCl7iyvDN6nQQdCx3/JXVIVPcsKHmUto0vyNrj/VideoPlayer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoPlayer({src,poster,playOnView=false,loop=false,controls=true}){const videoRef=useRef(null);const isStatic=RenderTarget.current()!==RenderTarget.preview&&RenderTarget.hasRestrictions();useEffect(()=>{if(!playOnView||isStatic)return;const node=videoRef.current;if(!node)return;const observer=new IntersectionObserver(entries=>{for(const entry of entries){if(entry.isIntersecting){node.play().catch(()=>{});observer.disconnect();}}},{threshold:.5});observer.observe(node);return()=>observer.disconnect();},[playOnView,isStatic]);return /*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,poster:poster||undefined,muted:playOnView?true:undefined,loop:loop,controls:controls,playsInline:true,preload:\"metadata\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}});}addPropertyControls(VideoPlayer,{src:{type:ControlType.String,title:\"Video URL\"},poster:{type:ControlType.String,title:\"Poster Image URL\",optional:true},playOnView:{type:ControlType.Boolean,title:\"Play On View\",description:\"Autoplays (muted) once the video scrolls into view\",defaultValue:false},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false},controls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayer.map"],"mappings":"mLA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