@mux/mux-player 3.13.5-canary.5 → 3.14.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
|
@@ -1413,7 +1413,7 @@
|
|
|
1413
1413
|
<path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
|
|
1414
1414
|
</svg>
|
|
1415
1415
|
</div>
|
|
1416
|
-
`}function Mv(){return c("Loop")}var zr=class extends B{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=c("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,o.MEDIA_LOOP)}set mediaLoop(e){L(this,o.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};zr.getSlotTemplateHTML=Iv;zr.getTooltipContentHTML=Mv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",zr);var E=require("@mux/mux-video/base"),O=require("@mux/playback-core");var Rm=require("@mux/playback-core");var Si=require("@mux/playback-core");function Im(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${us(i)}: ${a}; `)}),e?e.trim():void 0}function us(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function cs(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function de(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function pd(t){let e=Lv(t).toString();return e?"?"+e:""}function Lv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var fd=(t,e)=>!t||!e?!1:t.contains(e)?!0:fd(t,e.getRootNode().host);var Mm="mux.com",Cv=()=>{try{return"3.
|
|
1416
|
+
`}function Mv(){return c("Loop")}var zr=class extends B{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=c("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,o.MEDIA_LOOP)}set mediaLoop(e){L(this,o.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};zr.getSlotTemplateHTML=Iv;zr.getTooltipContentHTML=Mv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",zr);var E=require("@mux/mux-video/base"),O=require("@mux/playback-core");var Rm=require("@mux/playback-core");var Si=require("@mux/playback-core");function Im(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${us(i)}: ${a}; `)}),e?e.trim():void 0}function us(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function cs(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function de(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function pd(t){let e=Lv(t).toString();return e?"?"+e:""}function Lv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var fd=(t,e)=>!t||!e?!1:t.contains(e)?!0:fd(t,e.getRootNode().host);var Mm="mux.com",Cv=()=>{try{return"3.14.0"}catch{}return"UNKNOWN"},wv=Cv(),hs=()=>wv,Lm=(t,{token:e,customDomain:i=Mm,thumbnailTime:a,programTime:r}={})=>{var d;let n=e==null?a:void 0,{aud:s}=(d=(0,Si.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${pd({token:e,time:n,program_time:r})}`},Cm=(t,{token:e,customDomain:i=Mm,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,Si.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${pd({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Qr=t=>{if(t){if([Si.StreamTypes.LIVE,Si.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Si.StreamTypes.LIVE}};var Rv={crossorigin:"crossOrigin",playsinline:"playsInline"};function wm(t){var e;return(e=Rv[t])!=null?e:cs(t)}var yi,ki,Ee,ms=class{constructor(e,i){X(this,yi);X(this,ki);X(this,Ee,[]);ue(this,yi,e),ue(this,ki,i)}[Symbol.iterator](){return C(this,Ee).values()}get length(){return C(this,Ee).length}get value(){var e;return(e=C(this,Ee).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ue(this,Ee,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return C(this,Ee)[e]}values(){return C(this,Ee).values()}keys(){return C(this,Ee).keys()}forEach(e){C(this,Ee).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||C(this,Ee).push(r)}),!(this.value===""&&!((i=C(this,yi))!=null&&i.hasAttribute(`${C(this,ki)}`)))&&((a=C(this,yi))==null||a.setAttribute(`${C(this,ki)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{C(this,Ee).splice(C(this,Ee).indexOf(a),1)}),(i=C(this,yi))==null||i.setAttribute(`${C(this,ki)}`,`${this.value}`)}contains(e){return C(this,Ee).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)}};yi=new WeakMap,ki=new WeakMap,Ee=new WeakMap;var xm=`[mux-player ${hs()}]`;function ht(...t){console.warn(xm,...t)}function pe(...t){console.error(xm,...t)}function vd(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Rm.i18n)("Read more: ")}
|
|
1417
1417
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ht(e)}var he={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Jt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},PA={...he,...Jt},Om=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}}),xv=Object.values(he).filter(t=>he.PLAYSINLINE!==t),Dv=Object.values(Jt),Ov=[...xv,...Dv],Ed=class extends Se.HTMLElement{static get observedAttributes(){return Ov}constructor(){super()}attributeChangedCallback(e,i,a){var r,n;switch(e){case Jt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Jt.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Jt.PLAYBACKRATE:{let s=(n=de(a))!=null?n: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:Om}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Om}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=de(this.getAttribute(Jt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Jt.PLAYBACKRATE,`${e}`):this.removeAttribute(Jt.PLAYBACKRATE)}get crossOrigin(){return Xr(this,he.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(he.CROSSORIGIN,`${e}`)}get autoplay(){return Xr(this,he.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(he.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(he.AUTOPLAY)}get loop(){return Xr(this,he.LOOP)!=null}set loop(e){e?this.setAttribute(he.LOOP,""):this.removeAttribute(he.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 Xr(this,he.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(he.MUTED,""):this.removeAttribute(he.MUTED)}get playsInline(){return Xr(this,he.PLAYSINLINE)!=null}set playsInline(e){pe("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(he.PRELOAD,e):this.removeAttribute(he.PRELOAD)}};function Xr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var bd=Ed;var Bm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(Bm(t,e,"read from private field"),i?i.call(t):e.get(t)),pt=(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)},Ct=(t,e,i,a)=>(Bm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ba,ps,Ii,Jr,jt,ei,ti,Mi,ga,fs,Ze,Nm=1,Pm=0,Nv=1,Pv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof be&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof be?r.element[r.attributeName]=n:r.value=n}}}},wt=class extends l.DocumentFragment{constructor(e,i,a=Pv){var r;super(),pt(this,ba,void 0),pt(this,ps,void 0),this.append(e.content.cloneNode(!0)),Ct(this,ba,$m(this)),Ct(this,ps,a),(r=a.createCallback)==null||r.call(a,this,P(this,ba),i),a.processCallback(this,P(this,ba),i)}update(e){P(this,ps).processCallback(this,P(this,ba),e)}};ba=new WeakMap;ps=new WeakMap;var $m=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new gd;for([i,a]of Hm(r.value))if(!i)n.append(a);else{let s=new be(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===Nm&&!(r instanceof HTMLTemplateElement))$m(r,e);else{let n=r.data;if(r.nodeType===Nm||n.includes("{{")){let s=[];if(n)for([i,a]of Hm(n))if(!i)s.push(new Text(a));else{let d=new Rt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new jr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},Um={},Hm=t=>{let e="",i=0,a=Um[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Pm,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([Nv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Pm,(i>0?"{{":"")+e]),Um[t]=a},Uv=11,vs=class{get value(){return""}set value(e){}toString(){return this.value}},Wm=new WeakMap,gd=class{constructor(){pt(this,Ii,[])}[Symbol.iterator](){return P(this,Ii).values()}get length(){return P(this,Ii).length}item(e){return P(this,Ii)[e]}append(...e){for(let i of e)i instanceof be&&Wm.set(i,this),P(this,Ii).push(i)}toString(){return P(this,Ii).join("")}};Ii=new WeakMap;var be=class extends vs{constructor(e,i,a){super(),pt(this,Mi),pt(this,Jr,""),pt(this,jt,void 0),pt(this,ei,void 0),pt(this,ti,void 0),Ct(this,jt,e),Ct(this,ei,i),Ct(this,ti,a)}get attributeName(){return P(this,ei)}get attributeNamespace(){return P(this,ti)}get element(){return P(this,jt)}get value(){return P(this,Jr)}set value(e){P(this,Jr)!==e&&(Ct(this,Jr,e),!P(this,Mi,ga)||P(this,Mi,ga).length===1?e==null?P(this,jt).removeAttributeNS(P(this,ti),P(this,ei)):P(this,jt).setAttributeNS(P(this,ti),P(this,ei),e):P(this,jt).setAttributeNS(P(this,ti),P(this,ei),P(this,Mi,ga).toString()))}get booleanValue(){return P(this,jt).hasAttributeNS(P(this,ti),P(this,ei))}set booleanValue(e){if(!P(this,Mi,ga)||P(this,Mi,ga).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Jr=new WeakMap;jt=new WeakMap;ei=new WeakMap;ti=new WeakMap;Mi=new WeakSet;ga=function(){return Wm.get(this)};var Rt=class extends vs{constructor(e,i){super(),pt(this,fs,void 0),pt(this,Ze,void 0),Ct(this,fs,e),Ct(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return P(this,Ze)}get parentNode(){return P(this,fs)}get nextSibling(){return P(this,Ze)[P(this,Ze).length-1].nextSibling}get previousSibling(){return P(this,Ze)[0].previousSibling}get value(){return P(this,Ze).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===Uv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),Ct(this,Ze,Hv(P(this,Ze)[0].parentNode,P(this,Ze),i,this.nextSibling))}};fs=new WeakMap;Ze=new WeakMap;var jr=class extends Rt{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 Hv(t,e,i,a=null){let r=0,n,s,d,u=i.length,f=e.length;for(;r<u&&r<f&&e[r]==i[r];)r++;for(;r<u&&r<f&&i[u-1]==e[f-1];)a=i[--f,--u];if(r==f)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<f;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)d=i[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&i[r]==s?(t.replaceChild(d,n),n=s):t.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var Fm={string:t=>String(t)},bs=class{constructor(e){this.template=e,this.state=void 0}},Li=new WeakMap,Ci=new WeakMap,_d={partial:(t,e)=>{e[t.expression]=new bs(t.template)},if:(t,e)=>{var i;if(Km(t.expression,e))if(Li.get(t)!==t.template){Li.set(t,t.template);let a=new wt(t.template,e,gs);t.replace(a),Ci.set(t,a)}else(i=Ci.get(t))==null||i.update(e);else t.replace(""),Li.delete(t),Ci.delete(t)}},Bv=Object.keys(_d),gs={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof jr){if(!s.directive){let u=Bv.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=_d[s.directive])==null||a.call(_d,s,i);continue}let d=Km(n,i);if(d instanceof bs){Li.get(s)!==d.template?(Li.set(s,d.template),d=new wt(d.template,d.state,gs),s.value=d,Ci.set(s,d)):(r=Ci.get(s))==null||r.update(d.state);continue}d?(s instanceof be&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof be?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Li.delete(s),Ci.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Li.delete(s),Ci.delete(s))}}},Vm={"!":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=Fm[e])==null?void 0:i.call(Fm,t)}};function $v(t){return Wv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Km(t,e={}){var i,a,r,n,s,d,u;let f=$v(t);if(f.length===0||f.some(({type:T})=>!T))return en(t);if(((i=f[0])==null?void 0:i.token)===">"){let T=e[(a=f[1])==null?void 0:a.token];if(!T)return en(t);let A={...e};T.state=A;let b=f.slice(2);for(let p=0;p<b.length;p+=3){let k=(r=b[p])==null?void 0:r.token,g=(n=b[p+1])==null?void 0:n.token,S=(s=b[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=tn(S,e))}return T}if(f.length===1)return Es(f[0])?tn(f[0].token,e):en(t);if(f.length===2){let T=(d=f[0])==null?void 0:d.token,A=Vm[T];if(!A||!Es(f[1]))return en(t);let b=tn(f[1].token,e);return A(b)}if(f.length===3){let T=(u=f[1])==null?void 0:u.token,A=Vm[T];if(!A||!Es(f[0])||!Es(f[2]))return en(t);let b=tn(f[0].token,e);if(T==="|")return A(b,f[2].token);let p=tn(f[2].token,e);return A(b,p)}}function en(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Es({type:t}){return["number","boolean","string","param"].includes(t)}function tn(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):Pn(t)?parseFloat(t):e[t]}function Wv(t,e){let i,a,r,n=[];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&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var Sd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ii=(t,e,i)=>(Sd(t,e,"read from private field"),i?i.call(t):e.get(t)),wi=(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)},xt=(t,e,i,a)=>(Sd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ad=(t,e,i)=>(Sd(t,e,"access private method"),i),Aa,_s,Ta,_a,yd,Gm,As,kd,an,Td={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Ym=V.createElement("template");Ym.innerHTML=`
|
|
1418
1418
|
<style>
|
|
1419
1419
|
:host {
|
package/dist/base.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var bt=t=>{throw TypeError(t)};var Re=(t,i,e)=>i.has(t)||bt("Cannot "+e);var l=(t,i,e)=>(Re(t,i,"read from private field"),e?e.call(t):i.get(t)),b=(t,i,e)=>i.has(t)?bt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),E=(t,i,e,a)=>(Re(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),h=(t,i,e)=>(Re(t,i,"access private method"),e);var Z=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Z{}globalThis.DocumentFragment=t}var Q=class extends Z{},xe=class extends Z{},qt={get(t){},define(t,i,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,Oe=class{constructor(i,e={}){b(this,J);E(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function Qt(t,i){return new Q}var ht={document:{createElement:Qt},DocumentFragment,customElements:qt,CustomEvent:Oe,EventTarget:Z,HTMLElement:Q,HTMLVideoElement:xe},gt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=gt?ht:globalThis,B=gt?ht.document:globalThis.document;import{MediaController as Li,MediaErrorDialog as Wt}from"media-chrome";import{Attributes as Ke}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Kt,MediaUIAttributes as Ce,MediaUIEvents as Vt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as _e,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as ke,addTextTrack as Mi,removeTextTrack as Si,CmcdTypeValues as Ht,i18n as H,parseJwt as Ve,MuxJWTAud as He,generatePlayerInitTime as Ni}from"@mux/playback-core";import{i18n as ai}from"@mux/playback-core";import{StreamTypes as Se,parseJwt as yt}from"@mux/playback-core";function ft(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${he(e)}: ${a}; `)}),i?i.trim():void 0}function he(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ge(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function f(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function Le(t){let i=Jt(t).toString();return i?"?"+i:""}function Jt(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}var Me=(t,i)=>!t||!i?!1:t.contains(i)?!0:Me(t,i.getRootNode().host);var Et="mux.com",ei=()=>{try{return"3.
|
|
1
|
+
var bt=t=>{throw TypeError(t)};var Re=(t,i,e)=>i.has(t)||bt("Cannot "+e);var l=(t,i,e)=>(Re(t,i,"read from private field"),e?e.call(t):i.get(t)),b=(t,i,e)=>i.has(t)?bt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),E=(t,i,e,a)=>(Re(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),h=(t,i,e)=>(Re(t,i,"access private method"),e);var Z=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Z{}globalThis.DocumentFragment=t}var Q=class extends Z{},xe=class extends Z{},qt={get(t){},define(t,i,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,Oe=class{constructor(i,e={}){b(this,J);E(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function Qt(t,i){return new Q}var ht={document:{createElement:Qt},DocumentFragment,customElements:qt,CustomEvent:Oe,EventTarget:Z,HTMLElement:Q,HTMLVideoElement:xe},gt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=gt?ht:globalThis,B=gt?ht.document:globalThis.document;import{MediaController as Li,MediaErrorDialog as Wt}from"media-chrome";import{Attributes as Ke}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Kt,MediaUIAttributes as Ce,MediaUIEvents as Vt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as _e,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as ke,addTextTrack as Mi,removeTextTrack as Si,CmcdTypeValues as Ht,i18n as H,parseJwt as Ve,MuxJWTAud as He,generatePlayerInitTime as Ni}from"@mux/playback-core";import{i18n as ai}from"@mux/playback-core";import{StreamTypes as Se,parseJwt as yt}from"@mux/playback-core";function ft(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${he(e)}: ${a}; `)}),i?i.trim():void 0}function he(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ge(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function f(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function Le(t){let i=Jt(t).toString();return i?"?"+i:""}function Jt(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}var Me=(t,i)=>!t||!i?!1:t.contains(i)?!0:Me(t,i.getRootNode().host);var Et="mux.com",ei=()=>{try{return"3.14.0"}catch{}return"UNKNOWN"},ti=ei(),ye=()=>ti,Tt=(t,{token:i,customDomain:e=Et,thumbnailTime:a,programTime:r}={})=>{var u;let o=i==null?a:void 0,{aud:d}=(u=yt(i))!=null?u:{};if(!(i&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${Le({token:i,time:o,program_time:r})}`},vt=(t,{token:i,customDomain:e=Et,programStartTime:a,programEndTime:r}={})=>{var d;let{aud:o}=(d=yt(i))!=null?d:{};if(!(i&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${Le({token:i,format:"webp",program_start_time:a,program_end_time:r})}`},ee=t=>{if(t){if([Se.LIVE,Se.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Se.LIVE}};var ii={crossorigin:"crossOrigin",playsinline:"playsInline"};function At(t){var i;return(i=ii[t])!=null?i:ge(t)}var K,V,k,fe=class{constructor(i,e){b(this,K);b(this,V);b(this,k,[]);E(this,K,i),E(this,V,e)}[Symbol.iterator](){return l(this,k).values()}get length(){return l(this,k).length}get value(){var i;return(i=l(this,k).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(E(this,k,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return l(this,k)[i]}values(){return l(this,k).values()}keys(){return l(this,k).keys()}forEach(i){l(this,k).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||l(this,k).push(r)}),!(this.value===""&&!((e=l(this,K))!=null&&e.hasAttribute(`${l(this,V)}`)))&&((a=l(this,K))==null||a.setAttribute(`${l(this,V)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{l(this,k).splice(l(this,k).indexOf(a),1)}),(e=l(this,K))==null||e.setAttribute(`${l(this,V)}`,`${this.value}`)}contains(i){return l(this,k).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)}};K=new WeakMap,V=new WeakMap,k=new WeakMap;var Ct=`[mux-player ${ye()}]`;function O(...t){console.warn(Ct,...t)}function A(...t){console.error(Ct,...t)}function Ne(t){var e;let i=(e=t.message)!=null?e:"";t.context&&(i+=` ${t.context}`),t.file&&(i+=` ${ai("Read more: ")}
|
|
2
2
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(i)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},D={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ea={...T,...D},_t=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ri=Object.values(T).filter(t=>T.PLAYSINLINE!==t),ni=Object.values(D),oi=[...ri,...ni],Ie=class extends _.HTMLElement{static get observedAttributes(){return oi}constructor(){super()}attributeChangedCallback(i,e,a){var r,o;switch(i){case D.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case D.VOLUME:{let d=(r=f(a))!=null?r:1;this.media&&(this.media.volume=d);return}case D.PLAYBACKRATE:{let d=(o=f(a))!=null?o:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);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:_t}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:_t}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=f(this.getAttribute(D.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(D.PLAYBACKRATE,`${i}`):this.removeAttribute(D.PLAYBACKRATE)}get crossOrigin(){return te(this,T.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(T.CROSSORIGIN,`${i}`)}get autoplay(){return te(this,T.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(T.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return te(this,T.LOOP)!=null}set loop(i){i?this.setAttribute(T.LOOP,""):this.removeAttribute(T.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 te(this,T.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return te(this,T.PLAYSINLINE)!=null}set playsInline(i){A("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(T.PRELOAD,i):this.removeAttribute(T.PRELOAD)}};function te(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Pe=Ie;import"media-chrome/dist/media-theme-element.js";var Rt=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.js
CHANGED
|
@@ -108,7 +108,7 @@ Schedule: ${l.map(p=>bi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
108
108
|
<video${zA(i)}></video>
|
|
109
109
|
</slot>
|
|
110
110
|
<slot></slot>
|
|
111
|
-
`}function jA(i,{tag:e,is:t}){var n,a,o,l,d,VA,c,h,f,m,p,g,Rn,V0,W0,WA,q0,qA,YA;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?kO(s):[];return o=class extends i{constructor(){super(...arguments);fe(this,g);fe(this,c,!1);fe(this,h,null);fe(this,f,new Map);fe(this,m);fe(this,p);Pe(this,"get");Pe(this,"set");Pe(this,"call")}static get observedAttributes(){var D,w,N;return je(D=o,d,VA).call(D),[...(N=(w=s==null?void 0:s.constructor)==null?void 0:w.observedAttributes)!=null?N:[],...KA]}get nativeEl(){var R,D,w,N,$;return je(this,g,Rn).call(this),($=(N=(D=(R=M(this,h))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?D:this.querySelector(e))!=null?N:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?$:null}set nativeEl(R){le(this,h,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,D;return(D=this.getAttribute("preload"))!=null?D:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let R=DO(this.attributes);t&&(R.is=t),e&&(R.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(R)}this.nativeEl.muted=this.hasAttribute("muted");for(let R of r)je(this,g,qA).call(this,R);je(this,g,V0).call(this)}handleEvent(R){R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,D,w){je(this,g,Rn).call(this),je(this,g,YA).call(this,R,D,w)}connectedCallback(){je(this,g,Rn).call(this),M(this,p)||je(this,g,V0).call(this)}disconnectedCallback(){var R,D,w;(R=M(this,m))==null||R.disconnect(),le(this,m,void 0),M(this,p)&&((D=this.shadowRoot)==null||D.removeEventListener("slotchange",M(this,p)),le(this,p,void 0));for(let N of this.constructor.Events)(w=this.shadowRoot)==null||w.removeEventListener(N,this,!0);M(this,f).forEach(N=>N.remove()),M(this,f).clear(),le(this,h,null)}},l=new WeakMap,d=new WeakSet,VA=function(){if(M(this,l))return;le(this,l,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let D of r)if(!(D in this.prototype))if(typeof s[D]=="function")this.prototype[D]=function(...w){return je(this,g,Rn).call(this),(()=>{var H;if(this.call)return this.call(D,...w);let $=(H=this.nativeEl)==null?void 0:H[D];return $==null?void 0:$.apply(this.nativeEl,w)})()};else{let w={get(){var $,H,O;je(this,g,Rn).call(this);let N=D.toLowerCase();if(R.has(N)){let F=this.getAttribute(N);return F===null?!1:F===""?!0:F}return(O=($=this.get)==null?void 0:$.call(this,D))!=null?O:(H=this.nativeEl)==null?void 0:H[D]}};D!==D.toUpperCase()&&(w.set=function(N){je(this,g,Rn).call(this);let $=D.toLowerCase();if(R.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(D,N);return}this.nativeEl&&(this.nativeEl[D]=N)}),Object.defineProperty(this.prototype,D,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,Rn=function(){M(this,c)||(le(this,c,!0),this.init())},V0=function(){var R,D;le(this,m,new MutationObserver(je(this,g,WA).bind(this))),le(this,p,()=>je(this,g,W0).call(this)),(R=this.shadowRoot)==null||R.addEventListener("slotchange",M(this,p)),je(this,g,W0).call(this);for(let w of this.constructor.Events)(D=this.shadowRoot)==null||D.addEventListener(w,this,!0)},W0=function(){var N;let R=new Map(M(this,f)),D=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(D==null?void 0:D.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var O,F;R.delete($);let H=M(this,f).get($);H||(H=$.cloneNode(),M(this,f).set($,H),(O=M(this,m))==null||O.observe($,{attributes:!0})),(F=this.nativeEl)==null||F.append(H),je(this,g,q0).call(this,H)}),R.forEach(($,H)=>{$.remove(),M(this,f).delete(H)})},WA=function(R){var D;for(let w of R)if(w.type==="attributes"){let{target:N,attributeName:$}=w,H=M(this,f).get(N);H&&$&&(H.setAttribute($,(D=N.getAttribute($))!=null?D:""),je(this,g,q0).call(this,H))}},q0=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},qA=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let D=this[R];delete this[R],this[R]=D}},YA=function(R,D,w){var N,$,H;["id","class"].includes(R)||!o.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(w===null?(N=this.nativeEl)==null||N.removeAttribute(R):(($=this.nativeEl)==null?void 0:$.getAttribute(R))!==w&&((H=this.nativeEl)==null||H.setAttribute(R,w)))},fe(o,d),Pe(o,"getTemplateHTML",e.endsWith("audio")?LO:xO),Pe(o,"shadowRootOptions",{mode:"open"}),Pe(o,"Events",GA),fe(o,l,!1),o}function kO(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);e.push(...s)}return e}function zA(i){let e="";for(let t in i){if(!KA.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function DO(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $A,Ml=jA(($A=globalThis.HTMLElement)!=null?$A:class{},{tag:"video"}),HA,_F=jA((HA=globalThis.HTMLElement)!=null?HA:class{},{tag:"audio"});var ZA=i=>{throw TypeError(i)},Y0=(i,e,t)=>e.has(i)||ZA("Cannot "+t),At=(i,e,t)=>(Y0(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>e.has(i)?ZA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zi=(i,e,t,s)=>(Y0(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wc=(i,e,t)=>(Y0(i,e,"access private method"),t),CO=()=>{try{return"0.31.
|
|
111
|
+
`}function jA(i,{tag:e,is:t}){var n,a,o,l,d,VA,c,h,f,m,p,g,Rn,V0,W0,WA,q0,qA,YA;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?kO(s):[];return o=class extends i{constructor(){super(...arguments);fe(this,g);fe(this,c,!1);fe(this,h,null);fe(this,f,new Map);fe(this,m);fe(this,p);Pe(this,"get");Pe(this,"set");Pe(this,"call")}static get observedAttributes(){var D,w,N;return je(D=o,d,VA).call(D),[...(N=(w=s==null?void 0:s.constructor)==null?void 0:w.observedAttributes)!=null?N:[],...KA]}get nativeEl(){var R,D,w,N,$;return je(this,g,Rn).call(this),($=(N=(D=(R=M(this,h))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?D:this.querySelector(e))!=null?N:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?$:null}set nativeEl(R){le(this,h,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,D;return(D=this.getAttribute("preload"))!=null?D:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let R=DO(this.attributes);t&&(R.is=t),e&&(R.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(R)}this.nativeEl.muted=this.hasAttribute("muted");for(let R of r)je(this,g,qA).call(this,R);je(this,g,V0).call(this)}handleEvent(R){R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,D,w){je(this,g,Rn).call(this),je(this,g,YA).call(this,R,D,w)}connectedCallback(){je(this,g,Rn).call(this),M(this,p)||je(this,g,V0).call(this)}disconnectedCallback(){var R,D,w;(R=M(this,m))==null||R.disconnect(),le(this,m,void 0),M(this,p)&&((D=this.shadowRoot)==null||D.removeEventListener("slotchange",M(this,p)),le(this,p,void 0));for(let N of this.constructor.Events)(w=this.shadowRoot)==null||w.removeEventListener(N,this,!0);M(this,f).forEach(N=>N.remove()),M(this,f).clear(),le(this,h,null)}},l=new WeakMap,d=new WeakSet,VA=function(){if(M(this,l))return;le(this,l,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let D of r)if(!(D in this.prototype))if(typeof s[D]=="function")this.prototype[D]=function(...w){return je(this,g,Rn).call(this),(()=>{var H;if(this.call)return this.call(D,...w);let $=(H=this.nativeEl)==null?void 0:H[D];return $==null?void 0:$.apply(this.nativeEl,w)})()};else{let w={get(){var $,H,O;je(this,g,Rn).call(this);let N=D.toLowerCase();if(R.has(N)){let F=this.getAttribute(N);return F===null?!1:F===""?!0:F}return(O=($=this.get)==null?void 0:$.call(this,D))!=null?O:(H=this.nativeEl)==null?void 0:H[D]}};D!==D.toUpperCase()&&(w.set=function(N){je(this,g,Rn).call(this);let $=D.toLowerCase();if(R.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(D,N);return}this.nativeEl&&(this.nativeEl[D]=N)}),Object.defineProperty(this.prototype,D,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,Rn=function(){M(this,c)||(le(this,c,!0),this.init())},V0=function(){var R,D;le(this,m,new MutationObserver(je(this,g,WA).bind(this))),le(this,p,()=>je(this,g,W0).call(this)),(R=this.shadowRoot)==null||R.addEventListener("slotchange",M(this,p)),je(this,g,W0).call(this);for(let w of this.constructor.Events)(D=this.shadowRoot)==null||D.addEventListener(w,this,!0)},W0=function(){var N;let R=new Map(M(this,f)),D=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(D==null?void 0:D.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var O,F;R.delete($);let H=M(this,f).get($);H||(H=$.cloneNode(),M(this,f).set($,H),(O=M(this,m))==null||O.observe($,{attributes:!0})),(F=this.nativeEl)==null||F.append(H),je(this,g,q0).call(this,H)}),R.forEach(($,H)=>{$.remove(),M(this,f).delete(H)})},WA=function(R){var D;for(let w of R)if(w.type==="attributes"){let{target:N,attributeName:$}=w,H=M(this,f).get(N);H&&$&&(H.setAttribute($,(D=N.getAttribute($))!=null?D:""),je(this,g,q0).call(this,H))}},q0=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},qA=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let D=this[R];delete this[R],this[R]=D}},YA=function(R,D,w){var N,$,H;["id","class"].includes(R)||!o.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(w===null?(N=this.nativeEl)==null||N.removeAttribute(R):(($=this.nativeEl)==null?void 0:$.getAttribute(R))!==w&&((H=this.nativeEl)==null||H.setAttribute(R,w)))},fe(o,d),Pe(o,"getTemplateHTML",e.endsWith("audio")?LO:xO),Pe(o,"shadowRootOptions",{mode:"open"}),Pe(o,"Events",GA),fe(o,l,!1),o}function kO(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);e.push(...s)}return e}function zA(i){let e="";for(let t in i){if(!KA.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function DO(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $A,Ml=jA(($A=globalThis.HTMLElement)!=null?$A:class{},{tag:"video"}),HA,_F=jA((HA=globalThis.HTMLElement)!=null?HA:class{},{tag:"audio"});var ZA=i=>{throw TypeError(i)},Y0=(i,e,t)=>e.has(i)||ZA("Cannot "+t),At=(i,e,t)=>(Y0(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>e.has(i)?ZA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zi=(i,e,t,s)=>(Y0(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wc=(i,e,t)=>(Y0(i,e,"access private method"),t),CO=()=>{try{return"0.31.5"}catch{}return"UNKNOWN"},wO=CO(),MO=()=>wO,PO=`
|
|
112
112
|
<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>`,C={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",MAX_RECONNECT_RETRIES:"max-reconnect-retries",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",MAX_AUTO_RESOLUTION:"max-auto-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",CAP_RENDITION_TO_PLAYER_SIZE:"cap-rendition-to-player-size",INITIAL_BANDWIDTH_ESTIMATE_KBPS:"initial-bandwidth-estimate-kbps",INITIAL_ESTIMATE_SEGMENTS:"initial-estimate-segments",MIN_PRELOAD_SEGMENTS:"min-preload-segments"},OO=Object.values(C),QA=MO(),XA="mux-video",Pl,Mc,Ol,Pc,Oc,Nc,Uc,Fc,Nl,Bc,Si,Dr,$c,Ul,JA=class extends Ml{constructor(){super(),Mi(this,Si),Mi(this,Pl),Mi(this,Mc),Mi(this,Ol,{}),Mi(this,Pc,{}),Mi(this,Oc),Mi(this,Nc),Mi(this,Uc),Mi(this,Fc),Mi(this,Nl,""),Mi(this,Bc,i=>{var e;let t=LA(this.nativeEl),s=(e=this.metadata)!=null?e:{};this.metadata={...t,...s},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(zi(this,Nl,"default"),this.updateLogo())}),Mi(this,$c),zi(this,Mc,xc())}static get NAME(){return XA}static get VERSION(){return QA}static get observedAttributes(){var i;return[...OO,...(i=Ml.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?PO:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
113
113
|
${Ml.getTemplateHTML(i)}
|
|
114
114
|
<style>
|
|
@@ -2028,7 +2028,7 @@ Schedule: ${l.map(p=>bi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2028
2028
|
min-height: var(--media-control-height, 24px);
|
|
2029
2029
|
}
|
|
2030
2030
|
</style>
|
|
2031
|
-
`}var No=class extends Li{};No.shadowRootOptions={mode:"open"};No.getTemplateHTML=aU;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",No);var RR=i=>{throw TypeError(i)},ay=(i,e,t)=>e.has(i)||RR("Cannot "+t),_e=(i,e,t)=>(ay(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(i,e,t)=>e.has(i)?RR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ei=(i,e,t,s)=>(ay(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(ay(i,e,"access private method"),t),Dm=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Dm{}globalThis.DocumentFragment=i}var oy=class extends Dm{},oU=class extends Dm{},lU={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(oy)}},Em,dU=class{constructor(i,e={}){wt(this,Em),Ei(this,Em,e==null?void 0:e.detail)}get detail(){return _e(this,Em)}initCustomEvent(){}};Em=new WeakMap;function uU(i,e){return new oy}var LR={document:{createElement:uU},DocumentFragment,customElements:lU,CustomEvent:dU,EventTarget:Dm,HTMLElement:oy,HTMLVideoElement:oU},xR=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Gs=xR?LR:globalThis,Am=xR?LR.document:globalThis.document;function cU(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${iy(t)}: ${s}; `)}),e?e.trim():void 0}function iy(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function kR(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Zt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function DR(i){let e=hU(i).toString();return e?"?"+e:""}function hU(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var CR=(i,e)=>!i||!e?!1:i.contains(e)?!0:CR(i,e.getRootNode().host),wR="mux.com",fU=()=>{try{return"3.
|
|
2031
|
+
`}var No=class extends Li{};No.shadowRootOptions={mode:"open"};No.getTemplateHTML=aU;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",No);var RR=i=>{throw TypeError(i)},ay=(i,e,t)=>e.has(i)||RR("Cannot "+t),_e=(i,e,t)=>(ay(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(i,e,t)=>e.has(i)?RR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ei=(i,e,t,s)=>(ay(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(ay(i,e,"access private method"),t),Dm=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Dm{}globalThis.DocumentFragment=i}var oy=class extends Dm{},oU=class extends Dm{},lU={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(oy)}},Em,dU=class{constructor(i,e={}){wt(this,Em),Ei(this,Em,e==null?void 0:e.detail)}get detail(){return _e(this,Em)}initCustomEvent(){}};Em=new WeakMap;function uU(i,e){return new oy}var LR={document:{createElement:uU},DocumentFragment,customElements:lU,CustomEvent:dU,EventTarget:Dm,HTMLElement:oy,HTMLVideoElement:oU},xR=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Gs=xR?LR:globalThis,Am=xR?LR.document:globalThis.document;function cU(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${iy(t)}: ${s}; `)}),e?e.trim():void 0}function iy(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function kR(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Zt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function DR(i){let e=hU(i).toString();return e?"?"+e:""}function hU(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var CR=(i,e)=>!i||!e?!1:i.contains(e)?!0:CR(i,e.getRootNode().host),wR="mux.com",fU=()=>{try{return"3.14.0"}catch{}return"UNKNOWN"},mU=fU(),MR=()=>mU,pU=(i,{token:e,customDomain:t=wR,thumbnailTime:s,programTime:r}={})=>{var n;let a=e==null?s:void 0,{aud:o}=(n=kr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${DR({token:e,time:a,program_time:r})}`},gU=(i,{token:e,customDomain:t=wR,programStartTime:s,programEndTime:r}={})=>{var n;let{aud:a}=(n=kr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${DR({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},ly=i=>{if(i){if([$e.LIVE,$e.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return $e.LIVE}},vU={crossorigin:"crossOrigin",playsinline:"playsInline"};function EU(i){var e;return(e=vU[i])!=null?e:kR(i)}var Uo,Fo,gi,yU=class{constructor(i,e){wt(this,Uo),wt(this,Fo),wt(this,gi,[]),Ei(this,Uo,i),Ei(this,Fo,e)}[Symbol.iterator](){return _e(this,gi).values()}get length(){return _e(this,gi).length}get value(){var i;return(i=_e(this,gi).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Ei(this,gi,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return _e(this,gi)[i]}values(){return _e(this,gi).values()}keys(){return _e(this,gi).keys()}forEach(i){_e(this,gi).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||_e(this,gi).push(s)}),!(this.value===""&&!((e=_e(this,Uo))!=null&&e.hasAttribute(`${_e(this,Fo)}`)))&&((t=_e(this,Uo))==null||t.setAttribute(`${_e(this,Fo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{_e(this,gi).splice(_e(this,gi).indexOf(t),1)}),(e=_e(this,Uo))==null||e.setAttribute(`${_e(this,Fo)}`,`${this.value}`)}contains(i){return _e(this,gi).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)}};Uo=new WeakMap,Fo=new WeakMap,gi=new WeakMap;var PR=`[mux-player ${MR()}]`;function pr(...i){console.warn(PR,...i)}function vi(...i){console.error(PR,...i)}function hR(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ne("Read more: ")}
|
|
2032
2032
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),pr(t)}var Qt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},un={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},qH={...Qt,...un},fR=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}}),bU=Object.values(Qt).filter(i=>Qt.PLAYSINLINE!==i),TU=Object.values(un),_U=[...bU,...TU],AU=class extends Gs.HTMLElement{static get observedAttributes(){return _U}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case un.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case un.VOLUME:{let n=(s=Zt(t))!=null?s:1;this.media&&(this.media.volume=n);return}case un.PLAYBACKRATE:{let n=(r=Zt(t))!=null?r: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:fR}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:fR}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=Zt(this.getAttribute(un.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(un.PLAYBACKRATE,`${i}`):this.removeAttribute(un.PLAYBACKRATE)}get crossOrigin(){return Zd(this,Qt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Qt.CROSSORIGIN,`${i}`)}get autoplay(){return Zd(this,Qt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Qt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Qt.AUTOPLAY)}get loop(){return Zd(this,Qt.LOOP)!=null}set loop(i){i?this.setAttribute(Qt.LOOP,""):this.removeAttribute(Qt.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 Zd(this,Qt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Qt.MUTED,""):this.removeAttribute(Qt.MUTED)}get playsInline(){return Zd(this,Qt.PLAYSINLINE)!=null}set playsInline(i){vi("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(Qt.PRELOAD,i):this.removeAttribute(Qt.PRELOAD)}};function Zd(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var mR=AU,SU=`:host {
|
|
2033
2033
|
--media-control-display: var(--controls);
|
|
2034
2034
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.mjs
CHANGED
|
@@ -108,7 +108,7 @@ Schedule: ${l.map(p=>bi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
108
108
|
<video${zA(i)}></video>
|
|
109
109
|
</slot>
|
|
110
110
|
<slot></slot>
|
|
111
|
-
`}function jA(i,{tag:e,is:t}){var n,a,o,l,d,VA,c,h,f,m,p,g,Rn,V0,W0,WA,q0,qA,YA;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?kO(s):[];return o=class extends i{constructor(){super(...arguments);fe(this,g);fe(this,c,!1);fe(this,h,null);fe(this,f,new Map);fe(this,m);fe(this,p);Pe(this,"get");Pe(this,"set");Pe(this,"call")}static get observedAttributes(){var D,w,N;return je(D=o,d,VA).call(D),[...(N=(w=s==null?void 0:s.constructor)==null?void 0:w.observedAttributes)!=null?N:[],...KA]}get nativeEl(){var R,D,w,N,$;return je(this,g,Rn).call(this),($=(N=(D=(R=M(this,h))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?D:this.querySelector(e))!=null?N:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?$:null}set nativeEl(R){le(this,h,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,D;return(D=this.getAttribute("preload"))!=null?D:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let R=DO(this.attributes);t&&(R.is=t),e&&(R.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(R)}this.nativeEl.muted=this.hasAttribute("muted");for(let R of r)je(this,g,qA).call(this,R);je(this,g,V0).call(this)}handleEvent(R){R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,D,w){je(this,g,Rn).call(this),je(this,g,YA).call(this,R,D,w)}connectedCallback(){je(this,g,Rn).call(this),M(this,p)||je(this,g,V0).call(this)}disconnectedCallback(){var R,D,w;(R=M(this,m))==null||R.disconnect(),le(this,m,void 0),M(this,p)&&((D=this.shadowRoot)==null||D.removeEventListener("slotchange",M(this,p)),le(this,p,void 0));for(let N of this.constructor.Events)(w=this.shadowRoot)==null||w.removeEventListener(N,this,!0);M(this,f).forEach(N=>N.remove()),M(this,f).clear(),le(this,h,null)}},l=new WeakMap,d=new WeakSet,VA=function(){if(M(this,l))return;le(this,l,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let D of r)if(!(D in this.prototype))if(typeof s[D]=="function")this.prototype[D]=function(...w){return je(this,g,Rn).call(this),(()=>{var H;if(this.call)return this.call(D,...w);let $=(H=this.nativeEl)==null?void 0:H[D];return $==null?void 0:$.apply(this.nativeEl,w)})()};else{let w={get(){var $,H,O;je(this,g,Rn).call(this);let N=D.toLowerCase();if(R.has(N)){let F=this.getAttribute(N);return F===null?!1:F===""?!0:F}return(O=($=this.get)==null?void 0:$.call(this,D))!=null?O:(H=this.nativeEl)==null?void 0:H[D]}};D!==D.toUpperCase()&&(w.set=function(N){je(this,g,Rn).call(this);let $=D.toLowerCase();if(R.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(D,N);return}this.nativeEl&&(this.nativeEl[D]=N)}),Object.defineProperty(this.prototype,D,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,Rn=function(){M(this,c)||(le(this,c,!0),this.init())},V0=function(){var R,D;le(this,m,new MutationObserver(je(this,g,WA).bind(this))),le(this,p,()=>je(this,g,W0).call(this)),(R=this.shadowRoot)==null||R.addEventListener("slotchange",M(this,p)),je(this,g,W0).call(this);for(let w of this.constructor.Events)(D=this.shadowRoot)==null||D.addEventListener(w,this,!0)},W0=function(){var N;let R=new Map(M(this,f)),D=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(D==null?void 0:D.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var O,F;R.delete($);let H=M(this,f).get($);H||(H=$.cloneNode(),M(this,f).set($,H),(O=M(this,m))==null||O.observe($,{attributes:!0})),(F=this.nativeEl)==null||F.append(H),je(this,g,q0).call(this,H)}),R.forEach(($,H)=>{$.remove(),M(this,f).delete(H)})},WA=function(R){var D;for(let w of R)if(w.type==="attributes"){let{target:N,attributeName:$}=w,H=M(this,f).get(N);H&&$&&(H.setAttribute($,(D=N.getAttribute($))!=null?D:""),je(this,g,q0).call(this,H))}},q0=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},qA=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let D=this[R];delete this[R],this[R]=D}},YA=function(R,D,w){var N,$,H;["id","class"].includes(R)||!o.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(w===null?(N=this.nativeEl)==null||N.removeAttribute(R):(($=this.nativeEl)==null?void 0:$.getAttribute(R))!==w&&((H=this.nativeEl)==null||H.setAttribute(R,w)))},fe(o,d),Pe(o,"getTemplateHTML",e.endsWith("audio")?LO:xO),Pe(o,"shadowRootOptions",{mode:"open"}),Pe(o,"Events",GA),fe(o,l,!1),o}function kO(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);e.push(...s)}return e}function zA(i){let e="";for(let t in i){if(!KA.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function DO(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $A,Ml=jA(($A=globalThis.HTMLElement)!=null?$A:class{},{tag:"video"}),HA,_F=jA((HA=globalThis.HTMLElement)!=null?HA:class{},{tag:"audio"});var ZA=i=>{throw TypeError(i)},Y0=(i,e,t)=>e.has(i)||ZA("Cannot "+t),At=(i,e,t)=>(Y0(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>e.has(i)?ZA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zi=(i,e,t,s)=>(Y0(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wc=(i,e,t)=>(Y0(i,e,"access private method"),t),CO=()=>{try{return"0.31.
|
|
111
|
+
`}function jA(i,{tag:e,is:t}){var n,a,o,l,d,VA,c,h,f,m,p,g,Rn,V0,W0,WA,q0,qA,YA;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?kO(s):[];return o=class extends i{constructor(){super(...arguments);fe(this,g);fe(this,c,!1);fe(this,h,null);fe(this,f,new Map);fe(this,m);fe(this,p);Pe(this,"get");Pe(this,"set");Pe(this,"call")}static get observedAttributes(){var D,w,N;return je(D=o,d,VA).call(D),[...(N=(w=s==null?void 0:s.constructor)==null?void 0:w.observedAttributes)!=null?N:[],...KA]}get nativeEl(){var R,D,w,N,$;return je(this,g,Rn).call(this),($=(N=(D=(R=M(this,h))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?D:this.querySelector(e))!=null?N:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?$:null}set nativeEl(R){le(this,h,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,D;return(D=this.getAttribute("preload"))!=null?D:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let R=DO(this.attributes);t&&(R.is=t),e&&(R.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(R)}this.nativeEl.muted=this.hasAttribute("muted");for(let R of r)je(this,g,qA).call(this,R);je(this,g,V0).call(this)}handleEvent(R){R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,D,w){je(this,g,Rn).call(this),je(this,g,YA).call(this,R,D,w)}connectedCallback(){je(this,g,Rn).call(this),M(this,p)||je(this,g,V0).call(this)}disconnectedCallback(){var R,D,w;(R=M(this,m))==null||R.disconnect(),le(this,m,void 0),M(this,p)&&((D=this.shadowRoot)==null||D.removeEventListener("slotchange",M(this,p)),le(this,p,void 0));for(let N of this.constructor.Events)(w=this.shadowRoot)==null||w.removeEventListener(N,this,!0);M(this,f).forEach(N=>N.remove()),M(this,f).clear(),le(this,h,null)}},l=new WeakMap,d=new WeakSet,VA=function(){if(M(this,l))return;le(this,l,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let D of r)if(!(D in this.prototype))if(typeof s[D]=="function")this.prototype[D]=function(...w){return je(this,g,Rn).call(this),(()=>{var H;if(this.call)return this.call(D,...w);let $=(H=this.nativeEl)==null?void 0:H[D];return $==null?void 0:$.apply(this.nativeEl,w)})()};else{let w={get(){var $,H,O;je(this,g,Rn).call(this);let N=D.toLowerCase();if(R.has(N)){let F=this.getAttribute(N);return F===null?!1:F===""?!0:F}return(O=($=this.get)==null?void 0:$.call(this,D))!=null?O:(H=this.nativeEl)==null?void 0:H[D]}};D!==D.toUpperCase()&&(w.set=function(N){je(this,g,Rn).call(this);let $=D.toLowerCase();if(R.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(D,N);return}this.nativeEl&&(this.nativeEl[D]=N)}),Object.defineProperty(this.prototype,D,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,Rn=function(){M(this,c)||(le(this,c,!0),this.init())},V0=function(){var R,D;le(this,m,new MutationObserver(je(this,g,WA).bind(this))),le(this,p,()=>je(this,g,W0).call(this)),(R=this.shadowRoot)==null||R.addEventListener("slotchange",M(this,p)),je(this,g,W0).call(this);for(let w of this.constructor.Events)(D=this.shadowRoot)==null||D.addEventListener(w,this,!0)},W0=function(){var N;let R=new Map(M(this,f)),D=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(D==null?void 0:D.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var O,F;R.delete($);let H=M(this,f).get($);H||(H=$.cloneNode(),M(this,f).set($,H),(O=M(this,m))==null||O.observe($,{attributes:!0})),(F=this.nativeEl)==null||F.append(H),je(this,g,q0).call(this,H)}),R.forEach(($,H)=>{$.remove(),M(this,f).delete(H)})},WA=function(R){var D;for(let w of R)if(w.type==="attributes"){let{target:N,attributeName:$}=w,H=M(this,f).get(N);H&&$&&(H.setAttribute($,(D=N.getAttribute($))!=null?D:""),je(this,g,q0).call(this,H))}},q0=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},qA=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let D=this[R];delete this[R],this[R]=D}},YA=function(R,D,w){var N,$,H;["id","class"].includes(R)||!o.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(w===null?(N=this.nativeEl)==null||N.removeAttribute(R):(($=this.nativeEl)==null?void 0:$.getAttribute(R))!==w&&((H=this.nativeEl)==null||H.setAttribute(R,w)))},fe(o,d),Pe(o,"getTemplateHTML",e.endsWith("audio")?LO:xO),Pe(o,"shadowRootOptions",{mode:"open"}),Pe(o,"Events",GA),fe(o,l,!1),o}function kO(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);e.push(...s)}return e}function zA(i){let e="";for(let t in i){if(!KA.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function DO(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $A,Ml=jA(($A=globalThis.HTMLElement)!=null?$A:class{},{tag:"video"}),HA,_F=jA((HA=globalThis.HTMLElement)!=null?HA:class{},{tag:"audio"});var ZA=i=>{throw TypeError(i)},Y0=(i,e,t)=>e.has(i)||ZA("Cannot "+t),At=(i,e,t)=>(Y0(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>e.has(i)?ZA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zi=(i,e,t,s)=>(Y0(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wc=(i,e,t)=>(Y0(i,e,"access private method"),t),CO=()=>{try{return"0.31.5"}catch{}return"UNKNOWN"},wO=CO(),MO=()=>wO,PO=`
|
|
112
112
|
<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>`,C={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",MAX_RECONNECT_RETRIES:"max-reconnect-retries",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",MAX_AUTO_RESOLUTION:"max-auto-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",CAP_RENDITION_TO_PLAYER_SIZE:"cap-rendition-to-player-size",INITIAL_BANDWIDTH_ESTIMATE_KBPS:"initial-bandwidth-estimate-kbps",INITIAL_ESTIMATE_SEGMENTS:"initial-estimate-segments",MIN_PRELOAD_SEGMENTS:"min-preload-segments"},OO=Object.values(C),QA=MO(),XA="mux-video",Pl,Mc,Ol,Pc,Oc,Nc,Uc,Fc,Nl,Bc,Si,Dr,$c,Ul,JA=class extends Ml{constructor(){super(),Mi(this,Si),Mi(this,Pl),Mi(this,Mc),Mi(this,Ol,{}),Mi(this,Pc,{}),Mi(this,Oc),Mi(this,Nc),Mi(this,Uc),Mi(this,Fc),Mi(this,Nl,""),Mi(this,Bc,i=>{var e;let t=LA(this.nativeEl),s=(e=this.metadata)!=null?e:{};this.metadata={...t,...s},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(zi(this,Nl,"default"),this.updateLogo())}),Mi(this,$c),zi(this,Mc,xc())}static get NAME(){return XA}static get VERSION(){return QA}static get observedAttributes(){var i;return[...OO,...(i=Ml.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?PO:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
113
113
|
${Ml.getTemplateHTML(i)}
|
|
114
114
|
<style>
|
|
@@ -2028,7 +2028,7 @@ Schedule: ${l.map(p=>bi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2028
2028
|
min-height: var(--media-control-height, 24px);
|
|
2029
2029
|
}
|
|
2030
2030
|
</style>
|
|
2031
|
-
`}var No=class extends Li{};No.shadowRootOptions={mode:"open"};No.getTemplateHTML=aU;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",No);var RR=i=>{throw TypeError(i)},ay=(i,e,t)=>e.has(i)||RR("Cannot "+t),_e=(i,e,t)=>(ay(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(i,e,t)=>e.has(i)?RR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ei=(i,e,t,s)=>(ay(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(ay(i,e,"access private method"),t),Dm=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Dm{}globalThis.DocumentFragment=i}var oy=class extends Dm{},oU=class extends Dm{},lU={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(oy)}},Em,dU=class{constructor(i,e={}){wt(this,Em),Ei(this,Em,e==null?void 0:e.detail)}get detail(){return _e(this,Em)}initCustomEvent(){}};Em=new WeakMap;function uU(i,e){return new oy}var LR={document:{createElement:uU},DocumentFragment,customElements:lU,CustomEvent:dU,EventTarget:Dm,HTMLElement:oy,HTMLVideoElement:oU},xR=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Gs=xR?LR:globalThis,Am=xR?LR.document:globalThis.document;function cU(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${iy(t)}: ${s}; `)}),e?e.trim():void 0}function iy(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function kR(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Zt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function DR(i){let e=hU(i).toString();return e?"?"+e:""}function hU(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var CR=(i,e)=>!i||!e?!1:i.contains(e)?!0:CR(i,e.getRootNode().host),wR="mux.com",fU=()=>{try{return"3.
|
|
2031
|
+
`}var No=class extends Li{};No.shadowRootOptions={mode:"open"};No.getTemplateHTML=aU;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",No);var RR=i=>{throw TypeError(i)},ay=(i,e,t)=>e.has(i)||RR("Cannot "+t),_e=(i,e,t)=>(ay(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(i,e,t)=>e.has(i)?RR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ei=(i,e,t,s)=>(ay(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(ay(i,e,"access private method"),t),Dm=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Dm{}globalThis.DocumentFragment=i}var oy=class extends Dm{},oU=class extends Dm{},lU={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(oy)}},Em,dU=class{constructor(i,e={}){wt(this,Em),Ei(this,Em,e==null?void 0:e.detail)}get detail(){return _e(this,Em)}initCustomEvent(){}};Em=new WeakMap;function uU(i,e){return new oy}var LR={document:{createElement:uU},DocumentFragment,customElements:lU,CustomEvent:dU,EventTarget:Dm,HTMLElement:oy,HTMLVideoElement:oU},xR=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Gs=xR?LR:globalThis,Am=xR?LR.document:globalThis.document;function cU(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${iy(t)}: ${s}; `)}),e?e.trim():void 0}function iy(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function kR(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Zt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function DR(i){let e=hU(i).toString();return e?"?"+e:""}function hU(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var CR=(i,e)=>!i||!e?!1:i.contains(e)?!0:CR(i,e.getRootNode().host),wR="mux.com",fU=()=>{try{return"3.14.0"}catch{}return"UNKNOWN"},mU=fU(),MR=()=>mU,pU=(i,{token:e,customDomain:t=wR,thumbnailTime:s,programTime:r}={})=>{var n;let a=e==null?s:void 0,{aud:o}=(n=kr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${DR({token:e,time:a,program_time:r})}`},gU=(i,{token:e,customDomain:t=wR,programStartTime:s,programEndTime:r}={})=>{var n;let{aud:a}=(n=kr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${DR({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},ly=i=>{if(i){if([$e.LIVE,$e.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return $e.LIVE}},vU={crossorigin:"crossOrigin",playsinline:"playsInline"};function EU(i){var e;return(e=vU[i])!=null?e:kR(i)}var Uo,Fo,gi,yU=class{constructor(i,e){wt(this,Uo),wt(this,Fo),wt(this,gi,[]),Ei(this,Uo,i),Ei(this,Fo,e)}[Symbol.iterator](){return _e(this,gi).values()}get length(){return _e(this,gi).length}get value(){var i;return(i=_e(this,gi).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Ei(this,gi,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return _e(this,gi)[i]}values(){return _e(this,gi).values()}keys(){return _e(this,gi).keys()}forEach(i){_e(this,gi).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||_e(this,gi).push(s)}),!(this.value===""&&!((e=_e(this,Uo))!=null&&e.hasAttribute(`${_e(this,Fo)}`)))&&((t=_e(this,Uo))==null||t.setAttribute(`${_e(this,Fo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{_e(this,gi).splice(_e(this,gi).indexOf(t),1)}),(e=_e(this,Uo))==null||e.setAttribute(`${_e(this,Fo)}`,`${this.value}`)}contains(i){return _e(this,gi).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)}};Uo=new WeakMap,Fo=new WeakMap,gi=new WeakMap;var PR=`[mux-player ${MR()}]`;function pr(...i){console.warn(PR,...i)}function vi(...i){console.error(PR,...i)}function hR(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ne("Read more: ")}
|
|
2032
2032
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),pr(t)}var Qt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},un={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},qH={...Qt,...un},fR=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}}),bU=Object.values(Qt).filter(i=>Qt.PLAYSINLINE!==i),TU=Object.values(un),_U=[...bU,...TU],AU=class extends Gs.HTMLElement{static get observedAttributes(){return _U}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case un.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case un.VOLUME:{let n=(s=Zt(t))!=null?s:1;this.media&&(this.media.volume=n);return}case un.PLAYBACKRATE:{let n=(r=Zt(t))!=null?r: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:fR}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:fR}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=Zt(this.getAttribute(un.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(un.PLAYBACKRATE,`${i}`):this.removeAttribute(un.PLAYBACKRATE)}get crossOrigin(){return Zd(this,Qt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Qt.CROSSORIGIN,`${i}`)}get autoplay(){return Zd(this,Qt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Qt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Qt.AUTOPLAY)}get loop(){return Zd(this,Qt.LOOP)!=null}set loop(i){i?this.setAttribute(Qt.LOOP,""):this.removeAttribute(Qt.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 Zd(this,Qt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Qt.MUTED,""):this.removeAttribute(Qt.MUTED)}get playsInline(){return Zd(this,Qt.PLAYSINLINE)!=null}set playsInline(i){vi("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(Qt.PRELOAD,i):this.removeAttribute(Qt.PRELOAD)}};function Zd(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var mR=AU,SU=`:host {
|
|
2033
2033
|
--media-control-display: var(--controls);
|
|
2034
2034
|
--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.14.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.31.
|
|
129
|
-
"@mux/playback-core": "0.
|
|
128
|
+
"@mux/mux-video": "0.31.5",
|
|
129
|
+
"@mux/playback-core": "0.36.0",
|
|
130
130
|
"media-chrome": "~4.19.3",
|
|
131
131
|
"player.style": "^0.3.0"
|
|
132
132
|
},
|