import{_ as f}from"./NuxtImg.vue_vue_type_script_lang.73948608.js";import{b as m,E as d,x as h,o as t,f as r,u as o,c as v,j as n,F as _,r as b,l as k,L as w,M as g,h as I,v as S}from"./entry.5c8819da.js";/* empty css                                                                    */const V=e=>(w("data-v-34317701"),e=e(),g(),e),x={key:1,class:"absolute top-0 left-0 w-full h-full video"},B=["poster"],C=["src"],$=["src","type"],j=["autoplay","src"],E=V(()=>I("button",{class:"play"},null,-1)),N=[E],P=m({__name:"VideoPlayer",props:{poster:{type:String,default:""},src:{type:String,default:""},sources:{type:Array,default:()=>[]}},setup(e){const s=e,l=d(()=>{if(s.src&&s.src.includes("youtube.com/watch")){const a=s.src.match(/\?v=([^&]*)/);return{name:"youtube",src:`https://www.youtube-nocookie.com/embed/${a[1]}?autoplay=1`,poster:s.poster||`https://i3.ytimg.com/vi/${a[1]}/hqdefault.jpg`}}}),p=h(!1);if(!s.src&&!s.sources.length)throw new Error("VideoPlayer: you need to provide either `src` or `sources` props");const i=d(()=>{var a,u;return s.src||((u=(a=s.sources)==null?void 0:a[0])==null?void 0:u.src)||!1});return(a,u)=>{const y=f;return t(),r("div",{class:k(["relative inline-block my-4 overflow-hidden bg-black bg-opacity-25 rounded-lg video-player",{loaded:p.value}])},[(o(l)?o(l).poster:e.poster)?(t(),v(y,{key:0,"image-classes":"video absolute top-0 left-0 h-full w-full object-fit",src:o(l)?o(l).poster:e.poster},null,8,["src"])):n("",!0),p.value?(t(),r("div",x,[o(l)?o(l).name==="youtube"?(t(),r("iframe",{key:1,allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"true",autoplay:a.autoplay,class:"w-full h-full",src:o(l).src},null,8,j)):n("",!0):(t(),r("video",{key:0,poster:e.poster,controls:"",autoplay:""},[o(i)?(t(),r("source",{key:0,src:o(i)},null,8,C)):n("",!0),(t(!0),r(_,null,b(e.sources,c=>(t(),r("source",{key:c.src||c,src:c.src||c,type:c.type},null,8,$))),128))],8,B))])):n("",!0),p.value?n("",!0):(t(),r("div",{key:2,class:"absolute top-0 left-0 w-full h-full cursor-pointer overlay",onClick:u[0]||(u[0]=c=>p.value=!0)},N))],2)}}}),z=S(P,[["__scopeId","data-v-34317701"]]);export{z as default};
