import{r as s,h as o}from"./p-d00c3523.js";let e=class{constructor(o){s(this,o),this.loading=!1}componentDidLoad(){this.initVideo(),this.stream()}initVideo(){this.mediaSource=new MediaSource,this.mediaSource.addEventListener("sourceopen",(()=>{console.log("open",this.mediaSource),this.videoSourceBuffer=this.mediaSource.addSourceBuffer('video/mp4; codecs="avc1.64001e"'),console.log("added source buffer"),console.log(this.mediaSource)})),this.mediaSourceUrl=URL.createObjectURL(this.mediaSource),this.videoEl.src=this.mediaSourceUrl,console.log(this.videoEl)}onCanPlay(){this.loading=!1}stream(){console.log("streaming"),fetch(this.src).then((s=>s.arrayBuffer())).then((s=>{console.log(this.videoSourceBuffer),console.log(s),this.videoSourceBuffer.appendBuffer(s),console.log(this.videoSourceBuffer)}))}render(){return this.loading?null:o("video",{controls:!0,onCanPlay:()=>this.onCanPlay(),ref:s=>{this.videoEl=s,console.log(this.videoEl)}},"Video playback is not supported by your browser.")}};e.style="akord-video-stream-viewer{}";export{e as akord_video_stream_viewer}