@mux/mux-player 3.12.1-canary.0 → 3.13.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
|
@@ -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 Tv(){return c("Loop")}var Gr=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)}};Gr.getSlotTemplateHTML=Av;Gr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Gr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var ki=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${is(i)}: ${a}; `)}),e?e.trim():void 0}function is(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function as(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 ld(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dd=(t,e)=>!t||!e?!1:t.contains(e)?!0:dd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.
|
|
1411
|
+
`}function Tv(){return c("Loop")}var Gr=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)}};Gr.getSlotTemplateHTML=Av;Gr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Gr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var ki=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${is(i)}: ${a}; `)}),e?e.trim():void 0}function is(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function as(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 ld(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dd=(t,e)=>!t||!e?!1:t.contains(e)?!0:dd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.13.0"}catch{}return"UNKNOWN"},Sv=kv(),ns=()=>Sv,Am=(t,{token:e,customDomain:i=_m,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${ld({token:e,time:n,program_time:r})}`},Tm=(t,{token:e,customDomain:i=_m,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${ld({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Yr=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 Iv={crossorigin:"crossOrigin",playsinline:"playsInline"};function ym(t){var e;return(e=Iv[t])!=null?e:as(t)}var Ti,yi,ve,rs=class{constructor(e,i){ae(this,Ti);ae(this,yi);ae(this,ve,[]);ue(this,Ti,e),ue(this,yi,i)}[Symbol.iterator](){return R(this,ve).values()}get length(){return R(this,ve).length}get value(){var e;return(e=R(this,ve).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ue(this,ve,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return R(this,ve)[e]}values(){return R(this,ve).values()}keys(){return R(this,ve).keys()}forEach(e){R(this,ve).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||R(this,ve).push(r)}),!(this.value===""&&!((i=R(this,Ti))!=null&&i.hasAttribute(`${R(this,yi)}`)))&&((a=R(this,Ti))==null||a.setAttribute(`${R(this,yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{R(this,ve).splice(R(this,ve).indexOf(a),1)}),(i=R(this,Ti))==null||i.setAttribute(`${R(this,yi)}`,`${this.value}`)}contains(e){return R(this,ve).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,ve=new WeakMap;var Sm=`[mux-player ${ns()}]`;function mt(...t){console.warn(Sm,...t)}function Ee(...t){console.error(Sm,...t)}function ud(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,km.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"},RA={...he,...Xt},Mm=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}}),Mv=Object.values(he).filter(t=>he.PLAYSINLINE!==t),Lv=Object.values(Xt),Cv=[...Mv,...Lv],cd=class extends Se.HTMLElement{static get observedAttributes(){return Cv}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:Mm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Mm}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 qr(this,he.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(he.CROSSORIGIN,`${e}`)}get autoplay(){return qr(this,he.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(he.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(he.AUTOPLAY)}get loop(){return qr(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 qr(this,he.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(he.MUTED,""):this.removeAttribute(he.MUTED)}get playsInline(){return qr(this,he.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(he.PRELOAD,e):this.removeAttribute(he.PRELOAD)}};function qr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var md=cd;var xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(xm(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)=>(xm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),va,os,Si,Zr,Jt,jt,ei,Ii,Ea,ss,Ze,Lm=1,Cm=0,wv=1,Rv={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=Rv){var r;super(),ht(this,va,void 0),ht(this,os,void 0),this.append(e.content.cloneNode(!0)),Lt(this,va,Dm(this)),Lt(this,os,a),(r=a.createCallback)==null||r.call(a,this,P(this,va),i),a.processCallback(this,P(this,va),i)}update(e){P(this,os).processCallback(this,P(this,va),e)}};va=new WeakMap;os=new WeakMap;var Dm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new hd;for([i,a]of Rm(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===Lm&&!(r instanceof HTMLTemplateElement))Dm(r,e);else{let n=r.data;if(r.nodeType===Lm||n.includes("{{")){let s=[];if(n)for([i,a]of Rm(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 zr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},wm={},Rm=t=>{let e="",i=0,a=wm[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([Cm,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([wv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Cm,(i>0?"{{":"")+e]),wm[t]=a},xv=11,ls=class{get value(){return""}set value(e){}toString(){return this.value}},Om=new WeakMap,hd=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&&Om.set(i,this),P(this,Si).push(i)}toString(){return P(this,Si).join("")}};Si=new WeakMap;var be=class extends ls{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 Om.get(this)};var wt=class extends ls{constructor(e,i){super(),ht(this,ss,void 0),ht(this,Ze,void 0),Lt(this,ss,e),Lt(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return P(this,Ze)}get parentNode(){return P(this,ss)}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===xv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),Lt(this,Ze,Dv(P(this,Ze)[0].parentNode,P(this,Ze),i,this.nextSibling))}};ss=new WeakMap;Ze=new WeakMap;var zr=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 Dv(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 Nm={string:t=>String(t)},us=class{constructor(e){this.template=e,this.state=void 0}},Mi=new WeakMap,Li=new WeakMap,pd={partial:(t,e)=>{e[t.expression]=new us(t.template)},if:(t,e)=>{var i;if(Um(t.expression,e))if(Mi.get(t)!==t.template){Mi.set(t,t.template);let a=new Ct(t.template,e,cs);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)}},Ov=Object.keys(pd),cs={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof zr){if(!s.directive){let u=Ov.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=pd[s.directive])==null||a.call(pd,s,i);continue}let d=Um(n,i);if(d instanceof us){Mi.get(s)!==d.template?(Mi.set(s,d.template),d=new Ct(d.template,d.state,cs),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))}}},Pm={"!":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=Nm[e])==null?void 0:i.call(Nm,t)}};function Nv(t){return Pv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Um(t,e={}){var i,a,r,n,s,d,u;let f=Nv(t);if(f.length===0||f.some(({type:y})=>!y))return Qr(t);if(((i=f[0])==null?void 0:i.token)===">"){let y=e[(a=f[1])==null?void 0:a.token];if(!y)return Qr(t);let A={...e};y.state=A;let E=f.slice(2);for(let p=0;p<E.length;p+=3){let k=(r=E[p])==null?void 0:r.token,g=(n=E[p+1])==null?void 0:n.token,S=(s=E[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=Xr(S,e))}return y}if(f.length===1)return ds(f[0])?Xr(f[0].token,e):Qr(t);if(f.length===2){let y=(d=f[0])==null?void 0:d.token,A=Pm[y];if(!A||!ds(f[1]))return Qr(t);let E=Xr(f[1].token,e);return A(E)}if(f.length===3){let y=(u=f[1])==null?void 0:u.token,A=Pm[y];if(!A||!ds(f[0])||!ds(f[2]))return Qr(t);let E=Xr(f[0].token,e);if(y==="|")return A(E,f[2].token);let p=Xr(f[2].token,e);return A(E,p)}}function Qr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ds({type:t}){return["number","boolean","string","param"].includes(t)}function Xr(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):Ln(t)?parseFloat(t):e[t]}function Pv(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 gd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ti=(t,e,i)=>(gd(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)=>(gd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fd=(t,e,i)=>(gd(t,e,"access private method"),i),ga,ms,_a,ba,Ed,Hm,hs,bd,Jr,vd={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Bm=V.createElement("template");Bm.innerHTML=`
|
|
1413
1413
|
<style>
|
|
1414
1414
|
:host {
|
package/dist/base.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),y=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var Q=class extends Y{},Ce=class extends Y{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,ke=class{constructor(a,e={}){h(this,J);y(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new Q}var ut={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:ke,EventTarget:Y,HTMLElement:Q,HTMLVideoElement:Ce},mt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=mt?ut:globalThis,D=mt?ut.document:globalThis.document;import{MediaController as _a,MediaErrorDialog as Ht}from"media-chrome";import{Attributes as we}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Pt,MediaUIAttributes as Ee,MediaUIEvents as wt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as ve,Attributes as n}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as Te,addTextTrack as Ra,removeTextTrack as xa,CmcdTypeValues as Dt,i18n as V,parseJwt as De,MuxJWTAud as Ue,generatePlayerInitTime as Oa}from"@mux/playback-core";import{i18n as Jt}from"@mux/playback-core";import{StreamTypes as xe,parseJwt as pt}from"@mux/playback-core";function ct(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${me(e)}: ${i}; `)}),a?a.trim():void 0}function me(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function f(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function _e(t){let a=zt(t).toString();return a?"?"+a:""}function zt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Re=(t,a)=>!t||!a?!1:t.contains(a)?!0:Re(t,a.getRootNode().host);var bt="mux.com",Xt=()=>{try{return"3.
|
|
1
|
+
var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),y=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var Q=class extends Y{},Ce=class extends Y{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,ke=class{constructor(a,e={}){h(this,J);y(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new Q}var ut={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:ke,EventTarget:Y,HTMLElement:Q,HTMLVideoElement:Ce},mt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=mt?ut:globalThis,D=mt?ut.document:globalThis.document;import{MediaController as _a,MediaErrorDialog as Ht}from"media-chrome";import{Attributes as we}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Pt,MediaUIAttributes as Ee,MediaUIEvents as wt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as ve,Attributes as n}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as Te,addTextTrack as Ra,removeTextTrack as xa,CmcdTypeValues as Dt,i18n as V,parseJwt as De,MuxJWTAud as Ue,generatePlayerInitTime as Oa}from"@mux/playback-core";import{i18n as Jt}from"@mux/playback-core";import{StreamTypes as xe,parseJwt as pt}from"@mux/playback-core";function ct(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${me(e)}: ${i}; `)}),a?a.trim():void 0}function me(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function f(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function _e(t){let a=zt(t).toString();return a?"?"+a:""}function zt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Re=(t,a)=>!t||!a?!1:t.contains(a)?!0:Re(t,a.getRootNode().host);var bt="mux.com",Xt=()=>{try{return"3.13.0"}catch{}return"UNKNOWN"},qt=Xt(),be=()=>qt,ht=(t,{token:a,customDomain:e=bt,thumbnailTime:i,programTime:r}={})=>{var u;let s=a==null?i:void 0,{aud:d}=(u=pt(a))!=null?u:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${_e({token:a,time:s,program_time:r})}`},gt=(t,{token:a,customDomain:e=bt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:s}=(d=pt(a))!=null?d:{};if(!(a&&s!=="s"))return`https://image.${e}/${t}/storyboard.vtt${_e({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},ee=t=>{if(t){if([xe.LIVE,xe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return xe.LIVE}};var Qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ft(t){var a;return(a=Qt[t])!=null?a:ce(t)}var U,B,C,pe=class{constructor(a,e){h(this,U);h(this,B);h(this,C,[]);y(this,U,a),y(this,B,e)}[Symbol.iterator](){return l(this,C).values()}get length(){return l(this,C).length}get value(){var a;return(a=l(this,C).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(y(this,C,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return l(this,C)[a]}values(){return l(this,C).values()}keys(){return l(this,C).keys()}forEach(a){l(this,C).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||l(this,C).push(r)}),!(this.value===""&&!((e=l(this,U))!=null&&e.hasAttribute(`${l(this,B)}`)))&&((i=l(this,U))==null||i.setAttribute(`${l(this,B)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{l(this,C).splice(l(this,C).indexOf(i),1)}),(e=l(this,U))==null||e.setAttribute(`${l(this,B)}`,`${this.value}`)}contains(a){return l(this,C).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};U=new WeakMap,B=new WeakMap,C=new WeakMap;var yt=`[mux-player ${be()}]`;function O(...t){console.warn(yt,...t)}function k(...t){console.error(yt,...t)}function Oe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Jt("Read more: ")}
|
|
2
2
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(a)}var E={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},P={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Xa={...E,...P},Tt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ea=Object.values(E).filter(t=>E.PLAYSINLINE!==t),ta=Object.values(P),aa=[...ea,...ta],Le=class extends _.HTMLElement{static get observedAttributes(){return aa}constructor(){super()}attributeChangedCallback(a,e,i){var r,s;switch(a){case P.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case P.VOLUME:{let d=(r=f(i))!=null?r:1;this.media&&(this.media.volume=d);return}case P.PLAYBACKRATE:{let d=(s=f(i))!=null?s:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:Tt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:Tt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=f(this.getAttribute(P.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(P.PLAYBACKRATE,`${a}`):this.removeAttribute(P.PLAYBACKRATE)}get crossOrigin(){return te(this,E.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(E.CROSSORIGIN,`${a}`)}get autoplay(){return te(this,E.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(E.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(E.AUTOPLAY)}get loop(){return te(this,E.LOOP)!=null}set loop(a){a?this.setAttribute(E.LOOP,""):this.removeAttribute(E.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return te(this,E.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(E.MUTED,""):this.removeAttribute(E.MUTED)}get playsInline(){return te(this,E.PLAYSINLINE)!=null}set playsInline(a){k("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(E.PRELOAD,a):this.removeAttribute(E.PRELOAD)}};function te(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Me=Le;import"media-chrome/dist/media-theme-element.js";var vt=`: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${o_(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function a_(i,{tag:e,is:t}){var n,a,o,l,d,i_,c,h,f,m,p,g,rn,Fg,Bg,s_,$g,r_,n_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?Fw(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 Ne(C=o,d,i_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...t_]}get nativeEl(){var S,C,P,N,$;return Ne(this,g,rn).call(this),($=(N=(C=(S=w(this,h))!=null?S: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(S){ee(this,h,S)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(S){this.toggleAttribute("muted",S)}get src(){return this.getAttribute("src")}set src(S){this.setAttribute("src",`${S}`)}get preload(){var S,C;return(C=this.getAttribute("preload"))!=null?C:(S=this.nativeEl)==null?void 0:S.preload}set preload(S){this.setAttribute("preload",`${S}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=Bw(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of r)Ne(this,g,r_).call(this,S);Ne(this,g,Fg).call(this)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,C,P){Ne(this,g,rn).call(this),Ne(this,g,n_).call(this,S,C,P)}connectedCallback(){Ne(this,g,rn).call(this),w(this,p)||Ne(this,g,Fg).call(this)}disconnectedCallback(){var S,C,P;(S=w(this,m))==null||S.disconnect(),ee(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ee(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(),ee(this,h,null)}},l=new WeakMap,d=new WeakSet,i_=function(){if(w(this,l))return;ee(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ne(this,g,rn).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;Ne(this,g,rn).call(this);let N=C.toLowerCase();if(S.has(N)){let j=this.getAttribute(N);return j===null?!1:j===""?!0:j}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){Ne(this,g,rn).call(this);let $=C.toLowerCase();if(S.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,rn=function(){w(this,c)||(ee(this,c,!0),this.init())},Fg=function(){var S,C;ee(this,m,new MutationObserver(Ne(this,g,s_).bind(this))),ee(this,p,()=>Ne(this,g,Bg).call(this)),(S=this.shadowRoot)==null||S.addEventListener("slotchange",w(this,p)),Ne(this,g,Bg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Bg=function(){var N;let S=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,j;S.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(j=this.nativeEl)==null||j.append(H),Ne(this,g,$g).call(this,H)}),S.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},s_=function(S){var C;for(let P of S)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ne(this,g,$g).call(this,H))}},$g=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},r_=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let C=this[S];delete this[S],this[S]=C}},n_=function(S,C,P){var N,$,H;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(S):(($=this.nativeEl)==null?void 0:$.getAttribute(S))!==P&&((H=this.nativeEl)==null||H.setAttribute(S,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Nw:Uw),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",e_),oe(o,l,!1),o}function Fw(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 o_(i){let e="";for(let t in i){if(!t_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Bw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Zb,rl=a_((Zb=globalThis.HTMLElement)!=null?Zb:class{},{tag:"video"}),Jb,kN=a_((Jb=globalThis.HTMLElement)!=null?Jb:class{},{tag:"audio"});var u_=i=>{throw TypeError(i)},Hg=(i,e,t)=>e.has(i)||u_("Cannot "+t),pt=(i,e,t)=>(Hg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?u_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(Hg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),zu=(i,e,t)=>(Hg(i,e,"access private method"),t),$w=()=>{try{return"0.
|
|
109
|
+
`}function a_(i,{tag:e,is:t}){var n,a,o,l,d,i_,c,h,f,m,p,g,rn,Fg,Bg,s_,$g,r_,n_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?Fw(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 Ne(C=o,d,i_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...t_]}get nativeEl(){var S,C,P,N,$;return Ne(this,g,rn).call(this),($=(N=(C=(S=w(this,h))!=null?S: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(S){ee(this,h,S)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(S){this.toggleAttribute("muted",S)}get src(){return this.getAttribute("src")}set src(S){this.setAttribute("src",`${S}`)}get preload(){var S,C;return(C=this.getAttribute("preload"))!=null?C:(S=this.nativeEl)==null?void 0:S.preload}set preload(S){this.setAttribute("preload",`${S}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=Bw(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of r)Ne(this,g,r_).call(this,S);Ne(this,g,Fg).call(this)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,C,P){Ne(this,g,rn).call(this),Ne(this,g,n_).call(this,S,C,P)}connectedCallback(){Ne(this,g,rn).call(this),w(this,p)||Ne(this,g,Fg).call(this)}disconnectedCallback(){var S,C,P;(S=w(this,m))==null||S.disconnect(),ee(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ee(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(),ee(this,h,null)}},l=new WeakMap,d=new WeakSet,i_=function(){if(w(this,l))return;ee(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ne(this,g,rn).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;Ne(this,g,rn).call(this);let N=C.toLowerCase();if(S.has(N)){let j=this.getAttribute(N);return j===null?!1:j===""?!0:j}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){Ne(this,g,rn).call(this);let $=C.toLowerCase();if(S.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,rn=function(){w(this,c)||(ee(this,c,!0),this.init())},Fg=function(){var S,C;ee(this,m,new MutationObserver(Ne(this,g,s_).bind(this))),ee(this,p,()=>Ne(this,g,Bg).call(this)),(S=this.shadowRoot)==null||S.addEventListener("slotchange",w(this,p)),Ne(this,g,Bg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Bg=function(){var N;let S=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,j;S.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(j=this.nativeEl)==null||j.append(H),Ne(this,g,$g).call(this,H)}),S.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},s_=function(S){var C;for(let P of S)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ne(this,g,$g).call(this,H))}},$g=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},r_=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let C=this[S];delete this[S],this[S]=C}},n_=function(S,C,P){var N,$,H;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(S):(($=this.nativeEl)==null?void 0:$.getAttribute(S))!==P&&((H=this.nativeEl)==null||H.setAttribute(S,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Nw:Uw),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",e_),oe(o,l,!1),o}function Fw(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 o_(i){let e="";for(let t in i){if(!t_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Bw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Zb,rl=a_((Zb=globalThis.HTMLElement)!=null?Zb:class{},{tag:"video"}),Jb,kN=a_((Jb=globalThis.HTMLElement)!=null?Jb:class{},{tag:"audio"});var u_=i=>{throw TypeError(i)},Hg=(i,e,t)=>e.has(i)||u_("Cannot "+t),pt=(i,e,t)=>(Hg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?u_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(Hg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),zu=(i,e,t)=>(Hg(i,e,"access private method"),t),$w=()=>{try{return"0.31.0"}catch{}return"UNKNOWN"},Hw=$w(),Gw=()=>Hw,Kw=`
|
|
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",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"},Vw=Object.values(k),l_=Gw(),d_="mux-video",nl,Qu,al,Xu,Zu,Ju,ec,tc,ol,ic,Ei,nn,sc,ll,c_=class extends rl{constructor(){super(),vi(this,Ei),vi(this,nl),vi(this,Qu),vi(this,al,{}),vi(this,Xu,{}),vi(this,Zu),vi(this,Ju),vi(this,ec),vi(this,tc),vi(this,ol,""),vi(this,ic,i=>{var e;let t=Hb(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())}),vi(this,sc),Pi(this,Qu,Wu())}static get NAME(){return d_}static get VERSION(){return l_}static get observedAttributes(){var i;return[...Vw,...(i=rl.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?Kw:`<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 ci{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=v2;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var O1=i=>{throw TypeError(i)},iE=(i,e,t)=>e.has(i)||O1("Cannot "+t),ve=(i,e,t)=>(iE(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>e.has(i)?O1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ii=(i,e,t,s)=>(iE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(iE(i,e,"access private method"),t),Vf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Vf{}globalThis.DocumentFragment=i}var sE=class extends Vf{},E2=class extends Vf{},y2={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(sE)}},Of,T2=class{constructor(i,e={}){Ot(this,Of),ii(this,Of,e==null?void 0:e.detail)}get detail(){return ve(this,Of)}initCustomEvent(){}};Of=new WeakMap;function b2(i,e){return new sE}var N1={document:{createElement:b2},DocumentFragment,customElements:y2,CustomEvent:T2,EventTarget:Vf,HTMLElement:sE,HTMLVideoElement:E2},U1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=U1?N1:globalThis,$f=U1?N1.document:globalThis.document;function _2(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${Zv(t)}: ${s}; `)}),e?e.trim():void 0}function Zv(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function F1(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 B1(i){let e=A2(i).toString();return e?"?"+e:""}function A2(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var $1=(i,e)=>!i||!e?!1:i.contains(e)?!0:$1(i,e.getRootNode().host),H1="mux.com",S2=()=>{try{return"3.
|
|
2023
|
+
`}var yo=class extends ci{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=v2;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var O1=i=>{throw TypeError(i)},iE=(i,e,t)=>e.has(i)||O1("Cannot "+t),ve=(i,e,t)=>(iE(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>e.has(i)?O1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ii=(i,e,t,s)=>(iE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(iE(i,e,"access private method"),t),Vf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Vf{}globalThis.DocumentFragment=i}var sE=class extends Vf{},E2=class extends Vf{},y2={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(sE)}},Of,T2=class{constructor(i,e={}){Ot(this,Of),ii(this,Of,e==null?void 0:e.detail)}get detail(){return ve(this,Of)}initCustomEvent(){}};Of=new WeakMap;function b2(i,e){return new sE}var N1={document:{createElement:b2},DocumentFragment,customElements:y2,CustomEvent:T2,EventTarget:Vf,HTMLElement:sE,HTMLVideoElement:E2},U1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=U1?N1:globalThis,$f=U1?N1.document:globalThis.document;function _2(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${Zv(t)}: ${s}; `)}),e?e.trim():void 0}function Zv(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function F1(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 B1(i){let e=A2(i).toString();return e?"?"+e:""}function A2(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var $1=(i,e)=>!i||!e?!1:i.contains(e)?!0:$1(i,e.getRootNode().host),H1="mux.com",S2=()=>{try{return"3.13.0"}catch{}return"UNKNOWN"},I2=S2(),G1=()=>I2,L2=(i,{token:e,customDomain:t=H1,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${B1({token:e,time:a,program_time:r})}`},R2=(i,{token:e,customDomain:t=H1,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${B1({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},rE=i=>{if(i){if([we.LIVE,we.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return we.LIVE}},x2={crossorigin:"crossOrigin",playsinline:"playsInline"};function k2(i){var e;return(e=x2[i])!=null?e:F1(i)}var To,bo,ti,D2=class{constructor(i,e){Ot(this,To),Ot(this,bo),Ot(this,ti,[]),ii(this,To,i),ii(this,bo,e)}[Symbol.iterator](){return ve(this,ti).values()}get length(){return ve(this,ti).length}get value(){var i;return(i=ve(this,ti).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(ii(this,ti,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return ve(this,ti)[i]}values(){return ve(this,ti).values()}keys(){return ve(this,ti).keys()}forEach(i){ve(this,ti).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||ve(this,ti).push(s)}),!(this.value===""&&!((e=ve(this,To))!=null&&e.hasAttribute(`${ve(this,bo)}`)))&&((t=ve(this,To))==null||t.setAttribute(`${ve(this,bo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{ve(this,ti).splice(ve(this,ti).indexOf(t),1)}),(e=ve(this,To))==null||e.setAttribute(`${ve(this,bo)}`,`${this.value}`)}contains(i){return ve(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 K1=`[mux-player ${G1()}]`;function Qs(...i){console.warn(K1,...i)}function hi(...i){console.error(K1,...i)}function T1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${te("Read more: ")}
|
|
2024
2024
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qs(t)}var Pt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Gr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Z6={...Pt,...Gr},b1=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}}),C2=Object.values(Pt).filter(i=>Pt.PLAYSINLINE!==i),w2=Object.values(Gr),M2=[...C2,...w2],P2=class extends Ss.HTMLElement{static get observedAttributes(){return M2}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case Gr.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Gr.VOLUME:{let n=(s=Ut(t))!=null?s:1;this.media&&(this.media.volume=n);return}case Gr.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:b1}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:b1}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(Gr.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Gr.PLAYBACKRATE,`${i}`):this.removeAttribute(Gr.PLAYBACKRATE)}get crossOrigin(){return _d(this,Pt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Pt.CROSSORIGIN,`${i}`)}get autoplay(){return _d(this,Pt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Pt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Pt.AUTOPLAY)}get loop(){return _d(this,Pt.LOOP)!=null}set loop(i){i?this.setAttribute(Pt.LOOP,""):this.removeAttribute(Pt.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,Pt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Pt.MUTED,""):this.removeAttribute(Pt.MUTED)}get playsInline(){return _d(this,Pt.PLAYSINLINE)!=null}set playsInline(i){hi("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(Pt.PRELOAD,i):this.removeAttribute(Pt.PRELOAD)}};function _d(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var _1=P2,O2=`: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${o_(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function a_(i,{tag:e,is:t}){var n,a,o,l,d,i_,c,h,f,m,p,g,rn,Fg,Bg,s_,$g,r_,n_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?Fw(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 Ne(C=o,d,i_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...t_]}get nativeEl(){var S,C,P,N,$;return Ne(this,g,rn).call(this),($=(N=(C=(S=w(this,h))!=null?S: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(S){ee(this,h,S)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(S){this.toggleAttribute("muted",S)}get src(){return this.getAttribute("src")}set src(S){this.setAttribute("src",`${S}`)}get preload(){var S,C;return(C=this.getAttribute("preload"))!=null?C:(S=this.nativeEl)==null?void 0:S.preload}set preload(S){this.setAttribute("preload",`${S}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=Bw(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of r)Ne(this,g,r_).call(this,S);Ne(this,g,Fg).call(this)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,C,P){Ne(this,g,rn).call(this),Ne(this,g,n_).call(this,S,C,P)}connectedCallback(){Ne(this,g,rn).call(this),w(this,p)||Ne(this,g,Fg).call(this)}disconnectedCallback(){var S,C,P;(S=w(this,m))==null||S.disconnect(),ee(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ee(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(),ee(this,h,null)}},l=new WeakMap,d=new WeakSet,i_=function(){if(w(this,l))return;ee(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ne(this,g,rn).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;Ne(this,g,rn).call(this);let N=C.toLowerCase();if(S.has(N)){let j=this.getAttribute(N);return j===null?!1:j===""?!0:j}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){Ne(this,g,rn).call(this);let $=C.toLowerCase();if(S.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,rn=function(){w(this,c)||(ee(this,c,!0),this.init())},Fg=function(){var S,C;ee(this,m,new MutationObserver(Ne(this,g,s_).bind(this))),ee(this,p,()=>Ne(this,g,Bg).call(this)),(S=this.shadowRoot)==null||S.addEventListener("slotchange",w(this,p)),Ne(this,g,Bg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Bg=function(){var N;let S=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,j;S.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(j=this.nativeEl)==null||j.append(H),Ne(this,g,$g).call(this,H)}),S.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},s_=function(S){var C;for(let P of S)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ne(this,g,$g).call(this,H))}},$g=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},r_=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let C=this[S];delete this[S],this[S]=C}},n_=function(S,C,P){var N,$,H;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(S):(($=this.nativeEl)==null?void 0:$.getAttribute(S))!==P&&((H=this.nativeEl)==null||H.setAttribute(S,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Nw:Uw),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",e_),oe(o,l,!1),o}function Fw(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 o_(i){let e="";for(let t in i){if(!t_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Bw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Zb,rl=a_((Zb=globalThis.HTMLElement)!=null?Zb:class{},{tag:"video"}),Jb,kN=a_((Jb=globalThis.HTMLElement)!=null?Jb:class{},{tag:"audio"});var u_=i=>{throw TypeError(i)},Hg=(i,e,t)=>e.has(i)||u_("Cannot "+t),pt=(i,e,t)=>(Hg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?u_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(Hg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),zu=(i,e,t)=>(Hg(i,e,"access private method"),t),$w=()=>{try{return"0.
|
|
109
|
+
`}function a_(i,{tag:e,is:t}){var n,a,o,l,d,i_,c,h,f,m,p,g,rn,Fg,Bg,s_,$g,r_,n_;let s=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),r=s?Fw(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 Ne(C=o,d,i_).call(C),[...(N=(P=s==null?void 0:s.constructor)==null?void 0:P.observedAttributes)!=null?N:[],...t_]}get nativeEl(){var S,C,P,N,$;return Ne(this,g,rn).call(this),($=(N=(C=(S=w(this,h))!=null?S: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(S){ee(this,h,S)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(S){this.toggleAttribute("muted",S)}get src(){return this.getAttribute("src")}set src(S){this.setAttribute("src",`${S}`)}get preload(){var S,C;return(C=this.getAttribute("preload"))!=null?C:(S=this.nativeEl)==null?void 0:S.preload}set preload(S){this.setAttribute("preload",`${S}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=Bw(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of r)Ne(this,g,r_).call(this,S);Ne(this,g,Fg).call(this)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,C,P){Ne(this,g,rn).call(this),Ne(this,g,n_).call(this,S,C,P)}connectedCallback(){Ne(this,g,rn).call(this),w(this,p)||Ne(this,g,Fg).call(this)}disconnectedCallback(){var S,C,P;(S=w(this,m))==null||S.disconnect(),ee(this,m,void 0),w(this,p)&&((C=this.shadowRoot)==null||C.removeEventListener("slotchange",w(this,p)),ee(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(),ee(this,h,null)}},l=new WeakMap,d=new WeakSet,i_=function(){if(w(this,l))return;ee(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let C of r)if(!(C in this.prototype))if(typeof s[C]=="function")this.prototype[C]=function(...P){return Ne(this,g,rn).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;Ne(this,g,rn).call(this);let N=C.toLowerCase();if(S.has(N)){let j=this.getAttribute(N);return j===null?!1:j===""?!0:j}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){Ne(this,g,rn).call(this);let $=C.toLowerCase();if(S.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,rn=function(){w(this,c)||(ee(this,c,!0),this.init())},Fg=function(){var S,C;ee(this,m,new MutationObserver(Ne(this,g,s_).bind(this))),ee(this,p,()=>Ne(this,g,Bg).call(this)),(S=this.shadowRoot)==null||S.addEventListener("slotchange",w(this,p)),Ne(this,g,Bg).call(this);for(let P of this.constructor.Events)(C=this.shadowRoot)==null||C.addEventListener(P,this,!0)},Bg=function(){var N;let S=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,j;S.delete($);let H=w(this,f).get($);H||(H=$.cloneNode(),w(this,f).set($,H),(U=w(this,m))==null||U.observe($,{attributes:!0})),(j=this.nativeEl)==null||j.append(H),Ne(this,g,$g).call(this,H)}),S.forEach(($,H)=>{$.remove(),w(this,f).delete(H)})},s_=function(S){var C;for(let P of S)if(P.type==="attributes"){let{target:N,attributeName:$}=P,H=w(this,f).get(N);H&&$&&(H.setAttribute($,(C=N.getAttribute($))!=null?C:""),Ne(this,g,$g).call(this,H))}},$g=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},r_=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let C=this[S];delete this[S],this[S]=C}},n_=function(S,C,P){var N,$,H;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(P===null?(N=this.nativeEl)==null||N.removeAttribute(S):(($=this.nativeEl)==null?void 0:$.getAttribute(S))!==P&&((H=this.nativeEl)==null||H.setAttribute(S,P)))},oe(o,d),Ie(o,"getTemplateHTML",e.endsWith("audio")?Nw:Uw),Ie(o,"shadowRootOptions",{mode:"open"}),Ie(o,"Events",e_),oe(o,l,!1),o}function Fw(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 o_(i){let e="";for(let t in i){if(!t_.includes(t))continue;let s=i[t];s===""?e+=` ${t}`:e+=` ${t}="${s}"`}return e}function Bw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Zb,rl=a_((Zb=globalThis.HTMLElement)!=null?Zb:class{},{tag:"video"}),Jb,kN=a_((Jb=globalThis.HTMLElement)!=null?Jb:class{},{tag:"audio"});var u_=i=>{throw TypeError(i)},Hg=(i,e,t)=>e.has(i)||u_("Cannot "+t),pt=(i,e,t)=>(Hg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?u_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Pi=(i,e,t,s)=>(Hg(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),zu=(i,e,t)=>(Hg(i,e,"access private method"),t),$w=()=>{try{return"0.31.0"}catch{}return"UNKNOWN"},Hw=$w(),Gw=()=>Hw,Kw=`
|
|
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",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"},Vw=Object.values(k),l_=Gw(),d_="mux-video",nl,Qu,al,Xu,Zu,Ju,ec,tc,ol,ic,Ei,nn,sc,ll,c_=class extends rl{constructor(){super(),vi(this,Ei),vi(this,nl),vi(this,Qu),vi(this,al,{}),vi(this,Xu,{}),vi(this,Zu),vi(this,Ju),vi(this,ec),vi(this,tc),vi(this,ol,""),vi(this,ic,i=>{var e;let t=Hb(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())}),vi(this,sc),Pi(this,Qu,Wu())}static get NAME(){return d_}static get VERSION(){return l_}static get observedAttributes(){var i;return[...Vw,...(i=rl.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?Kw:`<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 ci{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=v2;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var O1=i=>{throw TypeError(i)},iE=(i,e,t)=>e.has(i)||O1("Cannot "+t),ve=(i,e,t)=>(iE(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>e.has(i)?O1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ii=(i,e,t,s)=>(iE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(iE(i,e,"access private method"),t),Vf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Vf{}globalThis.DocumentFragment=i}var sE=class extends Vf{},E2=class extends Vf{},y2={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(sE)}},Of,T2=class{constructor(i,e={}){Ot(this,Of),ii(this,Of,e==null?void 0:e.detail)}get detail(){return ve(this,Of)}initCustomEvent(){}};Of=new WeakMap;function b2(i,e){return new sE}var N1={document:{createElement:b2},DocumentFragment,customElements:y2,CustomEvent:T2,EventTarget:Vf,HTMLElement:sE,HTMLVideoElement:E2},U1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=U1?N1:globalThis,$f=U1?N1.document:globalThis.document;function _2(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${Zv(t)}: ${s}; `)}),e?e.trim():void 0}function Zv(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function F1(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 B1(i){let e=A2(i).toString();return e?"?"+e:""}function A2(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var $1=(i,e)=>!i||!e?!1:i.contains(e)?!0:$1(i,e.getRootNode().host),H1="mux.com",S2=()=>{try{return"3.
|
|
2023
|
+
`}var yo=class extends ci{};yo.shadowRootOptions={mode:"open"};yo.getTemplateHTML=v2;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",yo);var O1=i=>{throw TypeError(i)},iE=(i,e,t)=>e.has(i)||O1("Cannot "+t),ve=(i,e,t)=>(iE(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>e.has(i)?O1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ii=(i,e,t,s)=>(iE(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(iE(i,e,"access private method"),t),Vf=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Vf{}globalThis.DocumentFragment=i}var sE=class extends Vf{},E2=class extends Vf{},y2={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(sE)}},Of,T2=class{constructor(i,e={}){Ot(this,Of),ii(this,Of,e==null?void 0:e.detail)}get detail(){return ve(this,Of)}initCustomEvent(){}};Of=new WeakMap;function b2(i,e){return new sE}var N1={document:{createElement:b2},DocumentFragment,customElements:y2,CustomEvent:T2,EventTarget:Vf,HTMLElement:sE,HTMLVideoElement:E2},U1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Ss=U1?N1:globalThis,$f=U1?N1.document:globalThis.document;function _2(i){let e="";return Object.entries(i).forEach(([t,s])=>{s!=null&&(e+=`${Zv(t)}: ${s}; `)}),e?e.trim():void 0}function Zv(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function F1(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 B1(i){let e=A2(i).toString();return e?"?"+e:""}function A2(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var $1=(i,e)=>!i||!e?!1:i.contains(e)?!0:$1(i,e.getRootNode().host),H1="mux.com",S2=()=>{try{return"3.13.0"}catch{}return"UNKNOWN"},I2=S2(),G1=()=>I2,L2=(i,{token:e,customDomain:t=H1,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${B1({token:e,time:a,program_time:r})}`},R2=(i,{token:e,customDomain:t=H1,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${B1({token:e,format:"webp",program_start_time:s,program_end_time:r})}`},rE=i=>{if(i){if([we.LIVE,we.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return we.LIVE}},x2={crossorigin:"crossOrigin",playsinline:"playsInline"};function k2(i){var e;return(e=x2[i])!=null?e:F1(i)}var To,bo,ti,D2=class{constructor(i,e){Ot(this,To),Ot(this,bo),Ot(this,ti,[]),ii(this,To,i),ii(this,bo,e)}[Symbol.iterator](){return ve(this,ti).values()}get length(){return ve(this,ti).length}get value(){var i;return(i=ve(this,ti).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(ii(this,ti,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return ve(this,ti)[i]}values(){return ve(this,ti).values()}keys(){return ve(this,ti).keys()}forEach(i){ve(this,ti).forEach(i)}add(...i){var e,t;i.forEach(s=>{this.contains(s)||ve(this,ti).push(s)}),!(this.value===""&&!((e=ve(this,To))!=null&&e.hasAttribute(`${ve(this,bo)}`)))&&((t=ve(this,To))==null||t.setAttribute(`${ve(this,bo)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{ve(this,ti).splice(ve(this,ti).indexOf(t),1)}),(e=ve(this,To))==null||e.setAttribute(`${ve(this,bo)}`,`${this.value}`)}contains(i){return ve(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 K1=`[mux-player ${G1()}]`;function Qs(...i){console.warn(K1,...i)}function hi(...i){console.error(K1,...i)}function T1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${te("Read more: ")}
|
|
2024
2024
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qs(t)}var Pt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Gr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Z6={...Pt,...Gr},b1=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}}),C2=Object.values(Pt).filter(i=>Pt.PLAYSINLINE!==i),w2=Object.values(Gr),M2=[...C2,...w2],P2=class extends Ss.HTMLElement{static get observedAttributes(){return M2}constructor(){super()}attributeChangedCallback(i,e,t){var s,r;switch(i){case Gr.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Gr.VOLUME:{let n=(s=Ut(t))!=null?s:1;this.media&&(this.media.volume=n);return}case Gr.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:b1}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:b1}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(Gr.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Gr.PLAYBACKRATE,`${i}`):this.removeAttribute(Gr.PLAYBACKRATE)}get crossOrigin(){return _d(this,Pt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(Pt.CROSSORIGIN,`${i}`)}get autoplay(){return _d(this,Pt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(Pt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(Pt.AUTOPLAY)}get loop(){return _d(this,Pt.LOOP)!=null}set loop(i){i?this.setAttribute(Pt.LOOP,""):this.removeAttribute(Pt.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,Pt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(Pt.MUTED,""):this.removeAttribute(Pt.MUTED)}get playsInline(){return _d(this,Pt.PLAYSINLINE)!=null}set playsInline(i){hi("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(Pt.PRELOAD,i):this.removeAttribute(Pt.PRELOAD)}};function _d(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var _1=P2,O2=`: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.
|
|
3
|
+
"version": "3.13.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.
|
|
129
|
-
"@mux/playback-core": "0.
|
|
128
|
+
"@mux/mux-video": "0.31.0",
|
|
129
|
+
"@mux/playback-core": "0.35.0",
|
|
130
130
|
"media-chrome": "~4.19.0",
|
|
131
131
|
"player.style": "^0.3.0"
|
|
132
132
|
},
|