@mux/mux-player 3.6.2-canary.3 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs.js +1 -1
- package/dist/base.mjs +1 -1
- package/dist/mux-player.js +2 -2
- package/dist/mux-player.mjs +2 -2
- package/package.json +3 -3
package/dist/base.cjs.js
CHANGED
|
@@ -1271,7 +1271,7 @@
|
|
|
1271
1271
|
|
|
1272
1272
|
</slot>
|
|
1273
1273
|
</div>
|
|
1274
|
-
`}var an=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},bc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},mr=class extends Ke{constructor(){super(),te(this,Zi),te(this,al),te(this,sn),te(this,ln),te(this,dn),te(this,el),te(this,cr),te(this,tl),te(this,Gi,void 0),te(this,ii,void 0),te(this,on,void 0),te(this,lr,void 0),te(this,nn,void 0),te(this,rn,void 0),te(this,dr,void 0),te(this,ur,void 0),te(this,Yi,void 0),te(this,qi,void 0),te(this,js,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),J(this,qi)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),we(this,on,this.shadowRoot.querySelectorAll('[part~="box"]')),we(this,nn,this.shadowRoot.querySelector('[part~="preview-box"]')),we(this,rn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);we(this,dr,parseInt(i.getPropertyValue("--media-box-padding-left"))),we(this,ur,parseInt(i.getPropertyValue("--media-box-padding-right"))),we(this,ii,new tn(this.range,J(this,js),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,Zi,sr).call(this),we(this,Gi,this.getRootNode()),(e=J(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Zi,sr).call(this),(e=J(this,Gi))==null||e.removeEventListener("transitionstart",this),we(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,ii).update({start:an(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Zi,sr).call(this),rf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,Yi),this.updateBar()))}get mediaChaptersCues(){return J(this,Yi)}set mediaChaptersCues(e){var i;we(this,Yi,e),this.updateSegments((i=J(this,Yi))==null?void 0:i.map(a=>({start:an(this,a.startTime),end:an(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=an(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,sn,rl).call(this,J(this,rn)),o=le(this,ln,ol).call(this,r,this.range.valueAsNumber),s=le(this,dn,nl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,tl,vc).call(this);break;case"pointermove":le(this,el,fc).call(this,e);break;case"pointerup":J(this,qi)&&we(this,qi,!1);break;case"pointerdown":we(this,qi,!0);break;case"pointerleave":le(this,cr,un).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,Zi,sr).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;on=new WeakMap;lr=new WeakMap;nn=new WeakMap;rn=new WeakMap;dr=new WeakMap;ur=new WeakMap;Yi=new WeakMap;qi=new WeakMap;Zi=new WeakSet;sr=function(){le(this,al,pc).call(this)?J(this,ii).start():J(this,ii).stop()};al=new WeakSet;pc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Jr(this)};js=new WeakMap;sn=new WeakSet;rl=function(t){var e;let a=((e=this.getAttribute("bounds")?$e(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};ln=new WeakSet;ol=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};dn=new WeakSet;nl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,dr)){let s=t.range.left-t.bounds.left-J(this,dr);return`${o-i/2+s}px`}if(o>r-J(this,ur)){let s=t.bounds.right-t.range.right-J(this,ur);return`${o+i/2-s-t.range.width}px`}return 0};el=new WeakSet;fc=function(t){let e=[...J(this,on)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,cr,un).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,sn,rl).call(this,J(this,nn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,ln,ol).call(this,o,s),u=le(this,dn,nl).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(J(this,lr))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(we(this,lr,s*i),le(this,cr,un).call(this,J(this,lr)))};cr=new WeakSet;un=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};tl=new WeakSet;vc=function(){J(this,ii).stop();let t=bc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};mr.shadowRootOptions={mode:"open"};mr.getTemplateHTML=of;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",mr);var nf=1,sf=t=>t.mediaMuted?0:t.mediaVolume,lf=t=>`${Math.round(t*100)}%`,sl=class extends Ke{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=sf(this),this.range.setAttribute("aria-valuetext",lf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,nf)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",sl);var E=require("@mux/mux-video/base"),w=require("@mux/playback-core");var yc=require("@mux/playback-core");var oi=require("@mux/playback-core");function Ec(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${cn(i)}: ${a}; `)}),e?e.trim():void 0}function cn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ll(t){let e=df(t).toString();return e?"?"+e:""}function df(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dl=(t,e)=>!t||!e?!1:t.contains(e)?!0:dl(t,e.getRootNode().host);var gc="mux.com",uf=()=>{try{return"3.6.1"}catch{}return"UNKNOWN"},cf=uf(),pn=()=>cf,_c=(t,{token:e,customDomain:i=gc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${ll({token:e,time:o,program_time:r})}`},Ac=(t,{token:e,customDomain:i=gc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${ll({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},hr=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var mf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Tc(t){var e;return(e=mf[t])!=null?e:mn(t)}var ai,ri,ce,hn=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);ye(this,ai,e),ye(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var kc=`[mux-player ${pn()}]`;function Xe(...t){console.warn(kc,...t)}function Ee(...t){console.error(kc,...t)}function ul(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,yc.i18n)("Read more: ")}
|
|
1274
|
+
`}var an=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},bc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},mr=class extends Ke{constructor(){super(),te(this,Zi),te(this,al),te(this,sn),te(this,ln),te(this,dn),te(this,el),te(this,cr),te(this,tl),te(this,Gi,void 0),te(this,ii,void 0),te(this,on,void 0),te(this,lr,void 0),te(this,nn,void 0),te(this,rn,void 0),te(this,dr,void 0),te(this,ur,void 0),te(this,Yi,void 0),te(this,qi,void 0),te(this,js,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),J(this,qi)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),we(this,on,this.shadowRoot.querySelectorAll('[part~="box"]')),we(this,nn,this.shadowRoot.querySelector('[part~="preview-box"]')),we(this,rn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);we(this,dr,parseInt(i.getPropertyValue("--media-box-padding-left"))),we(this,ur,parseInt(i.getPropertyValue("--media-box-padding-right"))),we(this,ii,new tn(this.range,J(this,js),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,Zi,sr).call(this),we(this,Gi,this.getRootNode()),(e=J(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Zi,sr).call(this),(e=J(this,Gi))==null||e.removeEventListener("transitionstart",this),we(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,ii).update({start:an(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Zi,sr).call(this),rf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,Yi),this.updateBar()))}get mediaChaptersCues(){return J(this,Yi)}set mediaChaptersCues(e){var i;we(this,Yi,e),this.updateSegments((i=J(this,Yi))==null?void 0:i.map(a=>({start:an(this,a.startTime),end:an(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=an(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,sn,rl).call(this,J(this,rn)),o=le(this,ln,ol).call(this,r,this.range.valueAsNumber),s=le(this,dn,nl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,tl,vc).call(this);break;case"pointermove":le(this,el,fc).call(this,e);break;case"pointerup":J(this,qi)&&we(this,qi,!1);break;case"pointerdown":we(this,qi,!0);break;case"pointerleave":le(this,cr,un).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,Zi,sr).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;on=new WeakMap;lr=new WeakMap;nn=new WeakMap;rn=new WeakMap;dr=new WeakMap;ur=new WeakMap;Yi=new WeakMap;qi=new WeakMap;Zi=new WeakSet;sr=function(){le(this,al,pc).call(this)?J(this,ii).start():J(this,ii).stop()};al=new WeakSet;pc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Jr(this)};js=new WeakMap;sn=new WeakSet;rl=function(t){var e;let a=((e=this.getAttribute("bounds")?$e(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};ln=new WeakSet;ol=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};dn=new WeakSet;nl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,dr)){let s=t.range.left-t.bounds.left-J(this,dr);return`${o-i/2+s}px`}if(o>r-J(this,ur)){let s=t.bounds.right-t.range.right-J(this,ur);return`${o+i/2-s-t.range.width}px`}return 0};el=new WeakSet;fc=function(t){let e=[...J(this,on)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,cr,un).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,sn,rl).call(this,J(this,nn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,ln,ol).call(this,o,s),u=le(this,dn,nl).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(J(this,lr))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(we(this,lr,s*i),le(this,cr,un).call(this,J(this,lr)))};cr=new WeakSet;un=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};tl=new WeakSet;vc=function(){J(this,ii).stop();let t=bc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};mr.shadowRootOptions={mode:"open"};mr.getTemplateHTML=of;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",mr);var nf=1,sf=t=>t.mediaMuted?0:t.mediaVolume,lf=t=>`${Math.round(t*100)}%`,sl=class extends Ke{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=sf(this),this.range.setAttribute("aria-valuetext",lf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,nf)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",sl);var E=require("@mux/mux-video/base"),w=require("@mux/playback-core");var yc=require("@mux/playback-core");var oi=require("@mux/playback-core");function Ec(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${cn(i)}: ${a}; `)}),e?e.trim():void 0}function cn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function mn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ll(t){let e=df(t).toString();return e?"?"+e:""}function df(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dl=(t,e)=>!t||!e?!1:t.contains(e)?!0:dl(t,e.getRootNode().host);var gc="mux.com",uf=()=>{try{return"3.7.0"}catch{}return"UNKNOWN"},cf=uf(),pn=()=>cf,_c=(t,{token:e,customDomain:i=gc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${ll({token:e,time:o,program_time:r})}`},Ac=(t,{token:e,customDomain:i=gc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${ll({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},hr=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var mf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Tc(t){var e;return(e=mf[t])!=null?e:mn(t)}var ai,ri,ce,hn=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);ye(this,ai,e),ye(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var kc=`[mux-player ${pn()}]`;function Xe(...t){console.warn(kc,...t)}function Ee(...t){console.error(kc,...t)}function ul(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,yc.i18n)("Read more: ")}
|
|
1275
1275
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Xe(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},wt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},e_={...se,...wt},Ic=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),hf=Object.values(se).filter(t=>se.PLAYSINLINE!==t),pf=Object.values(wt),ff=[...hf,...pf],cl=class extends ke.HTMLElement{static get observedAttributes(){return ff}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case wt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case wt.VOLUME:{let s=(r=ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case wt.PLAYBACKRATE:{let s=(o=ue(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Ic}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Ic}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ue(this.getAttribute(wt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(wt.PLAYBACKRATE,`${e}`):this.removeAttribute(wt.PLAYBACKRATE)}get crossOrigin(){return pr(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return pr(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return pr(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return pr(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return pr(this,se.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function pr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ml=cl;var Rc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},D=(t,e,i)=>(Rc(t,e,"read from private field"),i?i.call(t):e.get(t)),Je=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ht=(t,e,i,a)=>(Rc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zi,fn,ni,fr,Rt,xt,Dt,si,Qi,vn,Ue,Mc=1,Cc=0,vf=1,bf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof me&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof me?r.element[r.attributeName]=o:r.value=o}}}},pt=class extends d.DocumentFragment{constructor(e,i,a=bf){var r;super(),Je(this,zi,void 0),Je(this,fn,void 0),this.append(e.content.cloneNode(!0)),ht(this,zi,xc(this)),ht(this,fn,a),(r=a.createCallback)==null||r.call(a,this,D(this,zi),i),a.processCallback(this,D(this,zi),i)}update(e){D(this,fn).processCallback(this,D(this,zi),e)}};zi=new WeakMap;fn=new WeakMap;var xc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new hl;for([i,a]of wc(r.value))if(!i)o.append(a);else{let s=new me(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===Mc&&!(r instanceof HTMLTemplateElement))xc(r,e);else{let o=r.data;if(r.nodeType===Mc||o.includes("{{")){let s=[];if(o)for([i,a]of wc(o))if(!i)s.push(new Text(a));else{let l=new ft(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new vr(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Lc={},wc=t=>{let e="",i=0,a=Lc[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Cc,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([vf,e.trim()]),e="",r++):e+=o||"";return e&&a.push([Cc,(i>0?"{{":"")+e]),Lc[t]=a},Ef=11,bn=class{get value(){return""}set value(e){}toString(){return this.value}},Dc=new WeakMap,hl=class{constructor(){Je(this,ni,[])}[Symbol.iterator](){return D(this,ni).values()}get length(){return D(this,ni).length}item(e){return D(this,ni)[e]}append(...e){for(let i of e)i instanceof me&&Dc.set(i,this),D(this,ni).push(i)}toString(){return D(this,ni).join("")}};ni=new WeakMap;var me=class extends bn{constructor(e,i,a){super(),Je(this,si),Je(this,fr,""),Je(this,Rt,void 0),Je(this,xt,void 0),Je(this,Dt,void 0),ht(this,Rt,e),ht(this,xt,i),ht(this,Dt,a)}get attributeName(){return D(this,xt)}get attributeNamespace(){return D(this,Dt)}get element(){return D(this,Rt)}get value(){return D(this,fr)}set value(e){D(this,fr)!==e&&(ht(this,fr,e),!D(this,si,Qi)||D(this,si,Qi).length===1?e==null?D(this,Rt).removeAttributeNS(D(this,Dt),D(this,xt)):D(this,Rt).setAttributeNS(D(this,Dt),D(this,xt),e):D(this,Rt).setAttributeNS(D(this,Dt),D(this,xt),D(this,si,Qi).toString()))}get booleanValue(){return D(this,Rt).hasAttributeNS(D(this,Dt),D(this,xt))}set booleanValue(e){if(!D(this,si,Qi)||D(this,si,Qi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};fr=new WeakMap;Rt=new WeakMap;xt=new WeakMap;Dt=new WeakMap;si=new WeakSet;Qi=function(){return Dc.get(this)};var ft=class extends bn{constructor(e,i){super(),Je(this,vn,void 0),Je(this,Ue,void 0),ht(this,vn,e),ht(this,Ue,i?[...i]:[new Text])}get replacementNodes(){return D(this,Ue)}get parentNode(){return D(this,vn)}get nextSibling(){return D(this,Ue)[D(this,Ue).length-1].nextSibling}get previousSibling(){return D(this,Ue)[0].previousSibling}get value(){return D(this,Ue).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Ef?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ht(this,Ue,gf(D(this,Ue)[0].parentNode,D(this,Ue),i,this.nextSibling))}};vn=new WeakMap;Ue=new WeakMap;var vr=class extends ft{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function gf(t,e,i,a=null){let r=0,o,s,l,u=i.length,m=e.length;for(;r<u&&r<m&&e[r]==i[r];)r++;for(;r<u&&r<m&&i[u-1]==e[m-1];)a=i[--m,--u];if(r==m)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<m;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)l=i[r++],s=o?o.nextSibling:a,o==l?o=s:r<u&&i[r]==s?(t.replaceChild(l,o),o=s):t.insertBefore(l,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var Oc={string:t=>String(t)},gn=class{constructor(e){this.template=e,this.state=void 0}},li=new WeakMap,di=new WeakMap,pl={partial:(t,e)=>{e[t.expression]=new gn(t.template)},if:(t,e)=>{var i;if(Pc(t.expression,e))if(li.get(t)!==t.template){li.set(t,t.template);let a=new pt(t.template,e,_n);t.replace(a),di.set(t,a)}else(i=di.get(t))==null||i.update(e);else t.replace(""),li.delete(t),di.delete(t)}},_f=Object.keys(pl),_n={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof vr){if(!s.directive){let u=_f.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=pl[s.directive])==null||a.call(pl,s,i);continue}let l=Pc(o,i);if(l instanceof gn){li.get(s)!==l.template?(li.set(s,l.template),l=new pt(l.template,l.state,_n),s.value=l,di.set(s,l)):(r=di.get(s))==null||r.update(l.state);continue}l?(s instanceof me&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof me?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,li.delete(s),di.delete(s))):s instanceof me?s.value=void 0:(s.value=void 0,li.delete(s),di.delete(s))}}},Nc={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=Oc[e])==null?void 0:i.call(Oc,t)}};function Af(t){return Tf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Pc(t,e={}){var i,a,r,o,s,l,u;let m=Af(t);if(m.length===0||m.some(({type:_})=>!_))return br(t);if(((i=m[0])==null?void 0:i.token)===">"){let _=e[(a=m[1])==null?void 0:a.token];if(!_)return br(t);let g={...e};_.state=g;let f=m.slice(2);for(let v=0;v<f.length;v+=3){let N=(r=f[v])==null?void 0:r.token,T=(o=f[v+1])==null?void 0:o.token,C=(s=f[v+2])==null?void 0:s.token;N&&T==="="&&(g[N]=Er(C,e))}return _}if(m.length===1)return En(m[0])?Er(m[0].token,e):br(t);if(m.length===2){let _=(l=m[0])==null?void 0:l.token,g=Nc[_];if(!g||!En(m[1]))return br(t);let f=Er(m[1].token,e);return g(f)}if(m.length===3){let _=(u=m[1])==null?void 0:u.token,g=Nc[_];if(!g||!En(m[0])||!En(m[2]))return br(t);let f=Er(m[0].token,e);if(_==="|")return g(f,m[2].token);let v=Er(m[2].token,e);return g(f,v)}}function br(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function En({type:t}){return["number","boolean","string","param"].includes(t)}function Er(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):Kr(t)?parseFloat(t):e[t]}function Tf(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var _l=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bl=(t,e,i)=>(_l(t,e,"read from private field"),i?i.call(t):e.get(t)),gr=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ui=(t,e,i,a)=>(_l(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fl=(t,e,i)=>(_l(t,e,"access private method"),i),Xi,An,Ji,El,Uc,Tn,gl,vl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Hc=Y.createElement("template");Hc.innerHTML=`
|
|
1276
1276
|
<style>
|
|
1277
1277
|
:host {
|
package/dist/base.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Je=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||Je("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?Je("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},ge=class extends ${},Ut={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Vt(t,a){return new G}var et={document:{createElement:Vt},DocumentFragment,customElements:Ut,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},tt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=tt?et:globalThis,Y=tt?et.document:globalThis.document;import{MediaController as ha,MediaErrorDialog as St}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as kt,MediaUIAttributes as ce,MediaUIEvents as _t}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ga,removeTextTrack as fa,CmcdTypeValues as xt,i18n as V,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as ya}from"@mux/playback-core";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as it}from"@mux/playback-core";function at(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Bt(t).toString();return a?"?"+a:""}function Bt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var rt="mux.com",Ht=()=>{try{return"3.
|
|
1
|
+
var Je=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||Je("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?Je("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},ge=class extends ${},Ut={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Vt(t,a){return new G}var et={document:{createElement:Vt},DocumentFragment,customElements:Ut,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},tt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=tt?et:globalThis,Y=tt?et.document:globalThis.document;import{MediaController as ha,MediaErrorDialog as St}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as kt,MediaUIAttributes as ce,MediaUIEvents as _t}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ga,removeTextTrack as fa,CmcdTypeValues as xt,i18n as V,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as ya}from"@mux/playback-core";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as it}from"@mux/playback-core";function at(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Bt(t).toString();return a?"?"+a:""}function Bt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var rt="mux.com",Ht=()=>{try{return"3.7.0"}catch{}return"UNKNOWN"},Kt=Ht(),se=()=>Kt,ot=(t,{token:a,customDomain:e=rt,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=it(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},nt=(t,{token:a,customDomain:e=rt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=it(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([Te.LIVE,Te.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Te.LIVE}};var $t={crossorigin:"crossOrigin",playsinline:"playsInline"};function st(t){var a;return(a=$t[t])!=null?a:oe(t)}var P,D,v,ne=class{constructor(a,e){T(this,P);T(this,D);T(this,v,[]);C(this,P,a),C(this,D,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,D)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,D)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,D)}`,`${this.value}`)}contains(a){return u(this,v).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};P=new WeakMap,D=new WeakMap,v=new WeakMap;var dt=`[mux-player ${se()}]`;function R(...t){console.warn(dt,...t)}function E(...t){console.error(dt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Yt("Read more: ")}
|
|
2
2
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),R(a)}var g={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},N={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ha={...g,...N},ut=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Ft=Object.values(g).filter(t=>g.PLAYSINLINE!==t),Wt=Object.values(N),Zt=[...Ft,...Wt],Ae=class extends k.HTMLElement{static get observedAttributes(){return Zt}constructor(){super()}attributeChangedCallback(a,e,i){var r,n;switch(a){case N.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case N.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case N.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:ut}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:ut}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(N.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(N.PLAYBACKRATE,`${a}`):this.removeAttribute(N.PLAYBACKRATE)}get crossOrigin(){return X(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return X(this,g.LOOP)!=null}set loop(a){a?this.setAttribute(g.LOOP,""):this.removeAttribute(g.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return X(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return X(this,g.PLAYSINLINE)!=null}set playsInline(a){E("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(g.PRELOAD,a):this.removeAttribute(g.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var mt=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.js
CHANGED
|
@@ -106,7 +106,7 @@ Schedule: ${l.map(m=>Nr(m))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${MT(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function wT(i,{tag:e,is:t}){var n,a,o,l,d,RT,c,h,f,m,p,Os,Ap,kT,Sp,DT,CT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?RD(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var L,I,C;return Fe(L=o,d,RT).call(L),[...(C=(I=r==null?void 0:r.constructor)==null?void 0:I.observedAttributes)!=null?C:[],...LT]}get nativeEl(){var A,L,I,C,P;return Fe(this,p,Os).call(this),(P=(C=(L=(A=D(this,h))!=null?A:this.querySelector(":scope > [slot=media]"))!=null?L:this.querySelector(e))!=null?C:(I=this.shadowRoot)==null?void 0:I.querySelector(e))!=null?P:null}set nativeEl(A){ie(this,h,A)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(A){this.toggleAttribute("muted",A)}get src(){return this.getAttribute("src")}set src(A){this.setAttribute("src",`${A}`)}get preload(){var A,L;return(L=this.getAttribute("preload"))!=null?L:(A=this.nativeEl)==null?void 0:A.preload}set preload(A){this.setAttribute("preload",`${A}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let A=kD(this.attributes);t&&(A.is=t),e&&(A.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(A)}this.nativeEl.muted=this.hasAttribute("muted");for(let A of s)Fe(this,p,DT).call(this,A);ie(this,m,new MutationObserver(Fe(this,p,kT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Fe(this,p,Ap).call(this)),Fe(this,p,Ap).call(this);for(let A of this.constructor.Events)this.shadowRoot.addEventListener(A,this,!0)}handleEvent(A){A.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))}attributeChangedCallback(A,L,I){Fe(this,p,Os).call(this),Fe(this,p,CT).call(this,A,L,I)}connectedCallback(){Fe(this,p,Os).call(this)}},l=new WeakMap,d=new WeakSet,RT=function(){if(D(this,l))return;ie(this,l,!0);let A=new Set(this.observedAttributes);A.delete("muted");for(let L of s)if(!(L in this.prototype))if(typeof r[L]=="function")this.prototype[L]=function(...I){return Fe(this,p,Os).call(this),(()=>{var B;if(this.call)return this.call(L,...I);let P=(B=this.nativeEl)==null?void 0:B[L];return P==null?void 0:P.apply(this.nativeEl,I)})()};else{let I={get(){var P,B,W;Fe(this,p,Os).call(this);let C=L.toLowerCase();if(A.has(C)){let V=this.getAttribute(C);return V===null?!1:V===""?!0:V}return(W=(P=this.get)==null?void 0:P.call(this,L))!=null?W:(B=this.nativeEl)==null?void 0:B[L]}};L!==L.toUpperCase()&&(I.set=function(C){Fe(this,p,Os).call(this);let P=L.toLowerCase();if(A.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(L,C);return}this.nativeEl&&(this.nativeEl[L]=C)}),Object.defineProperty(this.prototype,L,I)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Os=function(){D(this,c)||(ie(this,c,!0),this.init())},Ap=function(){var C;let A=new Map(D(this,f)),L=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(L==null?void 0:L.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var W,V;A.delete(P);let B=D(this,f).get(P);B||(B=P.cloneNode(),D(this,f).set(P,B),(W=D(this,m))==null||W.observe(P,{attributes:!0})),(V=this.nativeEl)==null||V.append(B),Fe(this,p,Sp).call(this,B)}),A.forEach((P,B)=>{P.remove(),D(this,f).delete(B)})},kT=function(A){var L;for(let I of A)if(I.type==="attributes"){let{target:C,attributeName:P}=I,B=D(this,f).get(C);B&&P&&(B.setAttribute(P,(L=C.getAttribute(P))!=null?L:""),Fe(this,p,Sp).call(this,B))}},Sp=function(A){A&&A.localName==="track"&&A.default&&(A.kind==="chapters"||A.kind==="metadata")&&A.track.mode==="disabled"&&(A.track.mode="hidden")},DT=function(A){if(Object.prototype.hasOwnProperty.call(this,A)){let L=this[A];delete this[A],this[A]=L}},CT=function(A,L,I){var C,P,B;["id","class"].includes(A)||!o.observedAttributes.includes(A)&&this.constructor.observedAttributes.includes(A)||(I===null?(C=this.nativeEl)==null||C.removeAttribute(A):((P=this.nativeEl)==null?void 0:P.getAttribute(A))!==I&&((B=this.nativeEl)==null||B.setAttribute(A,I)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?xD:LD),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",xT),ae(o,l,!1),o}function RD(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function MT(i){let e="";for(let t in i){if(!LT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kD(i){let e={};for(let t of i)e[t.name]=t.value;return e}var ST,xo=wT((ST=globalThis.HTMLElement)!=null?ST:class{},{tag:"video"}),IT,sO=wT((IT=globalThis.HTMLElement)!=null?IT:class{},{tag:"audio"});var NT=i=>{throw TypeError(i)},xp=(i,e,t)=>e.has(i)||NT("Cannot "+t),xt=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(i,e,t)=>e.has(i)?NT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ui=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ip=(i,e,t)=>(xp(i,e,"access private method"),t),DD=()=>{try{return"0.27.
|
|
109
|
+
`}function wT(i,{tag:e,is:t}){var n,a,o,l,d,RT,c,h,f,m,p,Os,Ap,kT,Sp,DT,CT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?RD(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var L,I,C;return Fe(L=o,d,RT).call(L),[...(C=(I=r==null?void 0:r.constructor)==null?void 0:I.observedAttributes)!=null?C:[],...LT]}get nativeEl(){var A,L,I,C,P;return Fe(this,p,Os).call(this),(P=(C=(L=(A=D(this,h))!=null?A:this.querySelector(":scope > [slot=media]"))!=null?L:this.querySelector(e))!=null?C:(I=this.shadowRoot)==null?void 0:I.querySelector(e))!=null?P:null}set nativeEl(A){ie(this,h,A)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(A){this.toggleAttribute("muted",A)}get src(){return this.getAttribute("src")}set src(A){this.setAttribute("src",`${A}`)}get preload(){var A,L;return(L=this.getAttribute("preload"))!=null?L:(A=this.nativeEl)==null?void 0:A.preload}set preload(A){this.setAttribute("preload",`${A}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let A=kD(this.attributes);t&&(A.is=t),e&&(A.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(A)}this.nativeEl.muted=this.hasAttribute("muted");for(let A of s)Fe(this,p,DT).call(this,A);ie(this,m,new MutationObserver(Fe(this,p,kT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Fe(this,p,Ap).call(this)),Fe(this,p,Ap).call(this);for(let A of this.constructor.Events)this.shadowRoot.addEventListener(A,this,!0)}handleEvent(A){A.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))}attributeChangedCallback(A,L,I){Fe(this,p,Os).call(this),Fe(this,p,CT).call(this,A,L,I)}connectedCallback(){Fe(this,p,Os).call(this)}},l=new WeakMap,d=new WeakSet,RT=function(){if(D(this,l))return;ie(this,l,!0);let A=new Set(this.observedAttributes);A.delete("muted");for(let L of s)if(!(L in this.prototype))if(typeof r[L]=="function")this.prototype[L]=function(...I){return Fe(this,p,Os).call(this),(()=>{var B;if(this.call)return this.call(L,...I);let P=(B=this.nativeEl)==null?void 0:B[L];return P==null?void 0:P.apply(this.nativeEl,I)})()};else{let I={get(){var P,B,W;Fe(this,p,Os).call(this);let C=L.toLowerCase();if(A.has(C)){let V=this.getAttribute(C);return V===null?!1:V===""?!0:V}return(W=(P=this.get)==null?void 0:P.call(this,L))!=null?W:(B=this.nativeEl)==null?void 0:B[L]}};L!==L.toUpperCase()&&(I.set=function(C){Fe(this,p,Os).call(this);let P=L.toLowerCase();if(A.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(L,C);return}this.nativeEl&&(this.nativeEl[L]=C)}),Object.defineProperty(this.prototype,L,I)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Os=function(){D(this,c)||(ie(this,c,!0),this.init())},Ap=function(){var C;let A=new Map(D(this,f)),L=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(L==null?void 0:L.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var W,V;A.delete(P);let B=D(this,f).get(P);B||(B=P.cloneNode(),D(this,f).set(P,B),(W=D(this,m))==null||W.observe(P,{attributes:!0})),(V=this.nativeEl)==null||V.append(B),Fe(this,p,Sp).call(this,B)}),A.forEach((P,B)=>{P.remove(),D(this,f).delete(B)})},kT=function(A){var L;for(let I of A)if(I.type==="attributes"){let{target:C,attributeName:P}=I,B=D(this,f).get(C);B&&P&&(B.setAttribute(P,(L=C.getAttribute(P))!=null?L:""),Fe(this,p,Sp).call(this,B))}},Sp=function(A){A&&A.localName==="track"&&A.default&&(A.kind==="chapters"||A.kind==="metadata")&&A.track.mode==="disabled"&&(A.track.mode="hidden")},DT=function(A){if(Object.prototype.hasOwnProperty.call(this,A)){let L=this[A];delete this[A],this[A]=L}},CT=function(A,L,I){var C,P,B;["id","class"].includes(A)||!o.observedAttributes.includes(A)&&this.constructor.observedAttributes.includes(A)||(I===null?(C=this.nativeEl)==null||C.removeAttribute(A):((P=this.nativeEl)==null?void 0:P.getAttribute(A))!==I&&((B=this.nativeEl)==null||B.setAttribute(A,I)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?xD:LD),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",xT),ae(o,l,!1),o}function RD(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function MT(i){let e="";for(let t in i){if(!LT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kD(i){let e={};for(let t of i)e[t.name]=t.value;return e}var ST,xo=wT((ST=globalThis.HTMLElement)!=null?ST:class{},{tag:"video"}),IT,sO=wT((IT=globalThis.HTMLElement)!=null?IT:class{},{tag:"audio"});var NT=i=>{throw TypeError(i)},xp=(i,e,t)=>e.has(i)||NT("Cannot "+t),xt=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(i,e,t)=>e.has(i)?NT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ui=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ip=(i,e,t)=>(xp(i,e,"access private method"),t),DD=()=>{try{return"0.27.1"}catch{}return"UNKNOWN"},CD=DD(),wD=()=>CD,MD=`
|
|
110
110
|
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" part="logo" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 1600 500"><g fill="#fff"><path d="M994.287 93.486c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m0-93.486c-34.509 0-62.484 27.976-62.484 62.486v187.511c0 68.943-56.09 125.033-125.032 125.033s-125.03-56.09-125.03-125.033V62.486C681.741 27.976 653.765 0 619.256 0s-62.484 27.976-62.484 62.486v187.511C556.772 387.85 668.921 500 806.771 500c137.851 0 250.001-112.15 250.001-250.003V62.486c0-34.51-27.976-62.486-62.485-62.486M1537.51 468.511c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m-275.883-218.509-143.33 143.329c-24.402 24.402-24.402 63.966 0 88.368 24.402 24.402 63.967 24.402 88.369 0l143.33-143.329 143.328 143.329c24.402 24.4 63.967 24.402 88.369 0 24.403-24.402 24.403-63.966.001-88.368l-143.33-143.329.001-.004 143.329-143.329c24.402-24.402 24.402-63.965 0-88.367s-63.967-24.402-88.369 0L1349.996 161.63 1206.667 18.302c-24.402-24.401-63.967-24.402-88.369 0s-24.402 63.965 0 88.367l143.329 143.329v.004ZM437.511 468.521c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31M461.426 4.759C438.078-4.913 411.2.432 393.33 18.303L249.999 161.632 106.669 18.303C88.798.432 61.922-4.913 38.573 4.759 15.224 14.43-.001 37.214-.001 62.488v375.026c0 34.51 27.977 62.486 62.487 62.486 34.51 0 62.486-27.976 62.486-62.486V213.341l80.843 80.844c24.404 24.402 63.965 24.402 88.369 0l80.843-80.844v224.173c0 34.51 27.976 62.486 62.486 62.486s62.486-27.976 62.486-62.486V62.488c0-25.274-15.224-48.058-38.573-57.729" style="fill-rule:nonzero"/></g></svg>`,M={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type",LOGO:"logo"},PD=Object.values(M),PT=wD(),OT="mux-video",Gi,Lo,cu,Ro,hu,fu,mu,pu,gu,ko,Do,vu,UT=class extends xo{constructor(){super(),Si(this,Do),Si(this,Gi),Si(this,Lo),Si(this,cu),Si(this,Ro,{}),Si(this,hu,{}),Si(this,fu),Si(this,mu),Si(this,pu),Si(this,gu),Si(this,ko,""),ui(this,cu,ou()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=fT(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(ui(this,ko,"default"),this.updateLogo())})}static get NAME(){return OT}static get VERSION(){return PT}static get observedAttributes(){var i;return[...PD,...(i=xo.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?MD:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${xo.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -1852,7 +1852,7 @@ Schedule: ${l.map(m=>Nr(m))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
1852
1852
|
}
|
|
1853
1853
|
</style>
|
|
1854
1854
|
<slot name="icon">${WM}</slot>
|
|
1855
|
-
`}function YM(){return $("Quality")}var $a=class extends Vt{static get observedAttributes(){return[...super.observedAttributes,_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",$("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Je(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return ce(this,_.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){he(this,_.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ve(this,_.MEDIA_HEIGHT)}set mediaHeight(e){xe(this,_.MEDIA_HEIGHT,e)}};$a.getSlotTemplateHTML=qM;$a.getTooltipContentHTML=YM;R.customElements.get("media-rendition-menu-button")||R.customElements.define("media-rendition-menu-button",$a);var tS=i=>{throw TypeError(i)},U0=(i,e,t)=>e.has(i)||tS("Cannot "+t),Ue=(i,e,t)=>(U0(i,e,"read from private field"),t?t.call(i):e.get(i)),wi=(i,e,t)=>e.has(i)?tS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),lr=(i,e,t,r)=>(U0(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(U0(i,e,"access private method"),t),Bh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Bh{}globalThis.DocumentFragment=i}var F0=class extends Bh{},jM=class extends Bh{},zM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(F0)}},Mh,QM=class{constructor(i,e={}){wi(this,Mh),lr(this,Mh,e==null?void 0:e.detail)}get detail(){return Ue(this,Mh)}initCustomEvent(){}};Mh=new WeakMap;function XM(i,e){return new F0}var iS={document:{createElement:XM},DocumentFragment,customElements:zM,CustomEvent:QM,EventTarget:Bh,HTMLElement:F0,HTMLVideoElement:jM},rS=typeof window=="undefined"||typeof globalThis.customElements=="undefined",or=rS?iS:globalThis,B0=rS?iS.document:globalThis.document;function ZM(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${M0(t)}: ${r}; `)}),e?e.trim():void 0}function M0(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function sS(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ri(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function nS(i){let e=JM(i).toString();return e?"?"+e:""}function JM(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var aS=(i,e)=>!i||!e?!1:i.contains(e)?!0:aS(i,e.getRootNode().host),oS="mux.com",eP=()=>{try{return"3.
|
|
1855
|
+
`}function YM(){return $("Quality")}var $a=class extends Vt{static get observedAttributes(){return[...super.observedAttributes,_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",$("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Je(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return ce(this,_.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){he(this,_.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ve(this,_.MEDIA_HEIGHT)}set mediaHeight(e){xe(this,_.MEDIA_HEIGHT,e)}};$a.getSlotTemplateHTML=qM;$a.getTooltipContentHTML=YM;R.customElements.get("media-rendition-menu-button")||R.customElements.define("media-rendition-menu-button",$a);var tS=i=>{throw TypeError(i)},U0=(i,e,t)=>e.has(i)||tS("Cannot "+t),Ue=(i,e,t)=>(U0(i,e,"read from private field"),t?t.call(i):e.get(i)),wi=(i,e,t)=>e.has(i)?tS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),lr=(i,e,t,r)=>(U0(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(U0(i,e,"access private method"),t),Bh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Bh{}globalThis.DocumentFragment=i}var F0=class extends Bh{},jM=class extends Bh{},zM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(F0)}},Mh,QM=class{constructor(i,e={}){wi(this,Mh),lr(this,Mh,e==null?void 0:e.detail)}get detail(){return Ue(this,Mh)}initCustomEvent(){}};Mh=new WeakMap;function XM(i,e){return new F0}var iS={document:{createElement:XM},DocumentFragment,customElements:zM,CustomEvent:QM,EventTarget:Bh,HTMLElement:F0,HTMLVideoElement:jM},rS=typeof window=="undefined"||typeof globalThis.customElements=="undefined",or=rS?iS:globalThis,B0=rS?iS.document:globalThis.document;function ZM(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${M0(t)}: ${r}; `)}),e?e.trim():void 0}function M0(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function sS(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ri(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function nS(i){let e=JM(i).toString();return e?"?"+e:""}function JM(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var aS=(i,e)=>!i||!e?!1:i.contains(e)?!0:aS(i,e.getRootNode().host),oS="mux.com",eP=()=>{try{return"3.7.0"}catch{}return"UNKNOWN"},tP=eP(),lS=()=>tP,iP=(i,{token:e,customDomain:t=oS,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Gr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${nS({token:e,time:a,program_time:s})}`},rP=(i,{token:e,customDomain:t=oS,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Gr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${nS({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},$0=i=>{if(i){if([ke.LIVE,ke.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ke.LIVE}},sP={crossorigin:"crossOrigin",playsinline:"playsInline"};function nP(i){var e;return(e=sP[i])!=null?e:sS(i)}var Ha,Ga,Wt,aP=class{constructor(i,e){wi(this,Ha),wi(this,Ga),wi(this,Wt,[]),lr(this,Ha,i),lr(this,Ga,e)}[Symbol.iterator](){return Ue(this,Wt).values()}get length(){return Ue(this,Wt).length}get value(){var i;return(i=Ue(this,Wt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(lr(this,Wt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return Ue(this,Wt)[i]}values(){return Ue(this,Wt).values()}keys(){return Ue(this,Wt).keys()}forEach(i){Ue(this,Wt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||Ue(this,Wt).push(r)}),!(this.value===""&&!((e=Ue(this,Ha))!=null&&e.hasAttribute(`${Ue(this,Ga)}`)))&&((t=Ue(this,Ha))==null||t.setAttribute(`${Ue(this,Ga)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{Ue(this,Wt).splice(Ue(this,Wt).indexOf(t),1)}),(e=Ue(this,Ha))==null||e.setAttribute(`${Ue(this,Ga)}`,`${this.value}`)}contains(i){return Ue(this,Wt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ha=new WeakMap,Ga=new WeakMap,Wt=new WeakMap;var dS=`[mux-player ${lS()}]`;function wr(...i){console.warn(dS,...i)}function pi(...i){console.error(dS,...i)}function uS(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${te("Read more: ")}
|
|
1856
1856
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),wr(t)}var Rt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},bs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},r5={...Rt,...bs},$A=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),oP=Object.values(Rt).filter(i=>Rt.PLAYSINLINE!==i),lP=Object.values(bs),dP=[...oP,...lP],uP=class extends or.HTMLElement{static get observedAttributes(){return dP}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case bs.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case bs.VOLUME:{let n=(r=ri(t))!=null?r:1;this.media&&(this.media.volume=n);return}case bs.PLAYBACKRATE:{let n=(s=ri(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:$A}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:$A}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentSrc(){var i,e;return(e=(i=this.media)==null?void 0:i.currentSrc)!=null?e:""}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=ri(this.getAttribute(bs.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(bs.PLAYBACKRATE,`${i}`):this.removeAttribute(bs.PLAYBACKRATE)}get crossOrigin(){return Hl(this,Rt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Rt.CROSSORIGIN,`${i}`)}get autoplay(){return Hl(this,Rt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Rt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Rt.AUTOPLAY)}get loop(){return Hl(this,Rt.LOOP)!=null}set loop(i){i?this.setAttribute(Rt.LOOP,""):this.removeAttribute(Rt.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=!!i)}get defaultMuted(){return Hl(this,Rt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Rt.MUTED,""):this.removeAttribute(Rt.MUTED)}get playsInline(){return Hl(this,Rt.PLAYSINLINE)!=null}set playsInline(i){pi("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute(Rt.PRELOAD,i):this.removeAttribute(Rt.PRELOAD)}};function Hl(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var HA=uP,cP=`:host {
|
|
1857
1857
|
--media-control-display: var(--controls);
|
|
1858
1858
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.mjs
CHANGED
|
@@ -106,7 +106,7 @@ Schedule: ${l.map(m=>Nr(m))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${MT(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function wT(i,{tag:e,is:t}){var n,a,o,l,d,RT,c,h,f,m,p,Os,Ap,kT,Sp,DT,CT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?RD(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var L,I,C;return Fe(L=o,d,RT).call(L),[...(C=(I=r==null?void 0:r.constructor)==null?void 0:I.observedAttributes)!=null?C:[],...LT]}get nativeEl(){var A,L,I,C,P;return Fe(this,p,Os).call(this),(P=(C=(L=(A=D(this,h))!=null?A:this.querySelector(":scope > [slot=media]"))!=null?L:this.querySelector(e))!=null?C:(I=this.shadowRoot)==null?void 0:I.querySelector(e))!=null?P:null}set nativeEl(A){ie(this,h,A)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(A){this.toggleAttribute("muted",A)}get src(){return this.getAttribute("src")}set src(A){this.setAttribute("src",`${A}`)}get preload(){var A,L;return(L=this.getAttribute("preload"))!=null?L:(A=this.nativeEl)==null?void 0:A.preload}set preload(A){this.setAttribute("preload",`${A}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let A=kD(this.attributes);t&&(A.is=t),e&&(A.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(A)}this.nativeEl.muted=this.hasAttribute("muted");for(let A of s)Fe(this,p,DT).call(this,A);ie(this,m,new MutationObserver(Fe(this,p,kT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Fe(this,p,Ap).call(this)),Fe(this,p,Ap).call(this);for(let A of this.constructor.Events)this.shadowRoot.addEventListener(A,this,!0)}handleEvent(A){A.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))}attributeChangedCallback(A,L,I){Fe(this,p,Os).call(this),Fe(this,p,CT).call(this,A,L,I)}connectedCallback(){Fe(this,p,Os).call(this)}},l=new WeakMap,d=new WeakSet,RT=function(){if(D(this,l))return;ie(this,l,!0);let A=new Set(this.observedAttributes);A.delete("muted");for(let L of s)if(!(L in this.prototype))if(typeof r[L]=="function")this.prototype[L]=function(...I){return Fe(this,p,Os).call(this),(()=>{var B;if(this.call)return this.call(L,...I);let P=(B=this.nativeEl)==null?void 0:B[L];return P==null?void 0:P.apply(this.nativeEl,I)})()};else{let I={get(){var P,B,W;Fe(this,p,Os).call(this);let C=L.toLowerCase();if(A.has(C)){let V=this.getAttribute(C);return V===null?!1:V===""?!0:V}return(W=(P=this.get)==null?void 0:P.call(this,L))!=null?W:(B=this.nativeEl)==null?void 0:B[L]}};L!==L.toUpperCase()&&(I.set=function(C){Fe(this,p,Os).call(this);let P=L.toLowerCase();if(A.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(L,C);return}this.nativeEl&&(this.nativeEl[L]=C)}),Object.defineProperty(this.prototype,L,I)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Os=function(){D(this,c)||(ie(this,c,!0),this.init())},Ap=function(){var C;let A=new Map(D(this,f)),L=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(L==null?void 0:L.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var W,V;A.delete(P);let B=D(this,f).get(P);B||(B=P.cloneNode(),D(this,f).set(P,B),(W=D(this,m))==null||W.observe(P,{attributes:!0})),(V=this.nativeEl)==null||V.append(B),Fe(this,p,Sp).call(this,B)}),A.forEach((P,B)=>{P.remove(),D(this,f).delete(B)})},kT=function(A){var L;for(let I of A)if(I.type==="attributes"){let{target:C,attributeName:P}=I,B=D(this,f).get(C);B&&P&&(B.setAttribute(P,(L=C.getAttribute(P))!=null?L:""),Fe(this,p,Sp).call(this,B))}},Sp=function(A){A&&A.localName==="track"&&A.default&&(A.kind==="chapters"||A.kind==="metadata")&&A.track.mode==="disabled"&&(A.track.mode="hidden")},DT=function(A){if(Object.prototype.hasOwnProperty.call(this,A)){let L=this[A];delete this[A],this[A]=L}},CT=function(A,L,I){var C,P,B;["id","class"].includes(A)||!o.observedAttributes.includes(A)&&this.constructor.observedAttributes.includes(A)||(I===null?(C=this.nativeEl)==null||C.removeAttribute(A):((P=this.nativeEl)==null?void 0:P.getAttribute(A))!==I&&((B=this.nativeEl)==null||B.setAttribute(A,I)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?xD:LD),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",xT),ae(o,l,!1),o}function RD(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function MT(i){let e="";for(let t in i){if(!LT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kD(i){let e={};for(let t of i)e[t.name]=t.value;return e}var ST,xo=wT((ST=globalThis.HTMLElement)!=null?ST:class{},{tag:"video"}),IT,sO=wT((IT=globalThis.HTMLElement)!=null?IT:class{},{tag:"audio"});var NT=i=>{throw TypeError(i)},xp=(i,e,t)=>e.has(i)||NT("Cannot "+t),xt=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(i,e,t)=>e.has(i)?NT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ui=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ip=(i,e,t)=>(xp(i,e,"access private method"),t),DD=()=>{try{return"0.27.
|
|
109
|
+
`}function wT(i,{tag:e,is:t}){var n,a,o,l,d,RT,c,h,f,m,p,Os,Ap,kT,Sp,DT,CT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?RD(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var L,I,C;return Fe(L=o,d,RT).call(L),[...(C=(I=r==null?void 0:r.constructor)==null?void 0:I.observedAttributes)!=null?C:[],...LT]}get nativeEl(){var A,L,I,C,P;return Fe(this,p,Os).call(this),(P=(C=(L=(A=D(this,h))!=null?A:this.querySelector(":scope > [slot=media]"))!=null?L:this.querySelector(e))!=null?C:(I=this.shadowRoot)==null?void 0:I.querySelector(e))!=null?P:null}set nativeEl(A){ie(this,h,A)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(A){this.toggleAttribute("muted",A)}get src(){return this.getAttribute("src")}set src(A){this.setAttribute("src",`${A}`)}get preload(){var A,L;return(L=this.getAttribute("preload"))!=null?L:(A=this.nativeEl)==null?void 0:A.preload}set preload(A){this.setAttribute("preload",`${A}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let A=kD(this.attributes);t&&(A.is=t),e&&(A.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(A)}this.nativeEl.muted=this.hasAttribute("muted");for(let A of s)Fe(this,p,DT).call(this,A);ie(this,m,new MutationObserver(Fe(this,p,kT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Fe(this,p,Ap).call(this)),Fe(this,p,Ap).call(this);for(let A of this.constructor.Events)this.shadowRoot.addEventListener(A,this,!0)}handleEvent(A){A.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))}attributeChangedCallback(A,L,I){Fe(this,p,Os).call(this),Fe(this,p,CT).call(this,A,L,I)}connectedCallback(){Fe(this,p,Os).call(this)}},l=new WeakMap,d=new WeakSet,RT=function(){if(D(this,l))return;ie(this,l,!0);let A=new Set(this.observedAttributes);A.delete("muted");for(let L of s)if(!(L in this.prototype))if(typeof r[L]=="function")this.prototype[L]=function(...I){return Fe(this,p,Os).call(this),(()=>{var B;if(this.call)return this.call(L,...I);let P=(B=this.nativeEl)==null?void 0:B[L];return P==null?void 0:P.apply(this.nativeEl,I)})()};else{let I={get(){var P,B,W;Fe(this,p,Os).call(this);let C=L.toLowerCase();if(A.has(C)){let V=this.getAttribute(C);return V===null?!1:V===""?!0:V}return(W=(P=this.get)==null?void 0:P.call(this,L))!=null?W:(B=this.nativeEl)==null?void 0:B[L]}};L!==L.toUpperCase()&&(I.set=function(C){Fe(this,p,Os).call(this);let P=L.toLowerCase();if(A.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(L,C);return}this.nativeEl&&(this.nativeEl[L]=C)}),Object.defineProperty(this.prototype,L,I)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Os=function(){D(this,c)||(ie(this,c,!0),this.init())},Ap=function(){var C;let A=new Map(D(this,f)),L=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(L==null?void 0:L.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var W,V;A.delete(P);let B=D(this,f).get(P);B||(B=P.cloneNode(),D(this,f).set(P,B),(W=D(this,m))==null||W.observe(P,{attributes:!0})),(V=this.nativeEl)==null||V.append(B),Fe(this,p,Sp).call(this,B)}),A.forEach((P,B)=>{P.remove(),D(this,f).delete(B)})},kT=function(A){var L;for(let I of A)if(I.type==="attributes"){let{target:C,attributeName:P}=I,B=D(this,f).get(C);B&&P&&(B.setAttribute(P,(L=C.getAttribute(P))!=null?L:""),Fe(this,p,Sp).call(this,B))}},Sp=function(A){A&&A.localName==="track"&&A.default&&(A.kind==="chapters"||A.kind==="metadata")&&A.track.mode==="disabled"&&(A.track.mode="hidden")},DT=function(A){if(Object.prototype.hasOwnProperty.call(this,A)){let L=this[A];delete this[A],this[A]=L}},CT=function(A,L,I){var C,P,B;["id","class"].includes(A)||!o.observedAttributes.includes(A)&&this.constructor.observedAttributes.includes(A)||(I===null?(C=this.nativeEl)==null||C.removeAttribute(A):((P=this.nativeEl)==null?void 0:P.getAttribute(A))!==I&&((B=this.nativeEl)==null||B.setAttribute(A,I)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?xD:LD),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",xT),ae(o,l,!1),o}function RD(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function MT(i){let e="";for(let t in i){if(!LT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kD(i){let e={};for(let t of i)e[t.name]=t.value;return e}var ST,xo=wT((ST=globalThis.HTMLElement)!=null?ST:class{},{tag:"video"}),IT,sO=wT((IT=globalThis.HTMLElement)!=null?IT:class{},{tag:"audio"});var NT=i=>{throw TypeError(i)},xp=(i,e,t)=>e.has(i)||NT("Cannot "+t),xt=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(i,e,t)=>e.has(i)?NT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ui=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ip=(i,e,t)=>(xp(i,e,"access private method"),t),DD=()=>{try{return"0.27.1"}catch{}return"UNKNOWN"},CD=DD(),wD=()=>CD,MD=`
|
|
110
110
|
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" part="logo" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 1600 500"><g fill="#fff"><path d="M994.287 93.486c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m0-93.486c-34.509 0-62.484 27.976-62.484 62.486v187.511c0 68.943-56.09 125.033-125.032 125.033s-125.03-56.09-125.03-125.033V62.486C681.741 27.976 653.765 0 619.256 0s-62.484 27.976-62.484 62.486v187.511C556.772 387.85 668.921 500 806.771 500c137.851 0 250.001-112.15 250.001-250.003V62.486c0-34.51-27.976-62.486-62.485-62.486M1537.51 468.511c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m-275.883-218.509-143.33 143.329c-24.402 24.402-24.402 63.966 0 88.368 24.402 24.402 63.967 24.402 88.369 0l143.33-143.329 143.328 143.329c24.402 24.4 63.967 24.402 88.369 0 24.403-24.402 24.403-63.966.001-88.368l-143.33-143.329.001-.004 143.329-143.329c24.402-24.402 24.402-63.965 0-88.367s-63.967-24.402-88.369 0L1349.996 161.63 1206.667 18.302c-24.402-24.401-63.967-24.402-88.369 0s-24.402 63.965 0 88.367l143.329 143.329v.004ZM437.511 468.521c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31M461.426 4.759C438.078-4.913 411.2.432 393.33 18.303L249.999 161.632 106.669 18.303C88.798.432 61.922-4.913 38.573 4.759 15.224 14.43-.001 37.214-.001 62.488v375.026c0 34.51 27.977 62.486 62.487 62.486 34.51 0 62.486-27.976 62.486-62.486V213.341l80.843 80.844c24.404 24.402 63.965 24.402 88.369 0l80.843-80.844v224.173c0 34.51 27.976 62.486 62.486 62.486s62.486-27.976 62.486-62.486V62.488c0-25.274-15.224-48.058-38.573-57.729" style="fill-rule:nonzero"/></g></svg>`,M={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type",LOGO:"logo"},PD=Object.values(M),PT=wD(),OT="mux-video",Gi,Lo,cu,Ro,hu,fu,mu,pu,gu,ko,Do,vu,UT=class extends xo{constructor(){super(),Si(this,Do),Si(this,Gi),Si(this,Lo),Si(this,cu),Si(this,Ro,{}),Si(this,hu,{}),Si(this,fu),Si(this,mu),Si(this,pu),Si(this,gu),Si(this,ko,""),ui(this,cu,ou()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=fT(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(ui(this,ko,"default"),this.updateLogo())})}static get NAME(){return OT}static get VERSION(){return PT}static get observedAttributes(){var i;return[...PD,...(i=xo.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?MD:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${xo.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -1852,7 +1852,7 @@ Schedule: ${l.map(m=>Nr(m))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
1852
1852
|
}
|
|
1853
1853
|
</style>
|
|
1854
1854
|
<slot name="icon">${WM}</slot>
|
|
1855
|
-
`}function YM(){return $("Quality")}var $a=class extends Vt{static get observedAttributes(){return[...super.observedAttributes,_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",$("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Je(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return ce(this,_.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){he(this,_.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ve(this,_.MEDIA_HEIGHT)}set mediaHeight(e){xe(this,_.MEDIA_HEIGHT,e)}};$a.getSlotTemplateHTML=qM;$a.getTooltipContentHTML=YM;R.customElements.get("media-rendition-menu-button")||R.customElements.define("media-rendition-menu-button",$a);var tS=i=>{throw TypeError(i)},U0=(i,e,t)=>e.has(i)||tS("Cannot "+t),Ue=(i,e,t)=>(U0(i,e,"read from private field"),t?t.call(i):e.get(i)),wi=(i,e,t)=>e.has(i)?tS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),lr=(i,e,t,r)=>(U0(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(U0(i,e,"access private method"),t),Bh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Bh{}globalThis.DocumentFragment=i}var F0=class extends Bh{},jM=class extends Bh{},zM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(F0)}},Mh,QM=class{constructor(i,e={}){wi(this,Mh),lr(this,Mh,e==null?void 0:e.detail)}get detail(){return Ue(this,Mh)}initCustomEvent(){}};Mh=new WeakMap;function XM(i,e){return new F0}var iS={document:{createElement:XM},DocumentFragment,customElements:zM,CustomEvent:QM,EventTarget:Bh,HTMLElement:F0,HTMLVideoElement:jM},rS=typeof window=="undefined"||typeof globalThis.customElements=="undefined",or=rS?iS:globalThis,B0=rS?iS.document:globalThis.document;function ZM(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${M0(t)}: ${r}; `)}),e?e.trim():void 0}function M0(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function sS(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ri(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function nS(i){let e=JM(i).toString();return e?"?"+e:""}function JM(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var aS=(i,e)=>!i||!e?!1:i.contains(e)?!0:aS(i,e.getRootNode().host),oS="mux.com",eP=()=>{try{return"3.
|
|
1855
|
+
`}function YM(){return $("Quality")}var $a=class extends Vt{static get observedAttributes(){return[...super.observedAttributes,_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",$("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Je(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return ce(this,_.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){he(this,_.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ve(this,_.MEDIA_HEIGHT)}set mediaHeight(e){xe(this,_.MEDIA_HEIGHT,e)}};$a.getSlotTemplateHTML=qM;$a.getTooltipContentHTML=YM;R.customElements.get("media-rendition-menu-button")||R.customElements.define("media-rendition-menu-button",$a);var tS=i=>{throw TypeError(i)},U0=(i,e,t)=>e.has(i)||tS("Cannot "+t),Ue=(i,e,t)=>(U0(i,e,"read from private field"),t?t.call(i):e.get(i)),wi=(i,e,t)=>e.has(i)?tS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),lr=(i,e,t,r)=>(U0(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(U0(i,e,"access private method"),t),Bh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Bh{}globalThis.DocumentFragment=i}var F0=class extends Bh{},jM=class extends Bh{},zM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(F0)}},Mh,QM=class{constructor(i,e={}){wi(this,Mh),lr(this,Mh,e==null?void 0:e.detail)}get detail(){return Ue(this,Mh)}initCustomEvent(){}};Mh=new WeakMap;function XM(i,e){return new F0}var iS={document:{createElement:XM},DocumentFragment,customElements:zM,CustomEvent:QM,EventTarget:Bh,HTMLElement:F0,HTMLVideoElement:jM},rS=typeof window=="undefined"||typeof globalThis.customElements=="undefined",or=rS?iS:globalThis,B0=rS?iS.document:globalThis.document;function ZM(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${M0(t)}: ${r}; `)}),e?e.trim():void 0}function M0(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function sS(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ri(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function nS(i){let e=JM(i).toString();return e?"?"+e:""}function JM(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var aS=(i,e)=>!i||!e?!1:i.contains(e)?!0:aS(i,e.getRootNode().host),oS="mux.com",eP=()=>{try{return"3.7.0"}catch{}return"UNKNOWN"},tP=eP(),lS=()=>tP,iP=(i,{token:e,customDomain:t=oS,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Gr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${nS({token:e,time:a,program_time:s})}`},rP=(i,{token:e,customDomain:t=oS,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Gr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${nS({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},$0=i=>{if(i){if([ke.LIVE,ke.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ke.LIVE}},sP={crossorigin:"crossOrigin",playsinline:"playsInline"};function nP(i){var e;return(e=sP[i])!=null?e:sS(i)}var Ha,Ga,Wt,aP=class{constructor(i,e){wi(this,Ha),wi(this,Ga),wi(this,Wt,[]),lr(this,Ha,i),lr(this,Ga,e)}[Symbol.iterator](){return Ue(this,Wt).values()}get length(){return Ue(this,Wt).length}get value(){var i;return(i=Ue(this,Wt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(lr(this,Wt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return Ue(this,Wt)[i]}values(){return Ue(this,Wt).values()}keys(){return Ue(this,Wt).keys()}forEach(i){Ue(this,Wt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||Ue(this,Wt).push(r)}),!(this.value===""&&!((e=Ue(this,Ha))!=null&&e.hasAttribute(`${Ue(this,Ga)}`)))&&((t=Ue(this,Ha))==null||t.setAttribute(`${Ue(this,Ga)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{Ue(this,Wt).splice(Ue(this,Wt).indexOf(t),1)}),(e=Ue(this,Ha))==null||e.setAttribute(`${Ue(this,Ga)}`,`${this.value}`)}contains(i){return Ue(this,Wt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ha=new WeakMap,Ga=new WeakMap,Wt=new WeakMap;var dS=`[mux-player ${lS()}]`;function wr(...i){console.warn(dS,...i)}function pi(...i){console.error(dS,...i)}function uS(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${te("Read more: ")}
|
|
1856
1856
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),wr(t)}var Rt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},bs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},r5={...Rt,...bs},$A=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),oP=Object.values(Rt).filter(i=>Rt.PLAYSINLINE!==i),lP=Object.values(bs),dP=[...oP,...lP],uP=class extends or.HTMLElement{static get observedAttributes(){return dP}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case bs.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case bs.VOLUME:{let n=(r=ri(t))!=null?r:1;this.media&&(this.media.volume=n);return}case bs.PLAYBACKRATE:{let n=(s=ri(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:$A}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:$A}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentSrc(){var i,e;return(e=(i=this.media)==null?void 0:i.currentSrc)!=null?e:""}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=ri(this.getAttribute(bs.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(bs.PLAYBACKRATE,`${i}`):this.removeAttribute(bs.PLAYBACKRATE)}get crossOrigin(){return Hl(this,Rt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Rt.CROSSORIGIN,`${i}`)}get autoplay(){return Hl(this,Rt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Rt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Rt.AUTOPLAY)}get loop(){return Hl(this,Rt.LOOP)!=null}set loop(i){i?this.setAttribute(Rt.LOOP,""):this.removeAttribute(Rt.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=!!i)}get defaultMuted(){return Hl(this,Rt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Rt.MUTED,""):this.removeAttribute(Rt.MUTED)}get playsInline(){return Hl(this,Rt.PLAYSINLINE)!=null}set playsInline(i){pi("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute(Rt.PRELOAD,i):this.removeAttribute(Rt.PRELOAD)}};function Hl(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var HA=uP,cP=`:host {
|
|
1857
1857
|
--media-control-display: var(--controls);
|
|
1858
1858
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "An open source Mux player web component that Just Works™",
|
|
5
5
|
"homepage": "https://mux.com/player",
|
|
6
6
|
"keywords": [
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"build": "npm-run-all 'build:esm:base -- --minify' 'build:cjs:base -- --minify' 'build:esm:ads:mixin -- --minify' 'build:cjs:ads:mixin -- --minify' --parallel 'build:esm:** -- --minify' 'build:iife:** -- --minify' 'build:cjs:** -- --minify' 'build:esm-module:** -- --minify' 'build:themes'"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@mux/mux-video": "0.27.
|
|
129
|
-
"@mux/playback-core": "0.31.
|
|
128
|
+
"@mux/mux-video": "0.27.1",
|
|
129
|
+
"@mux/playback-core": "0.31.1",
|
|
130
130
|
"media-chrome": "~4.14.0",
|
|
131
131
|
"player.style": "^0.2.0"
|
|
132
132
|
},
|