@ktt45678/vidstack
Version:
UI component library for building high-quality, accessible video and audio experiences on the web.
2 lines (1 loc) • 995 B
JavaScript
import{s as r,l as i,e as a,p as n,i as o}from"./vidstack-B1PqmCkk.js";import{a as c}from"./vidstack-Ds9fx5AB.js";class h{constructor(t){this.Lb=t,this.sc=r(""),this.referrerPolicy=null,t.setAttribute("frameBorder","0"),t.setAttribute("aria-hidden","true"),t.setAttribute("allow","autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"),this.referrerPolicy!==null&&t.setAttribute("referrerpolicy",this.referrerPolicy)}get iframe(){return this.Lb}setup(){i(window,"message",this.Xi.bind(this)),i(this.Lb,"load",this.gd.bind(this)),a(this.Mb.bind(this))}Mb(){const t=this.sc();if(!t.length){this.Lb.setAttribute("src","");return}const e=n(()=>this.mg());this.Lb.setAttribute("src",c(t,e))}se(t,e){this.Lb.contentWindow?.postMessage(JSON.stringify(t),e??"*")}Xi(t){const e=this.Nb();if((t.source===null||t.source===this.Lb?.contentWindow)&&(!o(e)||e===t.origin)){try{const s=JSON.parse(t.data);s&&this.te(s,t);return}catch{}t.data&&this.te(t.data,t)}}}export{h as E};