1import{z as w,N as A,o as L,L as N,m as d,d as p,f as b,F as O,B as S,g as v,E as x,e as B,s as z,ag as D,i as H,T as R,l as m,ao as j,ap as C,aq as y}from"./5hkCUdGJ.js";import F from"./GdQ779iv.js";const $={class:"parts-videoFile relative h-full w-full overflow-hidden"},I=["controls","muted","loop"],M=["src","type"],U={key:0,class:"absolute inset-0 z-10 h-full w-full"},q={class:"pointer-events-none absolute inset-0 z-1"},W="metadata",J={__name:"VideoLocal",props:{video:{type:Object,default:()=>({})},poster:{type:Object,default:()=>({})},autoplay:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0}},emits:["activate","playing","pause","error"],setup(u,{expose:E,emit:P}){const o=u,s=P,l=w(null),n=w(o.autoplay);let i=null;const g=m(()=>o.video?.videoType===j.adaptive),f=m(()=>{const e=o.video?.adaptive?.video?.hls?.url;return e?y(e):""}),T=m(()=>{const e=[],t=o.video?.local?.webm?.url,r=o.video?.local?.mp4?.url;return t&&e.push({src:y(t),type:"video/webm"}),r&&e.push({src:y(r),type:"video/mp4"}),e}),V=()=>!!document.createElement("video").canPlayType("application/vnd.apple.mpegurl"),k=async()=>{const e=l.value;if(!(!e||!f.value)){if(V()){e.src=f.value;return}try{const{default:t}=await C(async()=>{const{default:r}=await import("./PqkoW0Po.js");return{default:r}},[],import.meta.url);if(!t.isSupported())return;i=new t({enableWorker:!0}),i.loadSource(f.value),i.attachMedia(e)}catch(t){s("error",t)}}},_=()=>{const e=l.value;e&&e.play().catch(()=>{e.muted=!0,e.play().catch(t=>s("error",t))})},c=()=>{n.value||(n.value=!0,s("activate")),_()},h=()=>{const e=l.value;n.value=!1,e&&(e.pause(),e.currentTime=0)};return A(()=>o.autoplay,e=>e?c():h()),L(()=>{g.value&&k(),o.autoplay&&c()}),N(()=>{i?.destroy(),i=null}),E({play:_,activate:c,deactivate:h,pause:()=>l.value?.pause(),el:l}),(e,t)=>{const r=F;return d(),p("div",$,[b("video",{ref_key:"videoRef",ref:l,class:x(["absolute inset-0 h-full w-full object-cover",{"pointer-events-none":!v(n)}]),controls:u.controls&&v(n),muted:u.muted,loop:u.loop,preload:W,playsinline:"",onPlaying:t[0]||(t[0]=a=>s("playing")),onPause:t[1]||(t[1]=a=>s("pause")),onError:t[2]||(t[2]=a=>s("error",a))},[(d(!0),p(O,null,S(v(T),a=>(d(),p("source",{key:a.src,src:a.src,type:a.type},null,8,M))),128))],42,I),B(R,{name:"fade"},{default:z(()=>[v(n)?H("",!0):(d(),p("div",U,[B(r,{poster:u.poster,onActivate:c},null,8,["poster"]),b("div",q,[D(e.$slots,"button",{activate:c})])]))]),_:3})])}}};export{J as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.