@mux/mux-player 3.13.3-canary.2 → 3.13.3
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
|
@@ -1408,7 +1408,7 @@
|
|
|
1408
1408
|
<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"/>
|
|
1409
1409
|
</svg>
|
|
1410
1410
|
</div>
|
|
1411
|
-
`}function Sv(){return c("Loop")}var Yr=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)}};Yr.getSlotTemplateHTML=kv;Yr.getTooltipContentHTML=Sv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Yr);var E=require("@mux/mux-video/base"),O=require("@mux/playback-core");var Lm=require("@mux/playback-core");var ki=require("@mux/playback-core");function ym(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${ss(i)}: ${a}; `)}),e?e.trim():void 0}function ss(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ls(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 hd(t){let e=Iv(t).toString();return e?"?"+e:""}function Iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var pd=(t,e)=>!t||!e?!1:t.contains(e)?!0:pd(t,e.getRootNode().host);var km="mux.com",Mv=()=>{try{return"3.13.
|
|
1411
|
+
`}function Sv(){return c("Loop")}var Yr=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)}};Yr.getSlotTemplateHTML=kv;Yr.getTooltipContentHTML=Sv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Yr);var E=require("@mux/mux-video/base"),O=require("@mux/playback-core");var Lm=require("@mux/playback-core");var ki=require("@mux/playback-core");function ym(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${ss(i)}: ${a}; `)}),e?e.trim():void 0}function ss(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ls(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 hd(t){let e=Iv(t).toString();return e?"?"+e:""}function Iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var pd=(t,e)=>!t||!e?!1:t.contains(e)?!0:pd(t,e.getRootNode().host);var km="mux.com",Mv=()=>{try{return"3.13.3"}catch{}return"UNKNOWN"},Lv=Mv(),us=()=>Lv,Sm=(t,{token:e,customDomain:i=km,thumbnailTime:a,programTime:r}={})=>{var d;let n=e==null?a:void 0,{aud:s}=(d=(0,ki.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${hd({token:e,time:n,program_time:r})}`},Im=(t,{token:e,customDomain:i=km,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ki.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${hd({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},qr=t=>{if(t){if([ki.StreamTypes.LIVE,ki.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ki.StreamTypes.LIVE}};var Cv={crossorigin:"crossOrigin",playsinline:"playsInline"};function Mm(t){var e;return(e=Cv[t])!=null?e:ls(t)}var Ti,yi,Ee,ds=class{constructor(e,i){X(this,Ti);X(this,yi);X(this,Ee,[]);ue(this,Ti,e),ue(this,yi,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,Ti))!=null&&i.hasAttribute(`${C(this,yi)}`)))&&((a=C(this,Ti))==null||a.setAttribute(`${C(this,yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{C(this,Ee).splice(C(this,Ee).indexOf(a),1)}),(i=C(this,Ti))==null||i.setAttribute(`${C(this,yi)}`,`${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)}};Ti=new WeakMap,yi=new WeakMap,Ee=new WeakMap;var Cm=`[mux-player ${us()}]`;function mt(...t){console.warn(Cm,...t)}function pe(...t){console.error(Cm,...t)}function fd(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Lm.i18n)("Read more: ")}
|
|
1412
1412
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),mt(e)}var he={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Xt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},OA={...he,...Xt},Rm=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}}),wv=Object.values(he).filter(t=>he.PLAYSINLINE!==t),Rv=Object.values(Xt),xv=[...wv,...Rv],vd=class extends Se.HTMLElement{static get observedAttributes(){return xv}constructor(){super()}attributeChangedCallback(e,i,a){var r,n;switch(e){case Xt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Xt.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Xt.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:Rm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Rm}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(Xt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Xt.PLAYBACKRATE,`${e}`):this.removeAttribute(Xt.PLAYBACKRATE)}get crossOrigin(){return Zr(this,he.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(he.CROSSORIGIN,`${e}`)}get autoplay(){return Zr(this,he.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(he.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(he.AUTOPLAY)}get loop(){return Zr(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 Zr(this,he.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(he.MUTED,""):this.removeAttribute(he.MUTED)}get playsInline(){return Zr(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 Zr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Ed=vd;var Pm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(Pm(t,e,"read from private field"),i?i.call(t):e.get(t)),ht=(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)},Lt=(t,e,i,a)=>(Pm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),va,cs,Si,zr,Jt,jt,ei,Ii,Ea,ms,Ze,xm=1,Dm=0,Dv=1,Ov={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}}}},Ct=class extends l.DocumentFragment{constructor(e,i,a=Ov){var r;super(),ht(this,va,void 0),ht(this,cs,void 0),this.append(e.content.cloneNode(!0)),Lt(this,va,Um(this)),Lt(this,cs,a),(r=a.createCallback)==null||r.call(a,this,P(this,va),i),a.processCallback(this,P(this,va),i)}update(e){P(this,cs).processCallback(this,P(this,va),e)}};va=new WeakMap;cs=new WeakMap;var Um=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new bd;for([i,a]of Nm(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===xm&&!(r instanceof HTMLTemplateElement))Um(r,e);else{let n=r.data;if(r.nodeType===xm||n.includes("{{")){let s=[];if(n)for([i,a]of Nm(n))if(!i)s.push(new Text(a));else{let d=new wt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Qr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},Om={},Nm=t=>{let e="",i=0,a=Om[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([Dm,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([Dv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Dm,(i>0?"{{":"")+e]),Om[t]=a},Nv=11,hs=class{get value(){return""}set value(e){}toString(){return this.value}},Hm=new WeakMap,bd=class{constructor(){ht(this,Si,[])}[Symbol.iterator](){return P(this,Si).values()}get length(){return P(this,Si).length}item(e){return P(this,Si)[e]}append(...e){for(let i of e)i instanceof be&&Hm.set(i,this),P(this,Si).push(i)}toString(){return P(this,Si).join("")}};Si=new WeakMap;var be=class extends hs{constructor(e,i,a){super(),ht(this,Ii),ht(this,zr,""),ht(this,Jt,void 0),ht(this,jt,void 0),ht(this,ei,void 0),Lt(this,Jt,e),Lt(this,jt,i),Lt(this,ei,a)}get attributeName(){return P(this,jt)}get attributeNamespace(){return P(this,ei)}get element(){return P(this,Jt)}get value(){return P(this,zr)}set value(e){P(this,zr)!==e&&(Lt(this,zr,e),!P(this,Ii,Ea)||P(this,Ii,Ea).length===1?e==null?P(this,Jt).removeAttributeNS(P(this,ei),P(this,jt)):P(this,Jt).setAttributeNS(P(this,ei),P(this,jt),e):P(this,Jt).setAttributeNS(P(this,ei),P(this,jt),P(this,Ii,Ea).toString()))}get booleanValue(){return P(this,Jt).hasAttributeNS(P(this,ei),P(this,jt))}set booleanValue(e){if(!P(this,Ii,Ea)||P(this,Ii,Ea).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};zr=new WeakMap;Jt=new WeakMap;jt=new WeakMap;ei=new WeakMap;Ii=new WeakSet;Ea=function(){return Hm.get(this)};var wt=class extends hs{constructor(e,i){super(),ht(this,ms,void 0),ht(this,Ze,void 0),Lt(this,ms,e),Lt(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return P(this,Ze)}get parentNode(){return P(this,ms)}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===Nv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),Lt(this,Ze,Pv(P(this,Ze)[0].parentNode,P(this,Ze),i,this.nextSibling))}};ms=new WeakMap;Ze=new WeakMap;var Qr=class extends wt{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 Pv(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 Bm={string:t=>String(t)},fs=class{constructor(e){this.template=e,this.state=void 0}},Mi=new WeakMap,Li=new WeakMap,gd={partial:(t,e)=>{e[t.expression]=new fs(t.template)},if:(t,e)=>{var i;if(Wm(t.expression,e))if(Mi.get(t)!==t.template){Mi.set(t,t.template);let a=new Ct(t.template,e,vs);t.replace(a),Li.set(t,a)}else(i=Li.get(t))==null||i.update(e);else t.replace(""),Mi.delete(t),Li.delete(t)}},Uv=Object.keys(gd),vs={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Qr){if(!s.directive){let u=Uv.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=gd[s.directive])==null||a.call(gd,s,i);continue}let d=Wm(n,i);if(d instanceof fs){Mi.get(s)!==d.template?(Mi.set(s,d.template),d=new Ct(d.template,d.state,vs),s.value=d,Li.set(s,d)):(r=Li.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,Mi.delete(s),Li.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Mi.delete(s),Li.delete(s))}}},$m={"!":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=Bm[e])==null?void 0:i.call(Bm,t)}};function Hv(t){return Bv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Wm(t,e={}){var i,a,r,n,s,d,u;let f=Hv(t);if(f.length===0||f.some(({type:T})=>!T))return Xr(t);if(((i=f[0])==null?void 0:i.token)===">"){let T=e[(a=f[1])==null?void 0:a.token];if(!T)return Xr(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]=Jr(S,e))}return T}if(f.length===1)return ps(f[0])?Jr(f[0].token,e):Xr(t);if(f.length===2){let T=(d=f[0])==null?void 0:d.token,A=$m[T];if(!A||!ps(f[1]))return Xr(t);let b=Jr(f[1].token,e);return A(b)}if(f.length===3){let T=(u=f[1])==null?void 0:u.token,A=$m[T];if(!A||!ps(f[0])||!ps(f[2]))return Xr(t);let b=Jr(f[0].token,e);if(T==="|")return A(b,f[2].token);let p=Jr(f[2].token,e);return A(b,p)}}function Xr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ps({type:t}){return["number","boolean","string","param"].includes(t)}function Jr(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):Dn(t)?parseFloat(t):e[t]}function Bv(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 kd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ti=(t,e,i)=>(kd(t,e,"read from private field"),i?i.call(t):e.get(t)),Ci=(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)},Rt=(t,e,i,a)=>(kd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_d=(t,e,i)=>(kd(t,e,"access private method"),i),ga,Es,_a,ba,Td,Fm,bs,yd,jr,Ad={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Vm=V.createElement("template");Vm.innerHTML=`
|
|
1413
1413
|
<style>
|
|
1414
1414
|
: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.13.
|
|
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.13.3"}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
|
@@ -106,7 +106,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${m_(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function f_(i,{tag:e,is:t}){var n,a,o,l,d,d_,c,h,f,m,p,g,nn,Kg,Vg,u_,Wg,c_,h_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?qw(s):[];return o=class extends i{constructor(){super(...arguments);oe(this,g);oe(this,c,!1);oe(this,h,null);oe(this,f,new Map);oe(this,m);oe(this,p);Ie(this,"get");Ie(this,"set");Ie(this,"call")}static get observedAttributes(){var C,P,N;return Ue(C=o,d,d_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...l_]}get nativeEl(){var I,C,P,N,$;return Ue(this,g,nn).call(this),($=(N=(C=(I=w(this,h))!=null?I:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e))!=null?N:(P=this.shadowRoot)==null?void 0:P.querySelector(e))!=null?$:null}set nativeEl(I){ie(this,h,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I,C;return(C=this.getAttribute("preload"))!=null?C:(I=this.nativeEl)==null?void 0:I.preload}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=Yw(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of r)Ue(this,g,c_).call(this,I);Ue(this,g,Kg).call(this)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,C,P){Ue(this,g,nn).call(this),Ue(this,g,h_).call(this,I,C,P)}connectedCallback(){Ue(this,g,nn).call(this),w(this,p)||Ue(this,g,Kg).call(this)}disconnectedCallback(){var I,C,P;(I=w(this,m))==null||I.disconnect(),ie(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ie(this,p,void 0));for(let N of this.constructor.Events)(P=this.shadowRoot)==null||P.removeEventListener(N,this,!0);w(this,f).forEach(N=>N.remove()),w(this,f).clear(),ie(this,h,null)}},l=new WeakMap,d=new WeakSet,d_=function(){if(w(this,l))return;ie(this,l,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ue(this,g,nn).call(this),(()=>{var H;if(this.call)return this.call(C,...P);let $=(H=this.nativeEl)==null?void 0:H[C];return $==null?void 0:$.apply(this.nativeEl,P)})()};else{let P={get(){var $,H,U;Ue(this,g,nn).call(this);let N=C.toLowerCase();if(I.has(N)){let z=this.getAttribute(N);return z===null?!1:z===""?!0:z}return(U=($=this.get)==null?void 0:$.call(this,C))!=null?U:(H=this.nativeEl)==null?void 0:H[C]}};C!==C.toUpperCase()&&(P.set=function(N){Ue(this,g,nn).call(this);let $=C.toLowerCase();if(I.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(C,N);return}this.nativeEl&&(this.nativeEl[C]=N)}),Object.defineProperty(this.prototype,C,P)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,nn=function(){w(this,c)||(ie(this,c,!0),this.init())},Kg=function(){var I,C;ie(this,m,new MutationObserver(Ue(this,g,u_).bind(this))),ie(this,p,()=>Ue(this,g,Vg).call(this)),(I=this.shadowRoot)==null||I.addEventListener("slotchange",w(this,p)),Ue(this,g,Vg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Vg=function(){var N;let I=new Map(w(this,f)),C=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(C==null?void 0:C.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var U,z;I.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(z=this.nativeEl)==null||z.append(H),Ue(this,g,Wg).call(this,H)}),I.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},u_=function(I){var C;for(let P of I)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ue(this,g,Wg).call(this,H))}},Wg=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},c_=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let C=this[I];delete this[I],this[I]=C}},h_=function(I,C,P){var N,$,H;["id","class"].includes(I)||!o.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(I):(($=this.nativeEl)==null?void 0:$.getAttribute(I))!==P&&((H=this.nativeEl)==null||H.setAttribute(I,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Vw:Ww),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",o_),oe(o,l,!1),o}function qw(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 m_(i){let e="";for(let t in i){if(!l_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Yw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var n_,rl=f_((n_=globalThis.HTMLElement)!=null?n_:class{},{tag:"video"}),a_,U2=f_((a_=globalThis.HTMLElement)!=null?a_:class{},{tag:"audio"});var v_=i=>{throw TypeError(i)},qg=(i,e,t)=>e.has(i)||v_("Cannot "+t),lt=(i,e,t)=>(qg(i,e,"read from private field"),t?t.call(i):e.get(i)),Ei=(i,e,t)=>e.has(i)?v_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(qg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Qu=(i,e,t)=>(qg(i,e,"access private method"),t),jw=()=>{try{return"0.31.
|
|
109
|
+
`}function f_(i,{tag:e,is:t}){var n,a,o,l,d,d_,c,h,f,m,p,g,nn,Kg,Vg,u_,Wg,c_,h_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?qw(s):[];return o=class extends i{constructor(){super(...arguments);oe(this,g);oe(this,c,!1);oe(this,h,null);oe(this,f,new Map);oe(this,m);oe(this,p);Ie(this,"get");Ie(this,"set");Ie(this,"call")}static get observedAttributes(){var C,P,N;return Ue(C=o,d,d_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...l_]}get nativeEl(){var I,C,P,N,$;return Ue(this,g,nn).call(this),($=(N=(C=(I=w(this,h))!=null?I:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e))!=null?N:(P=this.shadowRoot)==null?void 0:P.querySelector(e))!=null?$:null}set nativeEl(I){ie(this,h,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I,C;return(C=this.getAttribute("preload"))!=null?C:(I=this.nativeEl)==null?void 0:I.preload}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=Yw(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of r)Ue(this,g,c_).call(this,I);Ue(this,g,Kg).call(this)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,C,P){Ue(this,g,nn).call(this),Ue(this,g,h_).call(this,I,C,P)}connectedCallback(){Ue(this,g,nn).call(this),w(this,p)||Ue(this,g,Kg).call(this)}disconnectedCallback(){var I,C,P;(I=w(this,m))==null||I.disconnect(),ie(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ie(this,p,void 0));for(let N of this.constructor.Events)(P=this.shadowRoot)==null||P.removeEventListener(N,this,!0);w(this,f).forEach(N=>N.remove()),w(this,f).clear(),ie(this,h,null)}},l=new WeakMap,d=new WeakSet,d_=function(){if(w(this,l))return;ie(this,l,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ue(this,g,nn).call(this),(()=>{var H;if(this.call)return this.call(C,...P);let $=(H=this.nativeEl)==null?void 0:H[C];return $==null?void 0:$.apply(this.nativeEl,P)})()};else{let P={get(){var $,H,U;Ue(this,g,nn).call(this);let N=C.toLowerCase();if(I.has(N)){let z=this.getAttribute(N);return z===null?!1:z===""?!0:z}return(U=($=this.get)==null?void 0:$.call(this,C))!=null?U:(H=this.nativeEl)==null?void 0:H[C]}};C!==C.toUpperCase()&&(P.set=function(N){Ue(this,g,nn).call(this);let $=C.toLowerCase();if(I.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(C,N);return}this.nativeEl&&(this.nativeEl[C]=N)}),Object.defineProperty(this.prototype,C,P)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,nn=function(){w(this,c)||(ie(this,c,!0),this.init())},Kg=function(){var I,C;ie(this,m,new MutationObserver(Ue(this,g,u_).bind(this))),ie(this,p,()=>Ue(this,g,Vg).call(this)),(I=this.shadowRoot)==null||I.addEventListener("slotchange",w(this,p)),Ue(this,g,Vg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Vg=function(){var N;let I=new Map(w(this,f)),C=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(C==null?void 0:C.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var U,z;I.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(z=this.nativeEl)==null||z.append(H),Ue(this,g,Wg).call(this,H)}),I.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},u_=function(I){var C;for(let P of I)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ue(this,g,Wg).call(this,H))}},Wg=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},c_=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let C=this[I];delete this[I],this[I]=C}},h_=function(I,C,P){var N,$,H;["id","class"].includes(I)||!o.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(I):(($=this.nativeEl)==null?void 0:$.getAttribute(I))!==P&&((H=this.nativeEl)==null||H.setAttribute(I,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Vw:Ww),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",o_),oe(o,l,!1),o}function qw(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 m_(i){let e="";for(let t in i){if(!l_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Yw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var n_,rl=f_((n_=globalThis.HTMLElement)!=null?n_:class{},{tag:"video"}),a_,U2=f_((a_=globalThis.HTMLElement)!=null?a_:class{},{tag:"audio"});var v_=i=>{throw TypeError(i)},qg=(i,e,t)=>e.has(i)||v_("Cannot "+t),lt=(i,e,t)=>(qg(i,e,"read from private field"),t?t.call(i):e.get(i)),Ei=(i,e,t)=>e.has(i)?v_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(qg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Qu=(i,e,t)=>(qg(i,e,"access private method"),t),jw=()=>{try{return"0.31.3"}catch{}return"UNKNOWN"},zw=jw(),Qw=()=>zw,Xw=`
|
|
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>`,k={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"},Zw=Object.values(k),p_=Qw(),g_="mux-video",nl,Xu,al,Zu,Ju,ec,tc,ic,ol,sc,ui,ur,rc,ll,E_=class extends rl{constructor(){super(),Ei(this,ui),Ei(this,nl),Ei(this,Xu),Ei(this,al,{}),Ei(this,Zu,{}),Ei(this,Ju),Ei(this,ec),Ei(this,tc),Ei(this,ic),Ei(this,ol,""),Ei(this,sc,i=>{var e;let t=qb(this.nativeEl),s=(e=this.metadata)!=null?e:{};this.metadata={...t,...s},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Pi(this,ol,"default"),this.updateLogo())}),Ei(this,rc),Pi(this,Xu,qu())}static get NAME(){return g_}static get VERSION(){return p_}static get observedAttributes(){var i;return[...Zw,...(i=rl.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?Xw:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${rl.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -2020,7 +2020,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2020
2020
|
min-height: var(--media-control-height, 24px);
|
|
2021
2021
|
}
|
|
2022
2022
|
</style>
|
|
2023
|
-
`}var yo=class extends fi{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=IN;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var H1=i=>{throw TypeError(i)},oE=(i,e,t)=>e.has(i)||H1("Cannot "+t),he=(i,e,t)=>(oE(i,e,"read from private field"),t?t.call(i):e.get(i)),vt=(i,e,t)=>e.has(i)?H1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),si=(i,e,t,s)=>(oE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(oE(i,e,"access private method"),t),jf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends jf{}globalThis.DocumentFragment=i}var lE=class extends jf{},LN=class extends jf{},RN={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(lE)}},Nf,xN=class{constructor(i,e={}){vt(this,Nf),si(this,Nf,e==null?void 0:e.detail)}get detail(){return he(this,Nf)}initCustomEvent(){}};Nf=new WeakMap;function kN(i,e){return new lE}var G1={document:{createElement:kN},DocumentFragment,customElements:RN,CustomEvent:xN,EventTarget:jf,HTMLElement:lE,HTMLVideoElement:LN},K1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=K1?G1:globalThis,Hf=K1?G1.document:globalThis.document;function DN(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${sE(t)}: ${s}; `)}),e?e.trim():void 0}function sE(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function V1(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ut(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function W1(i){let e=CN(i).toString();return e?"?"+e:""}function CN(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var q1=(i,e)=>!i||!e?!1:i.contains(e)?!0:q1(i,e.getRootNode().host),Y1="mux.com",wN=()=>{try{return"3.13.
|
|
2023
|
+
`}var yo=class extends fi{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=IN;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var H1=i=>{throw TypeError(i)},oE=(i,e,t)=>e.has(i)||H1("Cannot "+t),he=(i,e,t)=>(oE(i,e,"read from private field"),t?t.call(i):e.get(i)),vt=(i,e,t)=>e.has(i)?H1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),si=(i,e,t,s)=>(oE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(oE(i,e,"access private method"),t),jf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends jf{}globalThis.DocumentFragment=i}var lE=class extends jf{},LN=class extends jf{},RN={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(lE)}},Nf,xN=class{constructor(i,e={}){vt(this,Nf),si(this,Nf,e==null?void 0:e.detail)}get detail(){return he(this,Nf)}initCustomEvent(){}};Nf=new WeakMap;function kN(i,e){return new lE}var G1={document:{createElement:kN},DocumentFragment,customElements:RN,CustomEvent:xN,EventTarget:jf,HTMLElement:lE,HTMLVideoElement:LN},K1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=K1?G1:globalThis,Hf=K1?G1.document:globalThis.document;function DN(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${sE(t)}: ${s}; `)}),e?e.trim():void 0}function sE(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function V1(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ut(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function W1(i){let e=CN(i).toString();return e?"?"+e:""}function CN(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var q1=(i,e)=>!i||!e?!1:i.contains(e)?!0:q1(i,e.getRootNode().host),Y1="mux.com",wN=()=>{try{return"3.13.3"}catch{}return"UNKNOWN"},MN=wN(),j1=()=>MN,PN=(i,{token:e,customDomain:t=Y1,thumbnailTime:s,programTime:r}={})=>{var n;let a=e==null?s:void 0,{aud:o}=(n=dr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${W1({token:e,time:a,program_time:r})}`},ON=(i,{token:e,customDomain:t=Y1,programStartTime:s,programEndTime:r}={})=>{var n;let{aud:a}=(n=dr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${W1({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},dE=i=>{if(i){if([we.LIVE,we.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return we.LIVE}},NN={crossorigin:"crossOrigin",playsinline:"playsInline"};function UN(i){var e;return(e=NN[i])!=null?e:V1(i)}var To,bo,ti,FN=class{constructor(i,e){vt(this,To),vt(this,bo),vt(this,ti,[]),si(this,To,i),si(this,bo,e)}[Symbol.iterator](){return he(this,ti).values()}get length(){return he(this,ti).length}get value(){var i;return(i=he(this,ti).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(si(this,ti,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return he(this,ti)[i]}values(){return he(this,ti).values()}keys(){return he(this,ti).keys()}forEach(i){he(this,ti).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||he(this,ti).push(s)}),!(this.value===""&&!((e=he(this,To))!=null&&e.hasAttribute(`${he(this,bo)}`)))&&((t=he(this,To))==null||t.setAttribute(`${he(this,bo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{he(this,ti).splice(he(this,ti).indexOf(t),1)}),(e=he(this,To))==null||e.setAttribute(`${he(this,bo)}`,`${this.value}`)}contains(i){return he(this,ti).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)}};To=new WeakMap,bo=new WeakMap,ti=new WeakMap;var z1=`[mux-player ${j1()}]`;function Xs(...i){console.warn(z1,...i)}function ii(...i){console.error(z1,...i)}function R1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ee("Read more: ")}
|
|
2024
2024
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Xs(t)}var Ot={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Kr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},a9={...Ot,...Kr},x1=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}}),BN=Object.values(Ot).filter(i=>Ot.PLAYSINLINE!==i),$N=Object.values(Kr),HN=[...BN,...$N],GN=class extends Ss.HTMLElement{static get observedAttributes(){return HN}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case Kr.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Kr.VOLUME:{let n=(s=Ut(t))!=null?s:1;this.media&&(this.media.volume=n);return}case Kr.PLAYBACKRATE:{let n=(r=Ut(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:x1}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:x1}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=Ut(this.getAttribute(Kr.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Kr.PLAYBACKRATE,`${i}`):this.removeAttribute(Kr.PLAYBACKRATE)}get crossOrigin(){return _d(this,Ot.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Ot.CROSSORIGIN,`${i}`)}get autoplay(){return _d(this,Ot.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Ot.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Ot.AUTOPLAY)}get loop(){return _d(this,Ot.LOOP)!=null}set loop(i){i?this.setAttribute(Ot.LOOP,""):this.removeAttribute(Ot.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 _d(this,Ot.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Ot.MUTED,""):this.removeAttribute(Ot.MUTED)}get playsInline(){return _d(this,Ot.PLAYSINLINE)!=null}set playsInline(i){ii("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(Ot.PRELOAD,i):this.removeAttribute(Ot.PRELOAD)}};function _d(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var k1=GN,KN=`:host {
|
|
2025
2025
|
--media-control-display: var(--controls);
|
|
2026
2026
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.mjs
CHANGED
|
@@ -106,7 +106,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${m_(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function f_(i,{tag:e,is:t}){var n,a,o,l,d,d_,c,h,f,m,p,g,nn,Kg,Vg,u_,Wg,c_,h_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?qw(s):[];return o=class extends i{constructor(){super(...arguments);oe(this,g);oe(this,c,!1);oe(this,h,null);oe(this,f,new Map);oe(this,m);oe(this,p);Ie(this,"get");Ie(this,"set");Ie(this,"call")}static get observedAttributes(){var C,P,N;return Ue(C=o,d,d_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...l_]}get nativeEl(){var I,C,P,N,$;return Ue(this,g,nn).call(this),($=(N=(C=(I=w(this,h))!=null?I:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e))!=null?N:(P=this.shadowRoot)==null?void 0:P.querySelector(e))!=null?$:null}set nativeEl(I){ie(this,h,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I,C;return(C=this.getAttribute("preload"))!=null?C:(I=this.nativeEl)==null?void 0:I.preload}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=Yw(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of r)Ue(this,g,c_).call(this,I);Ue(this,g,Kg).call(this)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,C,P){Ue(this,g,nn).call(this),Ue(this,g,h_).call(this,I,C,P)}connectedCallback(){Ue(this,g,nn).call(this),w(this,p)||Ue(this,g,Kg).call(this)}disconnectedCallback(){var I,C,P;(I=w(this,m))==null||I.disconnect(),ie(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ie(this,p,void 0));for(let N of this.constructor.Events)(P=this.shadowRoot)==null||P.removeEventListener(N,this,!0);w(this,f).forEach(N=>N.remove()),w(this,f).clear(),ie(this,h,null)}},l=new WeakMap,d=new WeakSet,d_=function(){if(w(this,l))return;ie(this,l,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ue(this,g,nn).call(this),(()=>{var H;if(this.call)return this.call(C,...P);let $=(H=this.nativeEl)==null?void 0:H[C];return $==null?void 0:$.apply(this.nativeEl,P)})()};else{let P={get(){var $,H,U;Ue(this,g,nn).call(this);let N=C.toLowerCase();if(I.has(N)){let z=this.getAttribute(N);return z===null?!1:z===""?!0:z}return(U=($=this.get)==null?void 0:$.call(this,C))!=null?U:(H=this.nativeEl)==null?void 0:H[C]}};C!==C.toUpperCase()&&(P.set=function(N){Ue(this,g,nn).call(this);let $=C.toLowerCase();if(I.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(C,N);return}this.nativeEl&&(this.nativeEl[C]=N)}),Object.defineProperty(this.prototype,C,P)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,nn=function(){w(this,c)||(ie(this,c,!0),this.init())},Kg=function(){var I,C;ie(this,m,new MutationObserver(Ue(this,g,u_).bind(this))),ie(this,p,()=>Ue(this,g,Vg).call(this)),(I=this.shadowRoot)==null||I.addEventListener("slotchange",w(this,p)),Ue(this,g,Vg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Vg=function(){var N;let I=new Map(w(this,f)),C=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(C==null?void 0:C.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var U,z;I.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(z=this.nativeEl)==null||z.append(H),Ue(this,g,Wg).call(this,H)}),I.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},u_=function(I){var C;for(let P of I)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ue(this,g,Wg).call(this,H))}},Wg=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},c_=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let C=this[I];delete this[I],this[I]=C}},h_=function(I,C,P){var N,$,H;["id","class"].includes(I)||!o.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(I):(($=this.nativeEl)==null?void 0:$.getAttribute(I))!==P&&((H=this.nativeEl)==null||H.setAttribute(I,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Vw:Ww),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",o_),oe(o,l,!1),o}function qw(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 m_(i){let e="";for(let t in i){if(!l_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Yw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var n_,rl=f_((n_=globalThis.HTMLElement)!=null?n_:class{},{tag:"video"}),a_,U2=f_((a_=globalThis.HTMLElement)!=null?a_:class{},{tag:"audio"});var v_=i=>{throw TypeError(i)},qg=(i,e,t)=>e.has(i)||v_("Cannot "+t),lt=(i,e,t)=>(qg(i,e,"read from private field"),t?t.call(i):e.get(i)),Ei=(i,e,t)=>e.has(i)?v_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(qg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Qu=(i,e,t)=>(qg(i,e,"access private method"),t),jw=()=>{try{return"0.31.
|
|
109
|
+
`}function f_(i,{tag:e,is:t}){var n,a,o,l,d,d_,c,h,f,m,p,g,nn,Kg,Vg,u_,Wg,c_,h_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?qw(s):[];return o=class extends i{constructor(){super(...arguments);oe(this,g);oe(this,c,!1);oe(this,h,null);oe(this,f,new Map);oe(this,m);oe(this,p);Ie(this,"get");Ie(this,"set");Ie(this,"call")}static get observedAttributes(){var C,P,N;return Ue(C=o,d,d_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...l_]}get nativeEl(){var I,C,P,N,$;return Ue(this,g,nn).call(this),($=(N=(C=(I=w(this,h))!=null?I:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e))!=null?N:(P=this.shadowRoot)==null?void 0:P.querySelector(e))!=null?$:null}set nativeEl(I){ie(this,h,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I,C;return(C=this.getAttribute("preload"))!=null?C:(I=this.nativeEl)==null?void 0:I.preload}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=Yw(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of r)Ue(this,g,c_).call(this,I);Ue(this,g,Kg).call(this)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,C,P){Ue(this,g,nn).call(this),Ue(this,g,h_).call(this,I,C,P)}connectedCallback(){Ue(this,g,nn).call(this),w(this,p)||Ue(this,g,Kg).call(this)}disconnectedCallback(){var I,C,P;(I=w(this,m))==null||I.disconnect(),ie(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ie(this,p,void 0));for(let N of this.constructor.Events)(P=this.shadowRoot)==null||P.removeEventListener(N,this,!0);w(this,f).forEach(N=>N.remove()),w(this,f).clear(),ie(this,h,null)}},l=new WeakMap,d=new WeakSet,d_=function(){if(w(this,l))return;ie(this,l,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ue(this,g,nn).call(this),(()=>{var H;if(this.call)return this.call(C,...P);let $=(H=this.nativeEl)==null?void 0:H[C];return $==null?void 0:$.apply(this.nativeEl,P)})()};else{let P={get(){var $,H,U;Ue(this,g,nn).call(this);let N=C.toLowerCase();if(I.has(N)){let z=this.getAttribute(N);return z===null?!1:z===""?!0:z}return(U=($=this.get)==null?void 0:$.call(this,C))!=null?U:(H=this.nativeEl)==null?void 0:H[C]}};C!==C.toUpperCase()&&(P.set=function(N){Ue(this,g,nn).call(this);let $=C.toLowerCase();if(I.has($)){N===!0||N===!1||N==null?this.toggleAttribute($,!!N):this.setAttribute($,N);return}if(this.set){this.set(C,N);return}this.nativeEl&&(this.nativeEl[C]=N)}),Object.defineProperty(this.prototype,C,P)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakSet,nn=function(){w(this,c)||(ie(this,c,!0),this.init())},Kg=function(){var I,C;ie(this,m,new MutationObserver(Ue(this,g,u_).bind(this))),ie(this,p,()=>Ue(this,g,Vg).call(this)),(I=this.shadowRoot)==null||I.addEventListener("slotchange",w(this,p)),Ue(this,g,Vg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Vg=function(){var N;let I=new Map(w(this,f)),C=(N=this.shadowRoot)==null?void 0:N.querySelector("slot:not([name])");(C==null?void 0:C.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var U,z;I.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(z=this.nativeEl)==null||z.append(H),Ue(this,g,Wg).call(this,H)}),I.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},u_=function(I){var C;for(let P of I)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ue(this,g,Wg).call(this,H))}},Wg=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},c_=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let C=this[I];delete this[I],this[I]=C}},h_=function(I,C,P){var N,$,H;["id","class"].includes(I)||!o.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(I):(($=this.nativeEl)==null?void 0:$.getAttribute(I))!==P&&((H=this.nativeEl)==null||H.setAttribute(I,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Vw:Ww),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",o_),oe(o,l,!1),o}function qw(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 m_(i){let e="";for(let t in i){if(!l_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Yw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var n_,rl=f_((n_=globalThis.HTMLElement)!=null?n_:class{},{tag:"video"}),a_,U2=f_((a_=globalThis.HTMLElement)!=null?a_:class{},{tag:"audio"});var v_=i=>{throw TypeError(i)},qg=(i,e,t)=>e.has(i)||v_("Cannot "+t),lt=(i,e,t)=>(qg(i,e,"read from private field"),t?t.call(i):e.get(i)),Ei=(i,e,t)=>e.has(i)?v_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(qg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Qu=(i,e,t)=>(qg(i,e,"access private method"),t),jw=()=>{try{return"0.31.3"}catch{}return"UNKNOWN"},zw=jw(),Qw=()=>zw,Xw=`
|
|
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>`,k={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"},Zw=Object.values(k),p_=Qw(),g_="mux-video",nl,Xu,al,Zu,Ju,ec,tc,ic,ol,sc,ui,ur,rc,ll,E_=class extends rl{constructor(){super(),Ei(this,ui),Ei(this,nl),Ei(this,Xu),Ei(this,al,{}),Ei(this,Zu,{}),Ei(this,Ju),Ei(this,ec),Ei(this,tc),Ei(this,ic),Ei(this,ol,""),Ei(this,sc,i=>{var e;let t=qb(this.nativeEl),s=(e=this.metadata)!=null?e:{};this.metadata={...t,...s},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Pi(this,ol,"default"),this.updateLogo())}),Ei(this,rc),Pi(this,Xu,qu())}static get NAME(){return g_}static get VERSION(){return p_}static get observedAttributes(){var i;return[...Zw,...(i=rl.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?Xw:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${rl.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -2020,7 +2020,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2020
2020
|
min-height: var(--media-control-height, 24px);
|
|
2021
2021
|
}
|
|
2022
2022
|
</style>
|
|
2023
|
-
`}var yo=class extends fi{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=IN;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var H1=i=>{throw TypeError(i)},oE=(i,e,t)=>e.has(i)||H1("Cannot "+t),he=(i,e,t)=>(oE(i,e,"read from private field"),t?t.call(i):e.get(i)),vt=(i,e,t)=>e.has(i)?H1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),si=(i,e,t,s)=>(oE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(oE(i,e,"access private method"),t),jf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends jf{}globalThis.DocumentFragment=i}var lE=class extends jf{},LN=class extends jf{},RN={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(lE)}},Nf,xN=class{constructor(i,e={}){vt(this,Nf),si(this,Nf,e==null?void 0:e.detail)}get detail(){return he(this,Nf)}initCustomEvent(){}};Nf=new WeakMap;function kN(i,e){return new lE}var G1={document:{createElement:kN},DocumentFragment,customElements:RN,CustomEvent:xN,EventTarget:jf,HTMLElement:lE,HTMLVideoElement:LN},K1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=K1?G1:globalThis,Hf=K1?G1.document:globalThis.document;function DN(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${sE(t)}: ${s}; `)}),e?e.trim():void 0}function sE(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function V1(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ut(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function W1(i){let e=CN(i).toString();return e?"?"+e:""}function CN(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var q1=(i,e)=>!i||!e?!1:i.contains(e)?!0:q1(i,e.getRootNode().host),Y1="mux.com",wN=()=>{try{return"3.13.
|
|
2023
|
+
`}var yo=class extends fi{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=IN;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var H1=i=>{throw TypeError(i)},oE=(i,e,t)=>e.has(i)||H1("Cannot "+t),he=(i,e,t)=>(oE(i,e,"read from private field"),t?t.call(i):e.get(i)),vt=(i,e,t)=>e.has(i)?H1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),si=(i,e,t,s)=>(oE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(oE(i,e,"access private method"),t),jf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends jf{}globalThis.DocumentFragment=i}var lE=class extends jf{},LN=class extends jf{},RN={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(lE)}},Nf,xN=class{constructor(i,e={}){vt(this,Nf),si(this,Nf,e==null?void 0:e.detail)}get detail(){return he(this,Nf)}initCustomEvent(){}};Nf=new WeakMap;function kN(i,e){return new lE}var G1={document:{createElement:kN},DocumentFragment,customElements:RN,CustomEvent:xN,EventTarget:jf,HTMLElement:lE,HTMLVideoElement:LN},K1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=K1?G1:globalThis,Hf=K1?G1.document:globalThis.document;function DN(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${sE(t)}: ${s}; `)}),e?e.trim():void 0}function sE(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function V1(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ut(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function W1(i){let e=CN(i).toString();return e?"?"+e:""}function CN(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var q1=(i,e)=>!i||!e?!1:i.contains(e)?!0:q1(i,e.getRootNode().host),Y1="mux.com",wN=()=>{try{return"3.13.3"}catch{}return"UNKNOWN"},MN=wN(),j1=()=>MN,PN=(i,{token:e,customDomain:t=Y1,thumbnailTime:s,programTime:r}={})=>{var n;let a=e==null?s:void 0,{aud:o}=(n=dr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${W1({token:e,time:a,program_time:r})}`},ON=(i,{token:e,customDomain:t=Y1,programStartTime:s,programEndTime:r}={})=>{var n;let{aud:a}=(n=dr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${W1({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},dE=i=>{if(i){if([we.LIVE,we.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return we.LIVE}},NN={crossorigin:"crossOrigin",playsinline:"playsInline"};function UN(i){var e;return(e=NN[i])!=null?e:V1(i)}var To,bo,ti,FN=class{constructor(i,e){vt(this,To),vt(this,bo),vt(this,ti,[]),si(this,To,i),si(this,bo,e)}[Symbol.iterator](){return he(this,ti).values()}get length(){return he(this,ti).length}get value(){var i;return(i=he(this,ti).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(si(this,ti,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return he(this,ti)[i]}values(){return he(this,ti).values()}keys(){return he(this,ti).keys()}forEach(i){he(this,ti).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||he(this,ti).push(s)}),!(this.value===""&&!((e=he(this,To))!=null&&e.hasAttribute(`${he(this,bo)}`)))&&((t=he(this,To))==null||t.setAttribute(`${he(this,bo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{he(this,ti).splice(he(this,ti).indexOf(t),1)}),(e=he(this,To))==null||e.setAttribute(`${he(this,bo)}`,`${this.value}`)}contains(i){return he(this,ti).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)}};To=new WeakMap,bo=new WeakMap,ti=new WeakMap;var z1=`[mux-player ${j1()}]`;function Xs(...i){console.warn(z1,...i)}function ii(...i){console.error(z1,...i)}function R1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ee("Read more: ")}
|
|
2024
2024
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Xs(t)}var Ot={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Kr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},a9={...Ot,...Kr},x1=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}}),BN=Object.values(Ot).filter(i=>Ot.PLAYSINLINE!==i),$N=Object.values(Kr),HN=[...BN,...$N],GN=class extends Ss.HTMLElement{static get observedAttributes(){return HN}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case Kr.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Kr.VOLUME:{let n=(s=Ut(t))!=null?s:1;this.media&&(this.media.volume=n);return}case Kr.PLAYBACKRATE:{let n=(r=Ut(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:x1}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:x1}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=Ut(this.getAttribute(Kr.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Kr.PLAYBACKRATE,`${i}`):this.removeAttribute(Kr.PLAYBACKRATE)}get crossOrigin(){return _d(this,Ot.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Ot.CROSSORIGIN,`${i}`)}get autoplay(){return _d(this,Ot.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Ot.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Ot.AUTOPLAY)}get loop(){return _d(this,Ot.LOOP)!=null}set loop(i){i?this.setAttribute(Ot.LOOP,""):this.removeAttribute(Ot.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 _d(this,Ot.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Ot.MUTED,""):this.removeAttribute(Ot.MUTED)}get playsInline(){return _d(this,Ot.PLAYSINLINE)!=null}set playsInline(i){ii("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(Ot.PRELOAD,i):this.removeAttribute(Ot.PRELOAD)}};function _d(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var k1=GN,KN=`:host {
|
|
2025
2025
|
--media-control-display: var(--controls);
|
|
2026
2026
|
--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.13.3
|
|
3
|
+
"version": "3.13.3",
|
|
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.35.
|
|
128
|
+
"@mux/mux-video": "0.31.3",
|
|
129
|
+
"@mux/playback-core": "0.35.3",
|
|
130
130
|
"media-chrome": "~4.19.0",
|
|
131
131
|
"player.style": "^0.3.0"
|
|
132
132
|
},
|