https://www.jamesperse.com/cdn/shop/t/1023/assets/-core-mux-media.js?v=79632821770036824231790012385
1import{B as f}from"./chunk-BaseElement-080wYmDA.js";import{t as _}from"./chunk-custom-element-BhZVzxrc.js";import{n as y}from"./chunk-property-tugrfeCs.js";import{r as c}from"./chunk-query-async-BsMZa7Mb.js";import"./chunk-lit-element-D1QXZDXi.js";import"./chunk-base-CShCMygk.js";var w=Object.defineProperty,x=Object.getOwnPropertyDescriptor,d=t=>{throw TypeError(t)},l=(t,e,a,n)=>{for(var r=n>1?void 0:n?x(e,a):e,o=t.length-1,h;o>=0;o--)(h=t[o])&&(r=(n?h(e,a,r):h(r))||r);return n&&r&&w(e,a,r),r},P=(t,e,a)=>e.has(t)||d("Cannot "+a),V=(t,e,a)=>e.has(t)?d("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),u=(t,e,a)=>(P(t,e,"access private method"),a),s,m,p,g;let i=class extends f{constructor(){super(),V(this,s),this.playing=!1,this.muted=!0,this._handlePlayState=this._handlePlayState.bind(this),this._handleVolumeToggle=this._handleVolumeToggle.bind(this)}async connectedCallback(){super.connectedCallback();const t=await this.playToggle;t==null||t.addEventListener("click",this._handlePlayState);const e=await this.volumeToggle;e==null||e.addEventListener("click",this._handleVolumeToggle),await this._attachHTMLVideoEvents()}async play(){this.playing||await u(this,s,g).call(this)}async pause(){this.playing&&await u(this,s,m).call(this)}async _handlePlayState(){this.playing?await this.pause():await this.play()}async _handleVolumeToggle(){const t=await this.getMuxVideo();t&&(t.muted=!t.muted,this.muted=t.muted)}getVideoPlayState(t){return(t==null?void 0:t.currentTime)>0&&!(t!=null&&t.paused)&&!(t!=null&&t.ended)&&(t==null?void 0:t.readyState)>2}async _attachHTMLVideoEvents(){const t=await this.getMuxVideo();t&&(this.playing=this.getVideoPlayState(t),this.muted=t.muted,t.addEventListener("pause",()=>{this.playing=!1}),t.addEventListener("play",()=>{this.playing=!0}),t.addEventListener("playing",()=>{this.playing=!0}))}async getMuxVideo(){var e;const t=await this.muxPlayer;if(!t)return console.warn("mux-player not found"),null;for(let a=0;a<10;a++){const n=(e=t.shadowRoot)==null?void 0:e.querySelector("mux-video");if(n)return n;await new Promise(r=>setTimeout(r,100))}return null}};s=new WeakSet;m=function(){return u(this,s,p).call(this,!1)};p=async function(t=!0){const e=await this.getMuxVideo();if(!e){console.warn("mux-video not found");return}try{t?(await e.play(),this.playing=!0):(e.pause(),this.playing=!1)}catch(a){console.error("Playback error",a)}};g=function(){return u(this,s,p).call(this,!0)};l([y({reflect:!0,attribute:"playing"})],i.prototype,"playing",2);l([y({reflect:!0,attribute:"muted"})],i.prototype,"muted",2);l([c("mux-player")],i.prototype,"muxPlayer",2);l([c("[play-toggle]")],i.prototype,"playToggle",2);l([c("[volume-toggle]")],i.prototype,"volumeToggle",2);i=l([_("mux-media")],i);
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.