1import{m as p}from"./CnaZMriG.js";import{_ as y}from"./DlAUqK2U.js";import{o as s,c as a,F as u,h,y as m,i as f}from"./L40OcWrG.js";const g={name:"VideoPlayerHtml5",props:{data:Object,width:{type:String,default:""},height:{type:String,default:""},muted:{type:Boolean,default:!1},srcParameters:{type:[String,Object],default:null}},emits:["emits"],data(){return{allowLoad:!(typeof this.$attrs.autoplay>"u"),initialMutedValue:this.muted}},computed:{sources(){return(this.data?.details?.files||[]).map(e=>{const n=new URL(e.url,"https://example.com"),o=n.hash?.length?n.hash:"t=0.01";return{src:`${p(e.url,this.srcParameters)}#${o}`,type:e.type,width:e.width,height:e.height}})},computedWidth(){return this.width||this.data?.details?.width||"100%"},computedHeight(){return this.height||this.data?.details?.height||"100%"},showElement(){return this.sources.length&&this.allowLoad},oncanplay(){return[this.initialMutedValue&&"this.muted = true;",this.$attrs.autoplay&&"this.play();"].filter(Boolean).join(" ")||""}},watch:{showElement(){this.initialMutedValue=this.muted}},beforeMount(){window.requestAnimationFrame(()=>{this.allowLoad=!0})},beforeUnmount(){if(this.$refs.video)try{this.$refs.video.pause(),this.$refs.video.removeAttribute("src"),this.$refs.video.load(),this.$refs.video.querySelectorAll("source").forEach(e=>e.remove())}catch(r){console.warn("Error during HTML5 video cleanup:",r)}},methods:{play(){this.$refs.video?this.$refs.video.play?.():(this.allowLoad=!0,this.$nextTick(()=>{this.$refs.video?.play?.()}))},pause(){this.$refs.video?this.$refs.video.pause?.():this.$nextTick(()=>{this.$refs.video?.pause?.()})},stop(){this.$refs.video?(this.$refs.video.pause(),this.$refs.video.currentTime=0):this.$nextTick(()=>{this.$refs.video&&(this.$refs.video.pause(),this.$refs.video.currentTime=0)})},emit(...r){this.$emit("emits",r)}}},v=["width","height","oncanplay"],w=["src","type"],c=["width","height","oncanplay"],P=["src","type"];function k(r,e,n,o,d,i){return d.initialMutedValue&&i.showElement?(s(),a("video",m({key:0,ref:"video"},r.$attrs,{width:i.computedWidth,height:i.computedHeight,oncanplay:i.oncanplay,onCanplay:e[0]||(e[0]=t=>i.emit(t,"canplay")),onCanplaythrough:e[1]||(e[1]=t=>i.emit(t,"canplaythrough")),onComplete:e[2]||(e[2]=t=>i.emit(t,"complete")),onEnded:e[3]||(e[3]=t=>i.emit(t,"ended")),onPause:e[4]||(e[4]=t=>i.emit(t,"pause")),onPlay:e[5]||(e[5]=t=>i.emit(t,"play")),onWaiting:e[6]||(e[6]=t=>i.emit(t,"waiting"))}),[(s(!0),a(u,null,h(i.sources,(t,l)=>(s(),a("source",{key:l,src:t.src,type:t.type},null,8,w))),128))],16,v)):!d.initialMutedValue&&i.showElement?(s(),a("video",m({key:1,ref:"video"},r.$attrs,{width:i.computedWidth,height:i.computedHeight,oncanplay:i.oncanplay,onCanplay:e[7]||(e[7]=t=>i.emit(t,"canplay")),onCanplaythrough:e[8]||(e[8]=t=>i.emit(t,"canplaythrough")),onComplete:e[9]||(e[9]=t=>i.emit(t,"complete")),onEnded:e[10]||(e[10]=t=>i.emit(t,"ended")),onPause:e[11]||(e[11]=t=>i.emit(t,"pause")),onPlay:e[12]||(e[12]=t=>i.emit(t,"play")),onWaiting:e[13]||(e[13]=t=>i.emit(t,"waiting"))}),[(s(!0),a(u,null,h(i.sources,(t,l)=>(s(),a("source",{key:l,src:t.src,type:t.type},null,8,P))),128))],16,c)):f("",!0)}const H=Object.assign(y(g,[["render",k]]),{__name:"VideoPlayerHtml5"});export{H 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.