@mux/mux-player 3.11.5-canary.0 → 3.11.5
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
|
@@ -1399,7 +1399,7 @@
|
|
|
1399
1399
|
<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"/>
|
|
1400
1400
|
</svg>
|
|
1401
1401
|
</div>
|
|
1402
|
-
`}function tv(){return h("Loop")}var wr=class extends H{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};wr.getSlotTemplateHTML=ev;wr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",wr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${On(i)}: ${a}; `)}),e?e.trim():void 0}function On(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Hl(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 Bl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Bl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.11.
|
|
1402
|
+
`}function tv(){return h("Loop")}var wr=class extends H{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};wr.getSlotTemplateHTML=ev;wr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",wr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${On(i)}: ${a}; `)}),e?e.trim():void 0}function On(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Hl(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 Bl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Bl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},rv=av(),Un=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Hl({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Hl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Rr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:Pn(t)}var ui,ci,me,Nn=class{constructor(e,i){fe(this,ui);fe(this,ci);fe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${this.value}`)}contains(e){return B(this,me).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)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Un()}]`;function at(...t){console.warn(rm,...t)}function he(...t){console.error(rm,...t)}function $l(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
|
|
1403
1403
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},lA={...le,...Pt},nm=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}}),nv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),sv=Object.values(Pt),lv=[...nv,...sv],Wl=class extends ke.HTMLElement{static get observedAttributes(){return lv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:nm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:nm}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=ce(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return xr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return xr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return xr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return xr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return xr(this,le.PLAYSINLINE)!=null}set playsInline(e){he("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(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function xr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Fl=Wl;var cm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(cm(t,e,"read from private field"),i?i.call(t):e.get(t)),rt=(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)},gt=(t,e,i,a)=>(cm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Hn,hi,Dr,Nt,Ut,Ht,pi,oa,Bn,$e,sm=1,lm=0,dv=1,uv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof pe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof pe?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=uv){var r;super(),rt(this,ra,void 0),rt(this,Hn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,mm(this)),gt(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,P(this,ra),i),a.processCallback(this,P(this,ra),i)}update(e){P(this,Hn).processCallback(this,P(this,ra),e)}};ra=new WeakMap;Hn=new WeakMap;var mm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Vl;for([i,a]of um(r.value))if(!i)o.append(a);else{let s=new pe(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===sm&&!(r instanceof HTMLTemplateElement))mm(r,e);else{let o=r.data;if(r.nodeType===sm||o.includes("{{")){let s=[];if(o)for([i,a]of um(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Or(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},dm={},um=t=>{let e="",i=0,a=dm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([lm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([dv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([lm,(i>0?"{{":"")+e]),dm[t]=a},cv=11,$n=class{get value(){return""}set value(e){}toString(){return this.value}},hm=new WeakMap,Vl=class{constructor(){rt(this,hi,[])}[Symbol.iterator](){return P(this,hi).values()}get length(){return P(this,hi).length}item(e){return P(this,hi)[e]}append(...e){for(let i of e)i instanceof pe&&hm.set(i,this),P(this,hi).push(i)}toString(){return P(this,hi).join("")}};hi=new WeakMap;var pe=class extends $n{constructor(e,i,a){super(),rt(this,pi),rt(this,Dr,""),rt(this,Nt,void 0),rt(this,Ut,void 0),rt(this,Ht,void 0),gt(this,Nt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return P(this,Ut)}get attributeNamespace(){return P(this,Ht)}get element(){return P(this,Nt)}get value(){return P(this,Dr)}set value(e){P(this,Dr)!==e&&(gt(this,Dr,e),!P(this,pi,oa)||P(this,pi,oa).length===1?e==null?P(this,Nt).removeAttributeNS(P(this,Ht),P(this,Ut)):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),e):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),P(this,pi,oa).toString()))}get booleanValue(){return P(this,Nt).hasAttributeNS(P(this,Ht),P(this,Ut))}set booleanValue(e){if(!P(this,pi,oa)||P(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Dr=new WeakMap;Nt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return hm.get(this)};var At=class extends $n{constructor(e,i){super(),rt(this,Bn,void 0),rt(this,$e,void 0),gt(this,Bn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return P(this,$e)}get parentNode(){return P(this,Bn)}get nextSibling(){return P(this,$e)[P(this,$e).length-1].nextSibling}get previousSibling(){return P(this,$e)[0].previousSibling}get value(){return P(this,$e).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===cv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,mv(P(this,$e)[0].parentNode,P(this,$e),i,this.nextSibling))}};Bn=new WeakMap;$e=new WeakMap;var Or=class extends At{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 mv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var pm={string:t=>String(t)},Fn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Kl={partial:(t,e)=>{e[t.expression]=new Fn(t.template)},if:(t,e)=>{var i;if(vm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Vn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},hv=Object.keys(Kl),Vn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Or){if(!s.directive){let u=hv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Kl[s.directive])==null||a.call(Kl,s,i);continue}let d=vm(o,i);if(d instanceof Fn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Vn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof pe&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof pe?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof pe?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},fm={"!":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=pm[e])==null?void 0:i.call(pm,t)}};function pv(t){return fv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function vm(t,e={}){var i,a,r,o,s,d,u;let p=pv(t);if(p.length===0||p.some(({type:T})=>!T))return Pr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Pr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let M=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,C=(s=E[f+2])==null?void 0:s.token;M&&b==="="&&(_[M]=Nr(C,e))}return T}if(p.length===1)return Wn(p[0])?Nr(p[0].token,e):Pr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=fm[T];if(!_||!Wn(p[1]))return Pr(t);let E=Nr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=fm[T];if(!_||!Wn(p[0])||!Wn(p[2]))return Pr(t);let E=Nr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Nr(p[2].token,e);return _(E,f)}}function Pr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Wn({type:t}){return["number","boolean","string","param"].includes(t)}function Nr(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):mo(t)?parseFloat(t):e[t]}function fv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var Ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ql=(t,e,i)=>(Ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Ur=(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)},Ei=(t,e,i,a)=>(Ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(Ql(t,e,"access private method"),i),na,Kn,sa,Zl,Em,Gn,zl,Yl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},bm=V.createElement("template");bm.innerHTML=`
|
|
1404
1404
|
<style>
|
|
1405
1405
|
:host {
|
package/dist/base.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var tt=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||tt("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?tt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Bt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Ht(t,a){return new G}var at={document:{createElement:Ht},DocumentFragment,customElements:Bt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},it=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=it?at:globalThis,w=it?at.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as It}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Rt,MediaUIAttributes as ce,MediaUIEvents as xt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as B,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as Ea}from"@mux/playback-core";import{i18n as Wt}from"@mux/playback-core";import{StreamTypes as Ee,parseJwt as ot}from"@mux/playback-core";function rt(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var nt="mux.com",$t=()=>{try{return"3.11.
|
|
1
|
+
var tt=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||tt("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?tt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Bt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Ht(t,a){return new G}var at={document:{createElement:Ht},DocumentFragment,customElements:Bt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},it=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=it?at:globalThis,w=it?at.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as It}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Rt,MediaUIAttributes as ce,MediaUIEvents as xt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as B,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as Ea}from"@mux/playback-core";import{i18n as Wt}from"@mux/playback-core";import{StreamTypes as Ee,parseJwt as ot}from"@mux/playback-core";function rt(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var nt="mux.com",$t=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},Ft=$t(),se=()=>Ft,st=(t,{token:a,customDomain:e=nt,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=ot(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},dt=(t,{token:a,customDomain:e=nt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=ot(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([Ee.LIVE,Ee.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ee.LIVE}};var Yt={crossorigin:"crossOrigin",playsinline:"playsInline"};function lt(t){var a;return(a=Yt[t])!=null?a:oe(t)}var D,U,T,ne=class{constructor(a,e){v(this,D);v(this,U);v(this,T,[]);C(this,D,a),C(this,U,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,D))!=null&&e.hasAttribute(`${u(this,U)}`)))&&((i=u(this,D))==null||i.setAttribute(`${u(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,D))==null||e.setAttribute(`${u(this,U)}`,`${this.value}`)}contains(a){return u(this,T).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)}};D=new WeakMap,U=new WeakMap,T=new WeakMap;var ut=`[mux-player ${se()}]`;function x(...t){console.warn(ut,...t)}function E(...t){console.error(ut,...t)}function ve(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Wt("Read more: ")}
|
|
2
2
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),x(a)}var g={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},N={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},$a={...g,...N},ct=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}}),Zt=Object.values(g).filter(t=>g.PLAYSINLINE!==t),Gt=Object.values(N),jt=[...Zt,...Gt],Ae=class extends k.HTMLElement{static get observedAttributes(){return jt}constructor(){super()}attributeChangedCallback(a,e,i){var r,n;switch(a){case N.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case N.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case N.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:ct}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:ct}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(N.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(N.PLAYBACKRATE,`${a}`):this.removeAttribute(N.PLAYBACKRATE)}get crossOrigin(){return X(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return X(this,g.LOOP)!=null}set loop(a){a?this.setAttribute(g.LOOP,""):this.removeAttribute(g.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return X(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return X(this,g.PLAYSINLINE)!=null}set playsInline(a){E("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(g.PRELOAD,a):this.removeAttribute(g.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var pt=`: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=>xi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${OT(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function PT(i,{tag:e,is:t}){var n,a,o,l,d,DT,c,h,f,m,p,Ws,pg,CT,gg,wT,MT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?uw(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var R,x,D;return Be(R=o,d,DT).call(R),[...(D=(x=r==null?void 0:r.constructor)==null?void 0:x.observedAttributes)!=null?D:[],...kT]}get nativeEl(){var S,R,x,D,P;return Be(this,p,Ws).call(this),(P=(D=(R=(S=w(this,h))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?R:this.querySelector(e))!=null?D:(x=this.shadowRoot)==null?void 0:x.querySelector(e))!=null?P:null}set nativeEl(S){se(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,R;return(R=this.getAttribute("preload"))!=null?R:(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=cw(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 s)Be(this,p,wT).call(this,S);se(this,m,new MutationObserver(Be(this,p,CT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Be(this,p,pg).call(this)),Be(this,p,pg).call(this);for(let S of this.constructor.Events)this.shadowRoot.addEventListener(S,this,!0)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,R,x){Be(this,p,Ws).call(this),Be(this,p,MT).call(this,S,R,x)}connectedCallback(){Be(this,p,Ws).call(this)}},l=new WeakMap,d=new WeakSet,DT=function(){if(w(this,l))return;se(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let R of s)if(!(R in this.prototype))if(typeof r[R]=="function")this.prototype[R]=function(...x){return Be(this,p,Ws).call(this),(()=>{var F;if(this.call)return this.call(R,...x);let P=(F=this.nativeEl)==null?void 0:F[R];return P==null?void 0:P.apply(this.nativeEl,x)})()};else{let x={get(){var P,F,j;Be(this,p,Ws).call(this);let D=R.toLowerCase();if(S.has(D)){let q=this.getAttribute(D);return q===null?!1:q===""?!0:q}return(j=(P=this.get)==null?void 0:P.call(this,R))!=null?j:(F=this.nativeEl)==null?void 0:F[R]}};R!==R.toUpperCase()&&(x.set=function(D){Be(this,p,Ws).call(this);let P=R.toLowerCase();if(S.has(P)){D===!0||D===!1||D==null?this.toggleAttribute(P,!!D):this.setAttribute(P,D);return}if(this.set){this.set(R,D);return}this.nativeEl&&(this.nativeEl[R]=D)}),Object.defineProperty(this.prototype,R,x)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Ws=function(){w(this,c)||(se(this,c,!0),this.init())},pg=function(){var D;let S=new Map(w(this,f)),R=(D=this.shadowRoot)==null?void 0:D.querySelector("slot:not([name])");(R==null?void 0:R.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var j,q;S.delete(P);let F=w(this,f).get(P);F||(F=P.cloneNode(),w(this,f).set(P,F),(j=w(this,m))==null||j.observe(P,{attributes:!0})),(q=this.nativeEl)==null||q.append(F),Be(this,p,gg).call(this,F)}),S.forEach((P,F)=>{P.remove(),w(this,f).delete(F)})},CT=function(S){var R;for(let x of S)if(x.type==="attributes"){let{target:D,attributeName:P}=x,F=w(this,f).get(D);F&&P&&(F.setAttribute(P,(R=D.getAttribute(P))!=null?R:""),Be(this,p,gg).call(this,F))}},gg=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},wT=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let R=this[S];delete this[S],this[S]=R}},MT=function(S,R,x){var D,P,F;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(x===null?(D=this.nativeEl)==null||D.removeAttribute(S):((P=this.nativeEl)==null?void 0:P.getAttribute(S))!==x&&((F=this.nativeEl)==null||F.setAttribute(S,x)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?lw:dw),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",RT),ae(o,l,!1),o}function uw(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function OT(i){let e="";for(let t in i){if(!kT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var LT,jo=PT((LT=globalThis.HTMLElement)!=null?LT:class{},{tag:"video"}),xT,eN=PT((xT=globalThis.HTMLElement)!=null?xT:class{},{tag:"audio"});var FT=i=>{throw TypeError(i)},vg=(i,e,t)=>e.has(i)||FT("Cannot "+t),Lt=(i,e,t)=>(vg(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>e.has(i)?FT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ci=(i,e,t,r)=>(vg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nu=(i,e,t)=>(vg(i,e,"access private method"),t),hw=()=>{try{return"0.30.
|
|
109
|
+
`}function PT(i,{tag:e,is:t}){var n,a,o,l,d,DT,c,h,f,m,p,Ws,pg,CT,gg,wT,MT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?uw(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var R,x,D;return Be(R=o,d,DT).call(R),[...(D=(x=r==null?void 0:r.constructor)==null?void 0:x.observedAttributes)!=null?D:[],...kT]}get nativeEl(){var S,R,x,D,P;return Be(this,p,Ws).call(this),(P=(D=(R=(S=w(this,h))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?R:this.querySelector(e))!=null?D:(x=this.shadowRoot)==null?void 0:x.querySelector(e))!=null?P:null}set nativeEl(S){se(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,R;return(R=this.getAttribute("preload"))!=null?R:(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=cw(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 s)Be(this,p,wT).call(this,S);se(this,m,new MutationObserver(Be(this,p,CT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Be(this,p,pg).call(this)),Be(this,p,pg).call(this);for(let S of this.constructor.Events)this.shadowRoot.addEventListener(S,this,!0)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,R,x){Be(this,p,Ws).call(this),Be(this,p,MT).call(this,S,R,x)}connectedCallback(){Be(this,p,Ws).call(this)}},l=new WeakMap,d=new WeakSet,DT=function(){if(w(this,l))return;se(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let R of s)if(!(R in this.prototype))if(typeof r[R]=="function")this.prototype[R]=function(...x){return Be(this,p,Ws).call(this),(()=>{var F;if(this.call)return this.call(R,...x);let P=(F=this.nativeEl)==null?void 0:F[R];return P==null?void 0:P.apply(this.nativeEl,x)})()};else{let x={get(){var P,F,j;Be(this,p,Ws).call(this);let D=R.toLowerCase();if(S.has(D)){let q=this.getAttribute(D);return q===null?!1:q===""?!0:q}return(j=(P=this.get)==null?void 0:P.call(this,R))!=null?j:(F=this.nativeEl)==null?void 0:F[R]}};R!==R.toUpperCase()&&(x.set=function(D){Be(this,p,Ws).call(this);let P=R.toLowerCase();if(S.has(P)){D===!0||D===!1||D==null?this.toggleAttribute(P,!!D):this.setAttribute(P,D);return}if(this.set){this.set(R,D);return}this.nativeEl&&(this.nativeEl[R]=D)}),Object.defineProperty(this.prototype,R,x)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Ws=function(){w(this,c)||(se(this,c,!0),this.init())},pg=function(){var D;let S=new Map(w(this,f)),R=(D=this.shadowRoot)==null?void 0:D.querySelector("slot:not([name])");(R==null?void 0:R.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var j,q;S.delete(P);let F=w(this,f).get(P);F||(F=P.cloneNode(),w(this,f).set(P,F),(j=w(this,m))==null||j.observe(P,{attributes:!0})),(q=this.nativeEl)==null||q.append(F),Be(this,p,gg).call(this,F)}),S.forEach((P,F)=>{P.remove(),w(this,f).delete(F)})},CT=function(S){var R;for(let x of S)if(x.type==="attributes"){let{target:D,attributeName:P}=x,F=w(this,f).get(D);F&&P&&(F.setAttribute(P,(R=D.getAttribute(P))!=null?R:""),Be(this,p,gg).call(this,F))}},gg=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},wT=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let R=this[S];delete this[S],this[S]=R}},MT=function(S,R,x){var D,P,F;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(x===null?(D=this.nativeEl)==null||D.removeAttribute(S):((P=this.nativeEl)==null?void 0:P.getAttribute(S))!==x&&((F=this.nativeEl)==null||F.setAttribute(S,x)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?lw:dw),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",RT),ae(o,l,!1),o}function uw(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function OT(i){let e="";for(let t in i){if(!kT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var LT,jo=PT((LT=globalThis.HTMLElement)!=null?LT:class{},{tag:"video"}),xT,eN=PT((xT=globalThis.HTMLElement)!=null?xT:class{},{tag:"audio"});var FT=i=>{throw TypeError(i)},vg=(i,e,t)=>e.has(i)||FT("Cannot "+t),Lt=(i,e,t)=>(vg(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>e.has(i)?FT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ci=(i,e,t,r)=>(vg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nu=(i,e,t)=>(vg(i,e,"access private method"),t),hw=()=>{try{return"0.30.3"}catch{}return"UNKNOWN"},fw=hw(),mw=()=>fw,pw=`
|
|
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>`,C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended",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"},gw=Object.values(C),NT=mw(),UT="mux-video",zo,Uu,Qo,Fu,Bu,$u,Hu,Gu,Xo,mi,qs,Ku,Zo,BT=class extends jo{constructor(){super(),Di(this,mi),Di(this,zo),Di(this,Uu),Di(this,Qo,{}),Di(this,Fu,{}),Di(this,Bu),Di(this,$u),Di(this,Hu),Di(this,Gu),Di(this,Xo,""),Di(this,Ku),Ci(this,Uu,wu()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=pT(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Ci(this,Xo,"default"),this.updateLogo())})}static get NAME(){return UT}static get VERSION(){return NT}static get observedAttributes(){var i;return[...gw,...(i=jo.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?pw:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${jo.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -2011,7 +2011,7 @@ Schedule: ${l.map(p=>xi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2011
2011
|
min-height: var(--media-control-height, 24px);
|
|
2012
2012
|
}
|
|
2013
2013
|
</style>
|
|
2014
|
-
`}var uo=class extends oi{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=GO;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",uo);var u1=i=>{throw TypeError(i)},Dv=(i,e,t)=>e.has(i)||u1("Cannot "+t),Fe=(i,e,t)=>(Dv(i,e,"read from private field"),t?t.call(i):e.get(i)),Bi=(i,e,t)=>e.has(i)?u1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),vr=(i,e,t,r)=>(Dv(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft=(i,e,t)=>(Dv(i,e,"access private method"),t),Af=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Af{}globalThis.DocumentFragment=i}var Cv=class extends Af{},KO=class extends Af{},VO={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Cv)}},gf,WO=class{constructor(i,e={}){Bi(this,gf),vr(this,gf,e==null?void 0:e.detail)}get detail(){return Fe(this,gf)}initCustomEvent(){}};gf=new WeakMap;function qO(i,e){return new Cv}var c1={document:{createElement:qO},DocumentFragment,customElements:VO,CustomEvent:WO,EventTarget:Af,HTMLElement:Cv,HTMLVideoElement:KO},h1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",gr=h1?c1:globalThis,_f=h1?c1.document:globalThis.document;function YO(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Lv(t)}: ${r}; `)}),e?e.trim():void 0}function Lv(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 li(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function m1(i){let e=jO(i).toString();return e?"?"+e:""}function jO(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var p1=(i,e)=>!i||!e?!1:i.contains(e)?!0:p1(i,e.getRootNode().host),g1="mux.com",zO=()=>{try{return"3.11.
|
|
2014
|
+
`}var uo=class extends oi{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=GO;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",uo);var u1=i=>{throw TypeError(i)},Dv=(i,e,t)=>e.has(i)||u1("Cannot "+t),Fe=(i,e,t)=>(Dv(i,e,"read from private field"),t?t.call(i):e.get(i)),Bi=(i,e,t)=>e.has(i)?u1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),vr=(i,e,t,r)=>(Dv(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft=(i,e,t)=>(Dv(i,e,"access private method"),t),Af=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Af{}globalThis.DocumentFragment=i}var Cv=class extends Af{},KO=class extends Af{},VO={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Cv)}},gf,WO=class{constructor(i,e={}){Bi(this,gf),vr(this,gf,e==null?void 0:e.detail)}get detail(){return Fe(this,gf)}initCustomEvent(){}};gf=new WeakMap;function qO(i,e){return new Cv}var c1={document:{createElement:qO},DocumentFragment,customElements:VO,CustomEvent:WO,EventTarget:Af,HTMLElement:Cv,HTMLVideoElement:KO},h1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",gr=h1?c1:globalThis,_f=h1?c1.document:globalThis.document;function YO(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Lv(t)}: ${r}; `)}),e?e.trim():void 0}function Lv(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 li(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function m1(i){let e=jO(i).toString();return e?"?"+e:""}function jO(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var p1=(i,e)=>!i||!e?!1:i.contains(e)?!0:p1(i,e.getRootNode().host),g1="mux.com",zO=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},QO=zO(),v1=()=>QO,XO=(i,{token:e,customDomain:t=g1,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Zr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${m1({token:e,time:a,program_time:s})}`},ZO=(i,{token:e,customDomain:t=g1,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Zr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${m1({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},wv=i=>{if(i){if([De.LIVE,De.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return De.LIVE}},JO={crossorigin:"crossOrigin",playsinline:"playsInline"};function e2(i){var e;return(e=JO[i])!=null?e:f1(i)}var co,ho,Qt,t2=class{constructor(i,e){Bi(this,co),Bi(this,ho),Bi(this,Qt,[]),vr(this,co,i),vr(this,ho,e)}[Symbol.iterator](){return Fe(this,Qt).values()}get length(){return Fe(this,Qt).length}get value(){var i;return(i=Fe(this,Qt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(vr(this,Qt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return Fe(this,Qt)[i]}values(){return Fe(this,Qt).values()}keys(){return Fe(this,Qt).keys()}forEach(i){Fe(this,Qt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||Fe(this,Qt).push(r)}),!(this.value===""&&!((e=Fe(this,co))!=null&&e.hasAttribute(`${Fe(this,ho)}`)))&&((t=Fe(this,co))==null||t.setAttribute(`${Fe(this,ho)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{Fe(this,Qt).splice(Fe(this,Qt).indexOf(t),1)}),(e=Fe(this,co))==null||e.setAttribute(`${Fe(this,ho)}`,`${this.value}`)}contains(i){return Fe(this,Qt).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)}};co=new WeakMap,ho=new WeakMap,Qt=new WeakMap;var E1=`[mux-player ${v1()}]`;function Hr(...i){console.warn(E1,...i)}function di(...i){console.error(E1,...i)}function y1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ee("Read more: ")}
|
|
2015
2015
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Hr(t)}var wt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ds={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},T6={...wt,...Ds},zS=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}}),i2=Object.values(wt).filter(i=>wt.PLAYSINLINE!==i),r2=Object.values(Ds),s2=[...i2,...r2],n2=class extends gr.HTMLElement{static get observedAttributes(){return s2}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case Ds.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Ds.VOLUME:{let n=(r=li(t))!=null?r:1;this.media&&(this.media.volume=n);return}case Ds.PLAYBACKRATE:{let n=(s=li(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:zS}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:zS}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=li(this.getAttribute(Ds.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Ds.PLAYBACKRATE,`${i}`):this.removeAttribute(Ds.PLAYBACKRATE)}get crossOrigin(){return hd(this,wt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(wt.CROSSORIGIN,`${i}`)}get autoplay(){return hd(this,wt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(wt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(wt.AUTOPLAY)}get loop(){return hd(this,wt.LOOP)!=null}set loop(i){i?this.setAttribute(wt.LOOP,""):this.removeAttribute(wt.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 hd(this,wt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(wt.MUTED,""):this.removeAttribute(wt.MUTED)}get playsInline(){return hd(this,wt.PLAYSINLINE)!=null}set playsInline(i){di("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(wt.PRELOAD,i):this.removeAttribute(wt.PRELOAD)}};function hd(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var QS=n2,a2=`:host {
|
|
2016
2016
|
--media-control-display: var(--controls);
|
|
2017
2017
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.mjs
CHANGED
|
@@ -106,7 +106,7 @@ Schedule: ${l.map(p=>xi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
106
106
|
<video${OT(i)}></video>
|
|
107
107
|
</slot>
|
|
108
108
|
<slot></slot>
|
|
109
|
-
`}function PT(i,{tag:e,is:t}){var n,a,o,l,d,DT,c,h,f,m,p,Ws,pg,CT,gg,wT,MT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?uw(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var R,x,D;return Be(R=o,d,DT).call(R),[...(D=(x=r==null?void 0:r.constructor)==null?void 0:x.observedAttributes)!=null?D:[],...kT]}get nativeEl(){var S,R,x,D,P;return Be(this,p,Ws).call(this),(P=(D=(R=(S=w(this,h))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?R:this.querySelector(e))!=null?D:(x=this.shadowRoot)==null?void 0:x.querySelector(e))!=null?P:null}set nativeEl(S){se(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,R;return(R=this.getAttribute("preload"))!=null?R:(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=cw(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 s)Be(this,p,wT).call(this,S);se(this,m,new MutationObserver(Be(this,p,CT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Be(this,p,pg).call(this)),Be(this,p,pg).call(this);for(let S of this.constructor.Events)this.shadowRoot.addEventListener(S,this,!0)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,R,x){Be(this,p,Ws).call(this),Be(this,p,MT).call(this,S,R,x)}connectedCallback(){Be(this,p,Ws).call(this)}},l=new WeakMap,d=new WeakSet,DT=function(){if(w(this,l))return;se(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let R of s)if(!(R in this.prototype))if(typeof r[R]=="function")this.prototype[R]=function(...x){return Be(this,p,Ws).call(this),(()=>{var F;if(this.call)return this.call(R,...x);let P=(F=this.nativeEl)==null?void 0:F[R];return P==null?void 0:P.apply(this.nativeEl,x)})()};else{let x={get(){var P,F,j;Be(this,p,Ws).call(this);let D=R.toLowerCase();if(S.has(D)){let q=this.getAttribute(D);return q===null?!1:q===""?!0:q}return(j=(P=this.get)==null?void 0:P.call(this,R))!=null?j:(F=this.nativeEl)==null?void 0:F[R]}};R!==R.toUpperCase()&&(x.set=function(D){Be(this,p,Ws).call(this);let P=R.toLowerCase();if(S.has(P)){D===!0||D===!1||D==null?this.toggleAttribute(P,!!D):this.setAttribute(P,D);return}if(this.set){this.set(R,D);return}this.nativeEl&&(this.nativeEl[R]=D)}),Object.defineProperty(this.prototype,R,x)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Ws=function(){w(this,c)||(se(this,c,!0),this.init())},pg=function(){var D;let S=new Map(w(this,f)),R=(D=this.shadowRoot)==null?void 0:D.querySelector("slot:not([name])");(R==null?void 0:R.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var j,q;S.delete(P);let F=w(this,f).get(P);F||(F=P.cloneNode(),w(this,f).set(P,F),(j=w(this,m))==null||j.observe(P,{attributes:!0})),(q=this.nativeEl)==null||q.append(F),Be(this,p,gg).call(this,F)}),S.forEach((P,F)=>{P.remove(),w(this,f).delete(F)})},CT=function(S){var R;for(let x of S)if(x.type==="attributes"){let{target:D,attributeName:P}=x,F=w(this,f).get(D);F&&P&&(F.setAttribute(P,(R=D.getAttribute(P))!=null?R:""),Be(this,p,gg).call(this,F))}},gg=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},wT=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let R=this[S];delete this[S],this[S]=R}},MT=function(S,R,x){var D,P,F;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(x===null?(D=this.nativeEl)==null||D.removeAttribute(S):((P=this.nativeEl)==null?void 0:P.getAttribute(S))!==x&&((F=this.nativeEl)==null||F.setAttribute(S,x)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?lw:dw),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",RT),ae(o,l,!1),o}function uw(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function OT(i){let e="";for(let t in i){if(!kT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var LT,jo=PT((LT=globalThis.HTMLElement)!=null?LT:class{},{tag:"video"}),xT,eN=PT((xT=globalThis.HTMLElement)!=null?xT:class{},{tag:"audio"});var FT=i=>{throw TypeError(i)},vg=(i,e,t)=>e.has(i)||FT("Cannot "+t),Lt=(i,e,t)=>(vg(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>e.has(i)?FT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ci=(i,e,t,r)=>(vg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nu=(i,e,t)=>(vg(i,e,"access private method"),t),hw=()=>{try{return"0.30.
|
|
109
|
+
`}function PT(i,{tag:e,is:t}){var n,a,o,l,d,DT,c,h,f,m,p,Ws,pg,CT,gg,wT,MT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?uw(r):[];return o=class extends i{constructor(){super(...arguments);ae(this,p);ae(this,c,!1);ae(this,h,null);ae(this,f,new Map);ae(this,m);_e(this,"get");_e(this,"set");_e(this,"call")}static get observedAttributes(){var R,x,D;return Be(R=o,d,DT).call(R),[...(D=(x=r==null?void 0:r.constructor)==null?void 0:x.observedAttributes)!=null?D:[],...kT]}get nativeEl(){var S,R,x,D,P;return Be(this,p,Ws).call(this),(P=(D=(R=(S=w(this,h))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?R:this.querySelector(e))!=null?D:(x=this.shadowRoot)==null?void 0:x.querySelector(e))!=null?P:null}set nativeEl(S){se(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,R;return(R=this.getAttribute("preload"))!=null?R:(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=cw(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 s)Be(this,p,wT).call(this,S);se(this,m,new MutationObserver(Be(this,p,CT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Be(this,p,pg).call(this)),Be(this,p,pg).call(this);for(let S of this.constructor.Events)this.shadowRoot.addEventListener(S,this,!0)}handleEvent(S){S.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(S.type,{detail:S.detail}))}attributeChangedCallback(S,R,x){Be(this,p,Ws).call(this),Be(this,p,MT).call(this,S,R,x)}connectedCallback(){Be(this,p,Ws).call(this)}},l=new WeakMap,d=new WeakSet,DT=function(){if(w(this,l))return;se(this,l,!0);let S=new Set(this.observedAttributes);S.delete("muted");for(let R of s)if(!(R in this.prototype))if(typeof r[R]=="function")this.prototype[R]=function(...x){return Be(this,p,Ws).call(this),(()=>{var F;if(this.call)return this.call(R,...x);let P=(F=this.nativeEl)==null?void 0:F[R];return P==null?void 0:P.apply(this.nativeEl,x)})()};else{let x={get(){var P,F,j;Be(this,p,Ws).call(this);let D=R.toLowerCase();if(S.has(D)){let q=this.getAttribute(D);return q===null?!1:q===""?!0:q}return(j=(P=this.get)==null?void 0:P.call(this,R))!=null?j:(F=this.nativeEl)==null?void 0:F[R]}};R!==R.toUpperCase()&&(x.set=function(D){Be(this,p,Ws).call(this);let P=R.toLowerCase();if(S.has(P)){D===!0||D===!1||D==null?this.toggleAttribute(P,!!D):this.setAttribute(P,D);return}if(this.set){this.set(R,D);return}this.nativeEl&&(this.nativeEl[R]=D)}),Object.defineProperty(this.prototype,R,x)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,Ws=function(){w(this,c)||(se(this,c,!0),this.init())},pg=function(){var D;let S=new Map(w(this,f)),R=(D=this.shadowRoot)==null?void 0:D.querySelector("slot:not([name])");(R==null?void 0:R.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var j,q;S.delete(P);let F=w(this,f).get(P);F||(F=P.cloneNode(),w(this,f).set(P,F),(j=w(this,m))==null||j.observe(P,{attributes:!0})),(q=this.nativeEl)==null||q.append(F),Be(this,p,gg).call(this,F)}),S.forEach((P,F)=>{P.remove(),w(this,f).delete(F)})},CT=function(S){var R;for(let x of S)if(x.type==="attributes"){let{target:D,attributeName:P}=x,F=w(this,f).get(D);F&&P&&(F.setAttribute(P,(R=D.getAttribute(P))!=null?R:""),Be(this,p,gg).call(this,F))}},gg=function(S){S&&S.localName==="track"&&S.default&&(S.kind==="chapters"||S.kind==="metadata")&&S.track.mode==="disabled"&&(S.track.mode="hidden")},wT=function(S){if(Object.prototype.hasOwnProperty.call(this,S)){let R=this[S];delete this[S],this[S]=R}},MT=function(S,R,x){var D,P,F;["id","class"].includes(S)||!o.observedAttributes.includes(S)&&this.constructor.observedAttributes.includes(S)||(x===null?(D=this.nativeEl)==null||D.removeAttribute(S):((P=this.nativeEl)==null?void 0:P.getAttribute(S))!==x&&((F=this.nativeEl)==null||F.setAttribute(S,x)))},ae(o,d),_e(o,"getTemplateHTML",e.endsWith("audio")?lw:dw),_e(o,"shadowRootOptions",{mode:"open"}),_e(o,"Events",RT),ae(o,l,!1),o}function uw(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function OT(i){let e="";for(let t in i){if(!kT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cw(i){let e={};for(let t of i)e[t.name]=t.value;return e}var LT,jo=PT((LT=globalThis.HTMLElement)!=null?LT:class{},{tag:"video"}),xT,eN=PT((xT=globalThis.HTMLElement)!=null?xT:class{},{tag:"audio"});var FT=i=>{throw TypeError(i)},vg=(i,e,t)=>e.has(i)||FT("Cannot "+t),Lt=(i,e,t)=>(vg(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>e.has(i)?FT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ci=(i,e,t,r)=>(vg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nu=(i,e,t)=>(vg(i,e,"access private method"),t),hw=()=>{try{return"0.30.3"}catch{}return"UNKNOWN"},fw=hw(),mw=()=>fw,pw=`
|
|
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>`,C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended",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"},gw=Object.values(C),NT=mw(),UT="mux-video",zo,Uu,Qo,Fu,Bu,$u,Hu,Gu,Xo,mi,qs,Ku,Zo,BT=class extends jo{constructor(){super(),Di(this,mi),Di(this,zo),Di(this,Uu),Di(this,Qo,{}),Di(this,Fu,{}),Di(this,Bu),Di(this,$u),Di(this,Hu),Di(this,Gu),Di(this,Xo,""),Di(this,Ku),Ci(this,Uu,wu()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=pT(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Ci(this,Xo,"default"),this.updateLogo())})}static get NAME(){return UT}static get VERSION(){return NT}static get observedAttributes(){var i;return[...gw,...(i=jo.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?pw:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
|
|
111
111
|
${jo.getTemplateHTML(i)}
|
|
112
112
|
<style>
|
|
@@ -2011,7 +2011,7 @@ Schedule: ${l.map(p=>xi(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
|
|
|
2011
2011
|
min-height: var(--media-control-height, 24px);
|
|
2012
2012
|
}
|
|
2013
2013
|
</style>
|
|
2014
|
-
`}var uo=class extends oi{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=GO;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",uo);var u1=i=>{throw TypeError(i)},Dv=(i,e,t)=>e.has(i)||u1("Cannot "+t),Fe=(i,e,t)=>(Dv(i,e,"read from private field"),t?t.call(i):e.get(i)),Bi=(i,e,t)=>e.has(i)?u1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),vr=(i,e,t,r)=>(Dv(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft=(i,e,t)=>(Dv(i,e,"access private method"),t),Af=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Af{}globalThis.DocumentFragment=i}var Cv=class extends Af{},KO=class extends Af{},VO={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Cv)}},gf,WO=class{constructor(i,e={}){Bi(this,gf),vr(this,gf,e==null?void 0:e.detail)}get detail(){return Fe(this,gf)}initCustomEvent(){}};gf=new WeakMap;function qO(i,e){return new Cv}var c1={document:{createElement:qO},DocumentFragment,customElements:VO,CustomEvent:WO,EventTarget:Af,HTMLElement:Cv,HTMLVideoElement:KO},h1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",gr=h1?c1:globalThis,_f=h1?c1.document:globalThis.document;function YO(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Lv(t)}: ${r}; `)}),e?e.trim():void 0}function Lv(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 li(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function m1(i){let e=jO(i).toString();return e?"?"+e:""}function jO(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var p1=(i,e)=>!i||!e?!1:i.contains(e)?!0:p1(i,e.getRootNode().host),g1="mux.com",zO=()=>{try{return"3.11.
|
|
2014
|
+
`}var uo=class extends oi{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=GO;L.customElements.get("media-context-menu-item")||L.customElements.define("media-context-menu-item",uo);var u1=i=>{throw TypeError(i)},Dv=(i,e,t)=>e.has(i)||u1("Cannot "+t),Fe=(i,e,t)=>(Dv(i,e,"read from private field"),t?t.call(i):e.get(i)),Bi=(i,e,t)=>e.has(i)?u1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),vr=(i,e,t,r)=>(Dv(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft=(i,e,t)=>(Dv(i,e,"access private method"),t),Af=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Af{}globalThis.DocumentFragment=i}var Cv=class extends Af{},KO=class extends Af{},VO={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Cv)}},gf,WO=class{constructor(i,e={}){Bi(this,gf),vr(this,gf,e==null?void 0:e.detail)}get detail(){return Fe(this,gf)}initCustomEvent(){}};gf=new WeakMap;function qO(i,e){return new Cv}var c1={document:{createElement:qO},DocumentFragment,customElements:VO,CustomEvent:WO,EventTarget:Af,HTMLElement:Cv,HTMLVideoElement:KO},h1=typeof window=="undefined"||typeof globalThis.customElements=="undefined",gr=h1?c1:globalThis,_f=h1?c1.document:globalThis.document;function YO(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Lv(t)}: ${r}; `)}),e?e.trim():void 0}function Lv(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 li(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function m1(i){let e=jO(i).toString();return e?"?"+e:""}function jO(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var p1=(i,e)=>!i||!e?!1:i.contains(e)?!0:p1(i,e.getRootNode().host),g1="mux.com",zO=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},QO=zO(),v1=()=>QO,XO=(i,{token:e,customDomain:t=g1,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Zr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${m1({token:e,time:a,program_time:s})}`},ZO=(i,{token:e,customDomain:t=g1,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Zr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${m1({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},wv=i=>{if(i){if([De.LIVE,De.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return De.LIVE}},JO={crossorigin:"crossOrigin",playsinline:"playsInline"};function e2(i){var e;return(e=JO[i])!=null?e:f1(i)}var co,ho,Qt,t2=class{constructor(i,e){Bi(this,co),Bi(this,ho),Bi(this,Qt,[]),vr(this,co,i),vr(this,ho,e)}[Symbol.iterator](){return Fe(this,Qt).values()}get length(){return Fe(this,Qt).length}get value(){var i;return(i=Fe(this,Qt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(vr(this,Qt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return Fe(this,Qt)[i]}values(){return Fe(this,Qt).values()}keys(){return Fe(this,Qt).keys()}forEach(i){Fe(this,Qt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||Fe(this,Qt).push(r)}),!(this.value===""&&!((e=Fe(this,co))!=null&&e.hasAttribute(`${Fe(this,ho)}`)))&&((t=Fe(this,co))==null||t.setAttribute(`${Fe(this,ho)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{Fe(this,Qt).splice(Fe(this,Qt).indexOf(t),1)}),(e=Fe(this,co))==null||e.setAttribute(`${Fe(this,ho)}`,`${this.value}`)}contains(i){return Fe(this,Qt).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)}};co=new WeakMap,ho=new WeakMap,Qt=new WeakMap;var E1=`[mux-player ${v1()}]`;function Hr(...i){console.warn(E1,...i)}function di(...i){console.error(E1,...i)}function y1(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${ee("Read more: ")}
|
|
2015
2015
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Hr(t)}var wt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ds={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},T6={...wt,...Ds},zS=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}}),i2=Object.values(wt).filter(i=>wt.PLAYSINLINE!==i),r2=Object.values(Ds),s2=[...i2,...r2],n2=class extends gr.HTMLElement{static get observedAttributes(){return s2}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case Ds.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case Ds.VOLUME:{let n=(r=li(t))!=null?r:1;this.media&&(this.media.volume=n);return}case Ds.PLAYBACKRATE:{let n=(s=li(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:zS}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:zS}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=li(this.getAttribute(Ds.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Ds.PLAYBACKRATE,`${i}`):this.removeAttribute(Ds.PLAYBACKRATE)}get crossOrigin(){return hd(this,wt.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(wt.CROSSORIGIN,`${i}`)}get autoplay(){return hd(this,wt.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(wt.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(wt.AUTOPLAY)}get loop(){return hd(this,wt.LOOP)!=null}set loop(i){i?this.setAttribute(wt.LOOP,""):this.removeAttribute(wt.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 hd(this,wt.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(wt.MUTED,""):this.removeAttribute(wt.MUTED)}get playsInline(){return hd(this,wt.PLAYSINLINE)!=null}set playsInline(i){di("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(wt.PRELOAD,i):this.removeAttribute(wt.PRELOAD)}};function hd(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var QS=n2,a2=`:host {
|
|
2016
2016
|
--media-control-display: var(--controls);
|
|
2017
2017
|
--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.11.5
|
|
3
|
+
"version": "3.11.5",
|
|
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.30.
|
|
129
|
-
"@mux/playback-core": "0.33.
|
|
128
|
+
"@mux/mux-video": "0.30.3",
|
|
129
|
+
"@mux/playback-core": "0.33.2",
|
|
130
130
|
"media-chrome": "~4.17.2",
|
|
131
131
|
"player.style": "^0.3.0"
|
|
132
132
|
},
|