import{r as p,j as l}from"./index-D2K-duz6.js";const y="No need to be discrete";function _({props:m,paused:c,onMediaLoadingChange:t}){const u=m,S=String(u.title??"").trim()||y,s=String(u.videoSrc??"").trim(),x=String(u.posterSrc??"").trim(),f=p.useRef(null);return p.useEffect(()=>{const r=f.current;if(!r)return;if(c){r.pause();return}const v=r.play();v&&typeof v.catch=="function"&&v.catch(()=>{})},[c,s]),p.useEffect(()=>{if(!s){t==null||t(!1);return}return t==null||t(!0),()=>{t==null||t(!1);const r=f.current;r&&(r.pause(),r.currentTime=0)}},[t,s]),l.jsxs("article",{className:`fullscreen-video-title ${c?"fullscreen-video-title--paused":""}`,children:[l.jsx("video",{ref:f,className:"fullscreen-video-title__media",src:s,poster:x||void 0,autoPlay:!0,playsInline:!0,preload:"metadata",controls:!1,onLoadedData:()=>t==null?void 0:t(!1),onCanPlay:()=>t==null?void 0:t(!1),onPlaying:()=>t==null?void 0:t(!1),onLoadStart:()=>t==null?void 0:t(!0),onWaiting:()=>t==null?void 0:t(!0),onStalled:()=>t==null?void 0:t(!0),onSuspend:()=>t==null?void 0:t(!1),onEnded:()=>t==null?void 0:t(!1),onError:()=>t==null?void 0:t(!1)}),l.jsx("div",{className:"fullscreen-video-title__overlay",children:l.jsx("h2",{className:"fullscreen-video-title__title",children:S})})]})}export{_ as default};
