import{o as a,c as l,b as c,w as m,f as w,T as E,a as v,n as f,_ as p}from"./index.js";const _={key:0,class:"video__preloader"},V=["loop","muted","volume","src"];function b(e,s,i,n,d,o){return a(),l("div",{class:f(["video iface-container",{video_mobile:o.isMobile}])},[c(E,{name:"fade"},{default:m(()=>[e.isShowPreloader?(a(),l("div",_)):w("",!0)]),_:1}),v("video",{ref:"video",autoplay:!1,playsinline:!0,loop:e.isLoop,muted:o.isMobile,volume:e.volume,src:e.source,onDurationchange:s[0]||(s[0]=(...t)=>o.setSize&&o.setSize(...t)),onEnded:s[1]||(s[1]=(...t)=>o.onEnded&&o.onEnded(...t)),onError:s[2]||(s[2]=(...t)=>o.onError&&o.onError(...t))},null,40,V)],2)}const g="https://dl6.webmfiles.org/big-buck-bunny_trailer.webm",y={props:["openParams"],data:()=>({noAdaptation:!0,source:g,volume:1,isLoop:!0,closeOnEnded:!1,isShowPreloader:!0}),computed:{isMobile(){return this.$root.isMobile}},created(){this.openParams&&(this.source="/videos/"+this.openParams[0],this.setVolume(this.openParams[1]),this.setCloseOnEnded(this.openParams[2]))},mounted(){window.setDrawLabelStatus(!1)},unmounted(){window.setDrawLabelStatus(!0)},methods:{setVolume(e){this.volume=e},setSize(){const e=this.$refs.video,s=window.innerHeight,i=window.innerWidth,n=e.videoHeight,d=e.videoWidth;let o=n,t=d;const u=i/t,h=s/o;if(o<s||t<i){const r=Math.max(u,h);o*=r,t*=r}e.style.height=`${o}px`,e.style.width=`${t}px`,this.isShowPreloader=!1,e.play()},setCloseOnEnded(e){e&&(this.closeOnEnded=!0,this.isLoop=!1)},onEnded(){this.sendVideoEndEvent()},onError(){this.$root.isIOS&&this.sendVideoEndEvent()},sendVideoEndEvent(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"Video_OnFinishPlaying"),window.closeInterface("Video")}}},C=p(y,[["render",b]]);export{C as default};
