@mux/mux-video
Advanced tools
Comparing version 0.17.5-canary.0-3abdbb8 to 0.17.5-canary.0-587a5ae
@@ -6,2 +6,19 @@ # Change Log | ||
# [0.18.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.17.5...@mux/mux-video@0.18.0) (2024-04-18) | ||
### Bug Fixes | ||
* upgrade mux-embed v5.2.0 & media-chrome v3.2.0 ([#897](https://github.com/muxinc/elements/issues/897)) ([fd91d94](https://github.com/muxinc/elements/commit/fd91d946ee2f8e58e05551fcb247422de6fbb761)) | ||
### Features | ||
* add `disable-tracking` attribute and prop ([#900](https://github.com/muxinc/elements/issues/900)) ([0f5966e](https://github.com/muxinc/elements/commit/0f5966ec6cdf3cacde017a4ddd9c388bea3168d7)) | ||
* **playback-core, mux-video, mux-audio, mux-player:** Upg hls.js ([#902](https://github.com/muxinc/elements/issues/902)) ([a6a76b6](https://github.com/muxinc/elements/commit/a6a76b69e03867cc11c348d2b48e0160ea295309)) | ||
## [0.17.5](https://github.com/muxinc/elements/compare/@mux/mux-video@0.17.4...@mux/mux-video@0.17.5) (2024-03-29) | ||
@@ -8,0 +25,0 @@ |
@@ -19,3 +19,3 @@ { | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12216, | ||
@@ -371,3 +371,3 @@ "imports": [ | ||
"src/index.ts": { | ||
"bytes": 18382, | ||
"bytes": 18691, | ||
"imports": [ | ||
@@ -390,3 +390,3 @@ { | ||
{ | ||
"path": "node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -419,3 +419,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 135103 | ||
"bytes": 135599 | ||
}, | ||
@@ -434,3 +434,3 @@ "dist/index.cjs.js": { | ||
"src/index.ts": { | ||
"bytesInOutput": 9105 | ||
"bytesInOutput": 9302 | ||
}, | ||
@@ -443,3 +443,3 @@ "src/polyfills/index.ts": { | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5752 | ||
@@ -496,5 +496,5 @@ }, | ||
}, | ||
"bytes": 39705 | ||
"bytes": 39902 | ||
} | ||
} | ||
} |
@@ -19,3 +19,3 @@ { | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12216, | ||
@@ -371,3 +371,3 @@ "imports": [ | ||
"src/index.ts": { | ||
"bytes": 18382, | ||
"bytes": 18691, | ||
"imports": [ | ||
@@ -390,3 +390,3 @@ { | ||
{ | ||
"path": "node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -419,3 +419,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 135730 | ||
"bytes": 136226 | ||
}, | ||
@@ -442,3 +442,3 @@ "dist/index.mjs": { | ||
"src/index.ts": { | ||
"bytesInOutput": 9012 | ||
"bytesInOutput": 9209 | ||
}, | ||
@@ -448,3 +448,3 @@ "src/env.ts": { | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5752 | ||
@@ -501,5 +501,5 @@ }, | ||
}, | ||
"bytes": 39268 | ||
"bytes": 39465 | ||
} | ||
} | ||
} |
@@ -14,9 +14,9 @@ { | ||
}, | ||
"../../node_modules/mux-embed/dist/mux.js": { | ||
"bytes": 86018, | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytes": 87160, | ||
"imports": [], | ||
"format": "cjs" | ||
"format": "esm" | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytes": 890477, | ||
"bytes": 993125, | ||
"imports": [], | ||
@@ -26,6 +26,6 @@ "format": "esm" | ||
"../playback-core/dist/index.mjs": { | ||
"bytes": 20548, | ||
"bytes": 20573, | ||
"imports": [ | ||
{ | ||
"path": "../../node_modules/mux-embed/dist/mux.js", | ||
"path": "../../node_modules/mux-embed/dist/mux.mjs", | ||
"kind": "import-statement", | ||
@@ -47,3 +47,3 @@ "original": "mux-embed" | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12216, | ||
@@ -399,3 +399,3 @@ "imports": [ | ||
"src/index.ts": { | ||
"bytes": 18382, | ||
"bytes": 18691, | ||
"imports": [ | ||
@@ -418,3 +418,3 @@ { | ||
{ | ||
"path": "node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -447,3 +447,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 2071425 | ||
"bytes": 2260797 | ||
}, | ||
@@ -455,19 +455,19 @@ "dist/mux-video.js": { | ||
"inputs": { | ||
"../../node_modules/mux-embed/dist/mux.js": { | ||
"bytesInOutput": 86421 | ||
}, | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 19219 | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytesInOutput": 86636 | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytesInOutput": 357479 | ||
"bytesInOutput": 392729 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 19202 | ||
}, | ||
"src/env.ts": { | ||
"bytesInOutput": 73 | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5758 | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5739 | ||
}, | ||
@@ -523,8 +523,8 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
"src/index.ts": { | ||
"bytesInOutput": 8633 | ||
"bytesInOutput": 8830 | ||
} | ||
}, | ||
"bytes": 503018 | ||
"bytes": 538081 | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
"use strict";var ze=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,li=Object.prototype.hasOwnProperty;var fi=Reflect.get;var pi=(t,i,e)=>i in t?ze(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var mi=(t,i)=>{for(var e in i)ze(t,e,{get:i[e],enumerable:!0})},gi=(t,i,e,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ui(i))!li.call(t,s)&&s!==e&&ze(t,s,{get:()=>i[s],enumerable:!(n=ci(i,s))||n.enumerable});return t};var Ei=t=>gi(ze({},"__esModule",{value:!0}),t);var v=(t,i,e)=>(pi(t,typeof i!="symbol"?i+"":i,e),e),gt=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var r=(t,i,e)=>(gt(t,i,"read from private field"),e?e.call(t):i.get(t)),c=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},u=(t,i,e,n)=>(gt(t,i,"write to private field"),n?n.call(t,e):i.set(t,e),e);var k=(t,i,e)=>(gt(t,i,"access private method"),e),Xe=(t,i,e)=>fi(hi(t),e,i);var Ii={};mi(Ii,{Attributes:()=>h,MediaError:()=>g.MediaError,VideoEvents:()=>Qe,default:()=>Li});module.exports=Ei(Ii);var ge=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ge{}globalThis.DocumentFragment=t}var xe=class extends ge{},Et=class extends ge{},vi={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(xe)}},Me,vt=class{constructor(i,e={}){c(this,Me,void 0);u(this,Me,e==null?void 0:e.detail)}get detail(){return r(this,Me)}initCustomEvent(){}};Me=new WeakMap;function bi(t,i){return new xe}var Lt={document:{createElement:bi},DocumentFragment,customElements:vi,CustomEvent:vt,EventTarget:ge,HTMLElement:xe,HTMLVideoElement:Et},It=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Je=It?Lt:globalThis,wi=It?Lt.document:globalThis.document;var g=require("@mux/playback-core");var yi=()=>{try{return"0.17.5"}catch{}return"UNKNOWN"},Ti=yi(),_t=()=>Ti;var Qe=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],wt,bt=(wt=globalThis.document)==null?void 0:wt.createElement("template");bt&&(bt.innerHTML=` | ||
"use strict";var ze=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,li=Object.prototype.hasOwnProperty;var fi=Reflect.get;var pi=(t,i,e)=>i in t?ze(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var mi=(t,i)=>{for(var e in i)ze(t,e,{get:i[e],enumerable:!0})},gi=(t,i,e,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ui(i))!li.call(t,s)&&s!==e&&ze(t,s,{get:()=>i[s],enumerable:!(n=ci(i,s))||n.enumerable});return t};var Ei=t=>gi(ze({},"__esModule",{value:!0}),t);var v=(t,i,e)=>(pi(t,typeof i!="symbol"?i+"":i,e),e),gt=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var r=(t,i,e)=>(gt(t,i,"read from private field"),e?e.call(t):i.get(t)),c=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},u=(t,i,e,n)=>(gt(t,i,"write to private field"),n?n.call(t,e):i.set(t,e),e);var k=(t,i,e)=>(gt(t,i,"access private method"),e),Xe=(t,i,e)=>fi(hi(t),e,i);var Ii={};mi(Ii,{Attributes:()=>h,MediaError:()=>g.MediaError,VideoEvents:()=>Qe,default:()=>Pi});module.exports=Ei(Ii);var ge=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ge{}globalThis.DocumentFragment=t}var xe=class extends ge{},Et=class extends ge{},vi={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(xe)}},Me,vt=class{constructor(i,e={}){c(this,Me,void 0);u(this,Me,e==null?void 0:e.detail)}get detail(){return r(this,Me)}initCustomEvent(){}};Me=new WeakMap;function bi(t,i){return new xe}var Pt={document:{createElement:bi},DocumentFragment,customElements:vi,CustomEvent:vt,EventTarget:ge,HTMLElement:xe,HTMLVideoElement:Et},It=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Je=It?Pt:globalThis,wi=It?Pt.document:globalThis.document;var g=require("@mux/playback-core");var yi=()=>{try{return"0.18.0"}catch{}return"UNKNOWN"},Ti=yi(),_t=()=>Ti;var Qe=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],wt,bt=(wt=globalThis.document)==null?void 0:wt.createElement("template");bt&&(bt.innerHTML=` | ||
<style> | ||
@@ -39,3 +39,3 @@ :host { | ||
<slot></slot> | ||
`);var Mt=(t,{tag:i,is:e})=>{var l,d,S,E,Dt,I,re,o,f,Ee,x,Nt,A,Vt,O,qt;let n=(l=globalThis.document)==null?void 0:l.createElement(i,{is:e}),s=n?Ai(n):[];return d=class extends t{constructor(){super();c(this,f);c(this,x);c(this,A);c(this,O);c(this,I,void 0);c(this,re,void 0);c(this,o,new Map);this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0)))}static get observedAttributes(){var m,T,L;return k(m=d,E,Dt).call(m),[...(L=(T=n==null?void 0:n.constructor)==null?void 0:T.observedAttributes)!=null?L:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var p,m,T;return(T=(m=(p=r(this,re))!=null?p:this.shadowRoot.querySelector(i))!=null?m:this.querySelector(":scope > [slot=media]"))!=null?T:this.querySelector(i)}set nativeEl(p){u(this,re,p)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(p){this.toggleAttribute("muted",!!p)}get src(){return this.getAttribute("src")}set src(p){this.setAttribute("src",`${p}`)}get preload(){var p,m;return(m=this.getAttribute("preload"))!=null?m:(p=this.nativeEl)==null?void 0:p.preload}set preload(p){this.setAttribute("preload",`${p}`)}init(){var p,m;if(!this.nativeEl){let T=document.createElement(i,{is:e});T.part=i,this.shadowRoot.querySelector('slot[name="media"]').append(T)}this.nativeEl.muted=this.hasAttribute("muted");for(let T of s)k(this,A,Vt).call(this,T);this.shadowRoot.addEventListener("slotchange",this);for(let T of this.constructor.Events)(m=(p=this.shadowRoot).addEventListener)==null||m.call(p,T,this,!0)}handleEvent(p){if(p.type==="slotchange"){k(this,x,Nt).call(this);return}p.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(p.type,{detail:p.detail}))}attributeChangedCallback(p,m,T){k(this,f,Ee).call(this),k(this,O,qt).call(this,p,m,T)}connectedCallback(){k(this,f,Ee).call(this)}},S=new WeakMap,E=new WeakSet,Dt=function(){if(r(this,S))return;u(this,S,!0);let p=new Set(this.observedAttributes);p.delete("muted");for(let m of s){if(m in this.prototype)continue;if(typeof n[m]=="function")this.prototype[m]=function(...L){return k(this,f,Ee).call(this),this.call?this.call(m,...L):this.nativeEl[m].apply(this.nativeEl,L)};else{let L={get(){var D,_e,we;k(this,f,Ee).call(this);let P=m.toLowerCase();if(p.has(P)){let me=this.getAttribute(P);return me===null?!1:me===""?!0:me}return(we=(D=this.get)==null?void 0:D.call(this,m))!=null?we:(_e=this.nativeEl)==null?void 0:_e[m]}};m!==m.toUpperCase()&&(L.set=function(P){k(this,f,Ee).call(this);let D=m.toLowerCase();if(p.has(D)){P===!0||P===!1||P==null?this.toggleAttribute(D,!!P):this.setAttribute(D,P);return}if(this.set){this.set(m,P);return}this.nativeEl[m]=P}),Object.defineProperty(this.prototype,m,L)}}},I=new WeakMap,re=new WeakMap,o=new WeakMap,f=new WeakSet,Ee=function(){r(this,I)||(u(this,I,!0),this.init())},x=new WeakSet,Nt=function(){let p=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements().filter(m=>["track","source"].includes(m.localName)).forEach(m=>{var L,P;p.delete(m);let T=r(this,o).get(m);T||(T=m.cloneNode(),r(this,o).set(m,T)),(P=(L=this.nativeEl).append)==null||P.call(L,T),T.localName==="track"&&T.default&&(T.kind==="chapters"||T.kind==="metadata")&&T.track.mode==="disabled"&&(T.track.mode="hidden")}),p.forEach(m=>m.remove())},A=new WeakSet,Vt=function(p){if(Object.prototype.hasOwnProperty.call(this,p)){let m=this[p];delete this[p],this[p]=m}},O=new WeakSet,qt=function(p,m,T){var L,P,D,_e,we,me;["id","class"].includes(p)||!d.observedAttributes.includes(p)&&this.constructor.observedAttributes.includes(p)||(T===null?(P=(L=this.nativeEl).removeAttribute)==null||P.call(L,p):((_e=(D=this.nativeEl).getAttribute)==null?void 0:_e.call(D,p))!=T&&((me=(we=this.nativeEl).setAttribute)==null||me.call(we,p,T)))},c(d,E),v(d,"Events",Qe),v(d,"template",i.endsWith("audio")?bt:yt),c(d,S,void 0),d};function Ai(t){let i=[];for(let e=Object.getPrototypeOf(t);e&&e!==HTMLElement.prototype;e=Object.getPrototypeOf(e))i.push(...Object.getOwnPropertyNames(e));return i}var Ze=globalThis.document?Mt(HTMLElement,{tag:"video"}):class{},Ni=globalThis.document?Mt(HTMLElement,{tag:"audio"}):class{};var N=new WeakMap,ve=class extends Error{},et=class extends Error{};var Ft=globalThis.WeakRef?class extends Set{add(t){super.add(new WeakRef(t))}forEach(t){super.forEach(i=>{let e=i.deref();e&&t(e)})}}:Set;function Gt(t){Tt()?Wt()?t(chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable)):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable))}}function Ut(){return globalThis.chrome}function Bt(){let t="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if(globalThis.chrome.cast||document.querySelector(`script[src="${t}"]`))return;let i=document.createElement("script");i.src=t,document.head.append(i)}function Tt(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable}function Wt(){return typeof cast!="undefined"&&cast.framework}function U(){if(Wt())return cast.framework.CastContext.getInstance()}function De(){var t;return(t=U())==null?void 0:t.getCurrentSession()}function tt(){var t;return(t=De())==null?void 0:t.getSessionObj().media[0]}function jt(t){return new Promise((i,e)=>{tt().editTracksInfo(t,i,e)})}function Yt(t){return new Promise((i,e)=>{tt().getStatus(t,i,e)})}function At(t){return U().setOptions({...kt(),...t})}function kt(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var it=new Ft,B=new WeakSet,C;Gt(t=>{t&&!C&&(C=cast.framework,U().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=N.get(e)).onCastStateChanged)==null?void 0:s.call(n,i)})}),U().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=N.get(e)).onSessionStateChanged)==null?void 0:s.call(n,i)})}),it.forEach(i=>{var e,n;return(n=(e=N.get(i)).init)==null?void 0:n.call(e)}))});var Ht=0,y,Ne,_,V,de,ce,W,nt,q,ae,st,Kt,Ve,St,ot,$t,qe,Rt,at,zt,Fe,Ct,rt=class extends EventTarget{constructor(e){super();c(this,q);c(this,st);c(this,Ve);c(this,ot);c(this,qe);c(this,at);c(this,Fe);c(this,y,void 0);c(this,Ne,void 0);c(this,_,void 0);c(this,V,void 0);c(this,de,"disconnected");c(this,ce,!1);c(this,W,new Set);c(this,nt,new WeakMap);u(this,y,e),it.add(this),N.set(this,{init:()=>k(this,qe,Rt).call(this),onCastStateChanged:()=>k(this,Ve,St).call(this),onSessionStateChanged:()=>k(this,ot,$t).call(this),getCastPlayer:()=>r(this,q,ae)}),k(this,qe,Rt).call(this)}get state(){return r(this,de)}async watchAvailability(e){if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");return r(this,nt).set(e,++Ht),r(this,W).add(e),Ht}async cancelWatchAvailability(e){if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");e?r(this,W).delete(e):r(this,W).clear()}async prompt(){var n,s;if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");if(!Tt())throw new et("The RemotePlayback API is disabled on this platform.");let e=B.has(r(this,y));B.add(r(this,y)),At(r(this,y).castOptions),Object.entries(r(this,V)).forEach(([l,d])=>{r(this,_).controller.addEventListener(l,d)});try{await U().requestSession()}catch(l){if(l==="cancel"){e||B.delete(r(this,y));return}throw new Error(l)}(s=(n=N.get(r(this,y)))==null?void 0:n.loadOnPrompt)==null||s.call(n)}};y=new WeakMap,Ne=new WeakMap,_=new WeakMap,V=new WeakMap,de=new WeakMap,ce=new WeakMap,W=new WeakMap,nt=new WeakMap,q=new WeakSet,ae=function(){if(B.has(r(this,y)))return r(this,_)},st=new WeakSet,Kt=function(){B.has(r(this,y))&&(Object.entries(r(this,V)).forEach(([e,n])=>{r(this,_).controller.removeEventListener(e,n)}),B.delete(r(this,y)),r(this,y).muted=r(this,_).isMuted,r(this,y).currentTime=r(this,_).savedPlayerState.currentTime,r(this,_).savedPlayerState.isPaused===!1&&r(this,y).play())},Ve=new WeakSet,St=function(){let e=U().getCastState();if(B.has(r(this,y))&&e==="CONNECTING"&&(u(this,de,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ce)&&(e!=null&&e.includes("CONNECT"))){u(this,ce,!0);for(let n of r(this,W))n(!0)}else if(r(this,ce)&&(!e||e==="NO_DEVICES_AVAILABLE")){u(this,ce,!1);for(let n of r(this,W))n(!1)}},ot=new WeakSet,$t=async function(){var n;let{SESSION_RESUMED:e}=C.SessionState;if(U().getSessionState()===e&&r(this,y).castSrc===((n=tt())==null?void 0:n.media.contentId)){B.add(r(this,y)),Object.entries(r(this,V)).forEach(([s,l])=>{r(this,_).controller.addEventListener(s,l)});try{await Yt(new chrome.cast.media.GetStatusRequest)}catch(s){console.error(s)}r(this,V)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,V)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},qe=new WeakSet,Rt=function(){!C||r(this,Ne)||(u(this,Ne,!0),At(r(this,y).castOptions),r(this,y).textTracks.addEventListener("change",()=>k(this,Fe,Ct).call(this)),k(this,Ve,St).call(this),u(this,_,new C.RemotePlayer),new C.RemotePlayerController(r(this,_)),u(this,V,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:e})=>{e===!0?(u(this,de,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,st,Kt).call(this),u(this,de,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&r(this,y).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,y).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var e,n;((e=r(this,q,ae))==null?void 0:e.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,y).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(n=r(this,q,ae))==null?void 0:n.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&(await Promise.resolve(),k(this,at,zt).call(this))}}))},at=new WeakSet,zt=function(){k(this,Fe,Ct).call(this)},Fe=new WeakSet,Ct=async function(){var o,f,R,x,ne;if(!r(this,q,ae))return;let n=((f=(o=r(this,_).mediaInfo)==null?void 0:o.tracks)!=null?f:[]).filter(({type:A})=>A===chrome.cast.media.TrackType.TEXT),s=[...r(this,y).textTracks].filter(({kind:A})=>A==="subtitles"||A==="captions"),l=n.map(({language:A,name:se,trackId:O})=>{var M;let{mode:oe}=(M=s.find(mt=>mt.language===A&&mt.label===se))!=null?M:{};return oe?{mode:oe,trackId:O}:!1}).filter(Boolean),S=l.filter(({mode:A})=>A!=="showing").map(({trackId:A})=>A),E=l.find(({mode:A})=>A==="showing"),ie=(ne=(x=(R=De())==null?void 0:R.getSessionObj().media[0])==null?void 0:x.activeTrackIds)!=null?ne:[],I=ie;if(ie.length&&(I=I.filter(A=>!S.includes(A))),E!=null&&E.trackId&&(I=[...I,E.trackId]),I=[...new Set(I)],!((A,se)=>A.length===se.length&&A.every(O=>se.includes(O)))(ie,I))try{let A=new chrome.cast.media.EditTracksInfoRequest(I);await jt(A)}catch(A){console.error(A)}};var Xt=t=>{var i,e,n,s,l,d,b,E,Jt;return e=class extends t{constructor(){super(...arguments);c(this,d);c(this,E);c(this,n,{paused:!1});c(this,s,kt());c(this,l,void 0)}get remote(){return r(this,l)?r(this,l):Ut()?(Bt(),N.set(this,{loadOnPrompt:()=>k(this,E,Jt).call(this)}),u(this,l,new rt(this))):super.remote}attributeChangedCallback(o,f,R){if(super.attributeChangedCallback(o,f,R),o==="cast-receiver"&&R){r(this,s).receiverApplicationId=R;return}if(r(this,d,b))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var A,se;if(!r(this,d,b))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),f=[...this.querySelectorAll("track")].filter(({kind:O,src:oe})=>oe&&(O==="subtitles"||O==="captions")),R=[],x=0;f.length&&(o.tracks=f.map(O=>{let oe=++x;R.length===0&&O.track.mode==="showing"&&R.push(oe);let M=new chrome.cast.media.Track(oe,chrome.cast.media.TrackType.TEXT);return M.trackContentId=O.src,M.trackContentType="text/vtt",M.subtype=O.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,M.name=O.label,M.language=O.srclang,M})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let ne=new chrome.cast.media.LoadRequest(o);ne.currentTime=(A=super.currentTime)!=null?A:0,ne.autoplay=!r(this,n).paused,ne.activeTrackIds=R,await((se=De())==null?void 0:se.loadMedia(ne)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,d,b)){r(this,d,b).isPaused&&((o=r(this,d,b).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,d,b)){r(this,d,b).isPaused||(o=r(this,d,b).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,s)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,f,R;return(R=(f=this.getAttribute("cast-src"))!=null?f:(o=this.querySelector("source"))==null?void 0:o.src)!=null?R:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,f;return(f=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?f:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get readyState(){if(r(this,d,b))switch(r(this,d,b).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,b)?r(this,d,b).isPaused:super.paused}get muted(){var o;return r(this,d,b)?(o=r(this,d,b))==null?void 0:o.isMuted:super.muted}set muted(o){var f;if(r(this,d,b)){(o&&!r(this,d,b).isMuted||!o&&r(this,d,b).isMuted)&&((f=r(this,d,b).controller)==null||f.muteOrUnmute());return}super.muted=o}get volume(){var o,f;return r(this,d,b)?(f=(o=r(this,d,b))==null?void 0:o.volumeLevel)!=null?f:1:super.volume}set volume(o){var f;if(r(this,d,b)){r(this,d,b).volumeLevel=+o,(f=r(this,d,b).controller)==null||f.setVolumeLevel();return}super.volume=o}get duration(){var o,f,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(f=r(this,d,b))==null?void 0:f.duration)!=null?R:NaN:super.duration}get currentTime(){var o,f,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(f=r(this,d,b))==null?void 0:f.currentTime)!=null?R:0:super.currentTime}set currentTime(o){var f;if(r(this,d,b)){r(this,d,b).currentTime=o,(f=r(this,d,b).controller)==null||f.seek();return}super.currentTime=o}},n=new WeakMap,s=new WeakMap,l=new WeakMap,d=new WeakSet,b=function(){var o,f;return(f=(o=N.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:f.call(o)},E=new WeakSet,Jt=async function(){r(this,n).paused=Xe(e.prototype,this,"paused"),Xe(e.prototype,this,"pause").call(this),this.muted=Xe(e.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},v(e,"observedAttributes",[...(i=t.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),e};var F=class extends Event{constructor(e,n){super(e);v(this,"track");this.track=n.track}};var Ot=new WeakMap;function a(t){var i;return(i=Ot.get(t))!=null?i:ki(t,{})}function ki(t,i){let e=Ot.get(t);return e||Ot.set(t,e={}),Object.assign(e,i)}function dt(t,i){let e=t.videoTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in he.prototype||Object.defineProperty(he.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new F("addtrack",{track:i}))})}function ct(t){var n;let i=(n=a(t).media)==null?void 0:n.videoTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:t}))})}function Qt(t){var n;let i=(n=a(t).media.videoTracks)!=null?n:[],e=!1;for(let s of i)s!==t&&(s.selected=!1,e=!0);if(e){if(a(i).changeRequested)return;a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var j,Y,H,ue,Ge,he=class extends EventTarget{constructor(){super();c(this,ue);c(this,j,void 0);c(this,Y,void 0);c(this,H,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,ue,Ge).values()}get length(){return r(this,ue,Ge).size}getTrackById(e){var n;return(n=[...r(this,ue,Ge)].find(s=>s.id===e))!=null?n:null}get selectedIndex(){return[...r(this,ue,Ge)].findIndex(e=>e.selected)}get onaddtrack(){return r(this,j)}set onaddtrack(e){r(this,j)&&(this.removeEventListener("addtrack",r(this,j)),u(this,j,void 0)),typeof e=="function"&&(u(this,j,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,Y)}set onremovetrack(e){r(this,Y)&&(this.removeEventListener("removetrack",r(this,Y)),u(this,Y,void 0)),typeof e=="function"&&(u(this,Y,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,H)}set onchange(e){r(this,H)&&(this.removeEventListener("change",r(this,H)),u(this,H,void 0)),typeof e=="function"&&(u(this,H,e),this.addEventListener("change",e))}};j=new WeakMap,Y=new WeakMap,H=new WeakMap,ue=new WeakSet,Ge=function(){return a(this).trackSet};var G=class extends Event{constructor(e,n){super(e);v(this,"rendition");this.rendition=n.rendition}};function Zt(t,i){let e=a(t).media.videoRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in le.prototype||Object.defineProperty(le.prototype,s,{get(){return be(this)[s]}}),queueMicrotask(()=>{t.selected&&e.dispatchEvent(new G("addrendition",{rendition:i}))})}function ei(t){let i=a(t).media.videoRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.selected&&i.dispatchEvent(new G("removerendition",{rendition:t}))})}function ti(t){let i=a(t).media.videoRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.selected&&i.dispatchEvent(new Event("change"))}))}function be(t){return[...a(t).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...a(e).renditionSet])}var K,$,z,le=class extends EventTarget{constructor(){super(...arguments);c(this,K,void 0);c(this,$,void 0);c(this,z,void 0)}[Symbol.iterator](){return be(this).values()}get length(){return be(this).length}getRenditionById(e){var n;return(n=be(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return be(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of be(this).entries())s.selected=n===e}get onaddrendition(){return r(this,K)}set onaddrendition(e){r(this,K)&&(this.removeEventListener("addrendition",r(this,K)),u(this,K,void 0)),typeof e=="function"&&(u(this,K,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,$)}set onremoverendition(e){r(this,$)&&(this.removeEventListener("removerendition",r(this,$)),u(this,$,void 0)),typeof e=="function"&&(u(this,$,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,z)}set onchange(e){r(this,z)&&(this.removeEventListener("change",r(this,z)),u(this,z,void 0)),typeof e=="function"&&(u(this,z,e),this.addEventListener("change",e))}};K=new WeakMap,$=new WeakMap,z=new WeakMap;var ye,Ue=class{constructor(){v(this,"src");v(this,"id");v(this,"width");v(this,"height");v(this,"bitrate");v(this,"frameRate");v(this,"codec");c(this,ye,!1)}get selected(){return r(this,ye)}set selected(i){r(this,ye)!==i&&(u(this,ye,i),ti(this))}};ye=new WeakMap;var Te,Ae=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,Te,!1)}addRendition(i,e,n,s,l,d){let S=new Ue;return S.src=i,S.width=e,S.height=n,S.frameRate=d,S.bitrate=l,S.codec=s,Zt(this,S),S}removeRendition(i){ei(i)}get selected(){return r(this,Te)}set selected(i){r(this,Te)!==i&&(u(this,Te,i),i===!0&&Qt(this))}};Te=new WeakMap;function ii(t,i){let e=a(t).media.audioRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in fe.prototype||Object.defineProperty(fe.prototype,s,{get(){return ke(this)[s]}}),queueMicrotask(()=>{t.enabled&&e.dispatchEvent(new G("addrendition",{rendition:i}))})}function ri(t){let i=a(t).media.audioRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.enabled&&i.dispatchEvent(new G("removerendition",{rendition:t}))})}function ni(t){let i=a(t).media.audioRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.enabled&&i.dispatchEvent(new Event("change"))}))}function ke(t){return[...a(t).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...a(e).renditionSet])}var X,J,Q,fe=class extends EventTarget{constructor(){super(...arguments);c(this,X,void 0);c(this,J,void 0);c(this,Q,void 0)}[Symbol.iterator](){return ke(this).values()}get length(){return ke(this).length}getRenditionById(e){var n;return(n=ke(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return ke(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of ke(this).entries())s.selected=n===e}get onaddrendition(){return r(this,X)}set onaddrendition(e){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),u(this,X,void 0)),typeof e=="function"&&(u(this,X,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,J)}set onremoverendition(e){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),u(this,J,void 0)),typeof e=="function"&&(u(this,J,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,Q)}set onchange(e){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),u(this,Q,void 0)),typeof e=="function"&&(u(this,Q,e),this.addEventListener("change",e))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var Se,Be=class{constructor(){v(this,"src");v(this,"id");v(this,"bitrate");v(this,"codec");c(this,Se,!1)}get selected(){return r(this,Se)}set selected(i){r(this,Se)!==i&&(u(this,Se,i),ni(this))}};Se=new WeakMap;function ht(t,i){let e=t.audioTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in pe.prototype||Object.defineProperty(pe.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new F("addtrack",{track:i}))})}function lt(t){var n;let i=(n=a(t).media)==null?void 0:n.audioTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:t}))})}function si(t){let i=a(t).media.audioTracks;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var Z,ee,te,Re,ut,pe=class extends EventTarget{constructor(){super();c(this,Re);c(this,Z,void 0);c(this,ee,void 0);c(this,te,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,Re,ut).values()}get length(){return r(this,Re,ut).size}getTrackById(e){var n;return(n=[...r(this,Re,ut)].find(s=>s.id===e))!=null?n:null}get onaddtrack(){return r(this,Z)}set onaddtrack(e){r(this,Z)&&(this.removeEventListener("addtrack",r(this,Z)),u(this,Z,void 0)),typeof e=="function"&&(u(this,Z,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,ee)}set onremovetrack(e){r(this,ee)&&(this.removeEventListener("removetrack",r(this,ee)),u(this,ee,void 0)),typeof e=="function"&&(u(this,ee,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,te)}set onchange(e){r(this,te)&&(this.removeEventListener("change",r(this,te)),u(this,te,void 0)),typeof e=="function"&&(u(this,te,e),this.addEventListener("change",e))}};Z=new WeakMap,ee=new WeakMap,te=new WeakMap,Re=new WeakSet,ut=function(){return a(this).trackSet};var Ce,Oe=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,Ce,!1)}addRendition(i,e,n){let s=new Be;return s.src=i,s.codec=e,s.bitrate=n,ii(this,s),s}removeRendition(i){ri(i)}get enabled(){return r(this,Ce)}set enabled(i){r(this,Ce)!==i&&(u(this,Ce,i),si(this))}};Ce=new WeakMap;var oi=ft(globalThis.HTMLMediaElement,"video"),ai=ft(globalThis.HTMLMediaElement,"audio");function di(t){if(!(t!=null&&t.prototype))return t;let i=ft(t,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"videoTracks",{get(){return Si(this)}});let e=ft(t,"audio");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"audioTracks",{get(){return Ri(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(l,d="",S=""){let E=new Ae;return E.kind=l,E.label=d,E.language=S,dt(this,E),E}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=ct),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(l,d="",S=""){let E=new Oe;return E.kind=l,E.label=d,E.language=S,ht(this,E),E}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=lt),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get(){return n(this)}});let n=l=>{let d=a(l).videoRenditions;return d||(d=new le,a(d).media=l,a(l).videoRenditions=d),d};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get(){return s(this)}});let s=l=>{let d=a(l).audioRenditions;return d||(d=new fe,a(d).media=l,a(l).audioRenditions=d),d};return t}function ft(t,i){var e;if(t!=null&&t.prototype)return(e=Object.getOwnPropertyDescriptor(t.prototype,`${i}Tracks`))==null?void 0:e.get}function Si(t){var e;let i=a(t).videoTracks;if(!i&&(i=new he,a(t).videoTracks=i,oi)){let n=oi.call((e=t.nativeEl)!=null?e:t);for(let s of n)dt(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Ae)){for(let l of n)ct(l);return}dt(t,s.track)}),n.addEventListener("removetrack",s=>{ct(s.track)})}return i}function Ri(t){var e;let i=a(t).audioTracks;if(!i&&(i=new pe,a(t).audioTracks=i,ai)){let n=ai.call((e=t.nativeEl)!=null?e:t);for(let s of n)ht(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Oe)){for(let l of n)lt(l);return}ht(t,s.track)}),n.addEventListener("removetrack",s=>{lt(s.track)})}return i}Qe.push("castchange","entercast","leavecast");var h={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_COOKIES:"disable-cookies",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",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"},Ci=Object.values(h),Oi=_t(),Pi="mux-video",w,Pe,je,Le,Ye,He,Ke,$e,Ie,pt,Pt=class extends Ze{constructor(){super();c(this,Ie);c(this,w,void 0);c(this,Pe,void 0);c(this,je,void 0);c(this,Le,{});c(this,Ye,void 0);c(this,He,void 0);c(this,Ke,void 0);c(this,$e,void 0);u(this,je,(0,g.generatePlayerInitTime)())}static get observedAttributes(){var e;return[...Ci,...(e=Ze.observedAttributes)!=null?e:[]]}get preferCmcd(){var e;return(e=this.getAttribute(h.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?g.CmcdTypeValues.includes(e)?this.setAttribute(h.PREFER_CMCD,e):console.warn(`Invalid value for preferCmcd. Must be one of ${g.CmcdTypeValues.join()}`):this.removeAttribute(h.PREFER_CMCD))}get playerInitTime(){return r(this,je)}get playerSoftwareName(){var e;return(e=r(this,Ke))!=null?e:Pi}set playerSoftwareName(e){u(this,Ke,e)}get playerSoftwareVersion(){var e;return(e=r(this,He))!=null?e:Oi}set playerSoftwareVersion(e){u(this,He,e)}get _hls(){var e;return(e=r(this,w))==null?void 0:e.engine}get mux(){var e;return(e=this.nativeEl)==null?void 0:e.mux}get error(){var e;return(e=(0,g.getError)(this.nativeEl))!=null?e:null}get errorTranslator(){return r(this,$e)}set errorTranslator(e){u(this,$e,e)}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get type(){var e;return(e=this.getAttribute(h.TYPE))!=null?e:void 0}set type(e){e!==this.type&&(e?this.setAttribute(h.TYPE,e):this.removeAttribute(h.TYPE))}get autoplay(){let e=this.getAttribute("autoplay");return e===null?!1:e===""?!0:e}set autoplay(e){let n=this.autoplay;e!==n&&(e?this.setAttribute("autoplay",typeof e=="string"?e:""):this.removeAttribute("autoplay"))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(h.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(h.DEBUG,""):this.removeAttribute(h.DEBUG))}get disableCookies(){return this.hasAttribute(h.DISABLE_COOKIES)}set disableCookies(e){e!==this.disableCookies&&(e?this.setAttribute(h.DISABLE_COOKIES,""):this.removeAttribute(h.DISABLE_COOKIES))}get startTime(){let e=this.getAttribute(h.START_TIME);if(e==null)return;let n=+e;return Number.isNaN(n)?void 0:n}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(h.START_TIME):this.setAttribute(h.START_TIME,`${e}`))}get playbackId(){var e;return(e=this.getAttribute(h.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(h.PLAYBACK_ID,e):this.removeAttribute(h.PLAYBACK_ID))}get maxResolution(){var e;return(e=this.getAttribute(h.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(h.MAX_RESOLUTION,e):this.removeAttribute(h.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(h.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(h.MIN_RESOLUTION,e):this.removeAttribute(h.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(h.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(h.RENDITION_ORDER,e):this.removeAttribute(h.RENDITION_ORDER))}get customDomain(){var e;return(e=this.getAttribute(h.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(h.CUSTOM_DOMAIN,e):this.removeAttribute(h.CUSTOM_DOMAIN))}get ended(){return(0,g.getEnded)(this.nativeEl,this._hls)}get envKey(){var e;return(e=this.getAttribute(h.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(h.ENV_KEY,e):this.removeAttribute(h.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(h.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(h.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(h.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(h.STREAM_TYPE))!=null?e:(0,g.getStreamType)(this.nativeEl)}set streamType(e){e!==this.streamType&&(e?this.setAttribute(h.STREAM_TYPE,e):this.removeAttribute(h.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(0,g.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e,n;if(this.hasAttribute(h.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:s}=this,l=(e=this.nativeEl.seekable.end(0))!=null?e:0,d=(n=this.nativeEl.seekable.start(0))!=null?n:0;return Math.max(d,l-s)}return(0,g.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(h.LIVE_EDGE_OFFSET))return+this.getAttribute(h.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(h.LIVE_EDGE_OFFSET):this.setAttribute(h.LIVE_EDGE_OFFSET,`${+e}`))}get seekable(){return(0,g.getSeekable)(this.nativeEl)}async addCuePoints(e){return(0,g.addCuePoints)(this.nativeEl,e)}get activeCuePoint(){return(0,g.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,g.getCuePoints)(this.nativeEl)}getStartDate(){return(0,g.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,g.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let e=this.getAttribute(h.PREFER_PLAYBACK);if(e===g.PlaybackTypes.MSE||e===g.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===g.PlaybackTypes.MSE||e===g.PlaybackTypes.NATIVE?this.setAttribute(h.PREFER_PLAYBACK,e):this.removeAttribute(h.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(n=>n.startsWith("metadata-")&&![h.METADATA_URL].includes(n)).reduce((n,s)=>{let l=this.getAttribute(s);return l!=null&&(n[s.replace(/^metadata-/,"").replace(/-/g,"_")]=l),n},{}),...r(this,Le)}}set metadata(e){u(this,Le,e!=null?e:{}),this.mux&&this.mux.emit("hb",r(this,Le))}get _hlsConfig(){return r(this,Ye)}set _hlsConfig(e){u(this,Ye,e)}load(){u(this,w,(0,g.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,g.teardown)(this.nativeEl,r(this,w)),u(this,w,void 0)}attributeChangedCallback(e,n,s){var d,S;switch(Ze.observedAttributes.includes(e)&&!["src","autoplay","preload"].includes(e)&&super.attributeChangedCallback(e,n,s),e){case h.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=s!=null?s:void 0;break;case h.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=s!=null?s:void 0;break;case"src":{let E=!!n,ie=!!s;!E&&ie?k(this,Ie,pt).call(this):E&&!ie?this.unload():E&&ie&&(this.unload(),k(this,Ie,pt).call(this));break}case"autoplay":if(s===n)break;(d=r(this,w))==null||d.setAutoplay(this.autoplay);break;case"preload":if(s===n)break;(S=r(this,w))==null||S.setPreload(s);break;case h.PLAYBACK_ID:this.src=(0,g.toMuxVideoURL)(this);break;case h.DEBUG:{let E=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=E);break}case h.METADATA_URL:s&&fetch(s).then(E=>E.json()).then(E=>this.metadata=E).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${s}!`));break;case h.STREAM_TYPE:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case h.TARGET_LIVE_WINDOW:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var e;(e=super.connectedCallback)==null||e.call(this),this.nativeEl&&this.src&&!r(this,w)&&k(this,Ie,pt).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,Pe=new WeakMap,je=new WeakMap,Le=new WeakMap,Ye=new WeakMap,He=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Ie=new WeakSet,pt=async function(){r(this,Pe)||(await u(this,Pe,Promise.resolve()),u(this,Pe,null),this.load())};var We=class extends Xt(di(Pt)){};Je.customElements.get("mux-video")||(Je.customElements.define("mux-video",We),Je.MuxVideoElement=We);var Li=We; | ||
`);var Mt=(t,{tag:i,is:e})=>{var l,d,S,E,Dt,I,re,o,f,Ee,x,Nt,A,Vt,L,qt;let n=(l=globalThis.document)==null?void 0:l.createElement(i,{is:e}),s=n?Ai(n):[];return d=class extends t{constructor(){super();c(this,f);c(this,x);c(this,A);c(this,L);c(this,I,void 0);c(this,re,void 0);c(this,o,new Map);this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0)))}static get observedAttributes(){var m,T,P;return k(m=d,E,Dt).call(m),[...(P=(T=n==null?void 0:n.constructor)==null?void 0:T.observedAttributes)!=null?P:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var p,m,T;return(T=(m=(p=r(this,re))!=null?p:this.shadowRoot.querySelector(i))!=null?m:this.querySelector(":scope > [slot=media]"))!=null?T:this.querySelector(i)}set nativeEl(p){u(this,re,p)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(p){this.toggleAttribute("muted",!!p)}get src(){return this.getAttribute("src")}set src(p){this.setAttribute("src",`${p}`)}get preload(){var p,m;return(m=this.getAttribute("preload"))!=null?m:(p=this.nativeEl)==null?void 0:p.preload}set preload(p){this.setAttribute("preload",`${p}`)}init(){var p,m;if(!this.nativeEl){let T=document.createElement(i,{is:e});T.part=i,this.shadowRoot.querySelector('slot[name="media"]').append(T)}this.nativeEl.muted=this.hasAttribute("muted");for(let T of s)k(this,A,Vt).call(this,T);this.shadowRoot.addEventListener("slotchange",this);for(let T of this.constructor.Events)(m=(p=this.shadowRoot).addEventListener)==null||m.call(p,T,this,!0)}handleEvent(p){if(p.type==="slotchange"){k(this,x,Nt).call(this);return}p.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(p.type,{detail:p.detail}))}attributeChangedCallback(p,m,T){k(this,f,Ee).call(this),k(this,L,qt).call(this,p,m,T)}connectedCallback(){k(this,f,Ee).call(this)}},S=new WeakMap,E=new WeakSet,Dt=function(){if(r(this,S))return;u(this,S,!0);let p=new Set(this.observedAttributes);p.delete("muted");for(let m of s){if(m in this.prototype)continue;if(typeof n[m]=="function")this.prototype[m]=function(...P){return k(this,f,Ee).call(this),this.call?this.call(m,...P):this.nativeEl[m].apply(this.nativeEl,P)};else{let P={get(){var D,_e,we;k(this,f,Ee).call(this);let O=m.toLowerCase();if(p.has(O)){let me=this.getAttribute(O);return me===null?!1:me===""?!0:me}return(we=(D=this.get)==null?void 0:D.call(this,m))!=null?we:(_e=this.nativeEl)==null?void 0:_e[m]}};m!==m.toUpperCase()&&(P.set=function(O){k(this,f,Ee).call(this);let D=m.toLowerCase();if(p.has(D)){O===!0||O===!1||O==null?this.toggleAttribute(D,!!O):this.setAttribute(D,O);return}if(this.set){this.set(m,O);return}this.nativeEl[m]=O}),Object.defineProperty(this.prototype,m,P)}}},I=new WeakMap,re=new WeakMap,o=new WeakMap,f=new WeakSet,Ee=function(){r(this,I)||(u(this,I,!0),this.init())},x=new WeakSet,Nt=function(){let p=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements().filter(m=>["track","source"].includes(m.localName)).forEach(m=>{var P,O;p.delete(m);let T=r(this,o).get(m);T||(T=m.cloneNode(),r(this,o).set(m,T)),(O=(P=this.nativeEl).append)==null||O.call(P,T),T.localName==="track"&&T.default&&(T.kind==="chapters"||T.kind==="metadata")&&T.track.mode==="disabled"&&(T.track.mode="hidden")}),p.forEach(m=>m.remove())},A=new WeakSet,Vt=function(p){if(Object.prototype.hasOwnProperty.call(this,p)){let m=this[p];delete this[p],this[p]=m}},L=new WeakSet,qt=function(p,m,T){var P,O,D,_e,we,me;["id","class"].includes(p)||!d.observedAttributes.includes(p)&&this.constructor.observedAttributes.includes(p)||(T===null?(O=(P=this.nativeEl).removeAttribute)==null||O.call(P,p):((_e=(D=this.nativeEl).getAttribute)==null?void 0:_e.call(D,p))!=T&&((me=(we=this.nativeEl).setAttribute)==null||me.call(we,p,T)))},c(d,E),v(d,"Events",Qe),v(d,"template",i.endsWith("audio")?bt:yt),c(d,S,void 0),d};function Ai(t){let i=[];for(let e=Object.getPrototypeOf(t);e&&e!==HTMLElement.prototype;e=Object.getPrototypeOf(e))i.push(...Object.getOwnPropertyNames(e));return i}var Ze=globalThis.document?Mt(HTMLElement,{tag:"video"}):class{},Ni=globalThis.document?Mt(HTMLElement,{tag:"audio"}):class{};var N=new WeakMap,ve=class extends Error{},et=class extends Error{};var Ft=globalThis.WeakRef?class extends Set{add(t){super.add(new WeakRef(t))}forEach(t){super.forEach(i=>{let e=i.deref();e&&t(e)})}}:Set;function Gt(t){Tt()?Wt()?t(chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable)):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable))}}function Bt(){return globalThis.chrome}function Ut(){let t="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if(globalThis.chrome.cast||document.querySelector(`script[src="${t}"]`))return;let i=document.createElement("script");i.src=t,document.head.append(i)}function Tt(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable}function Wt(){return typeof cast!="undefined"&&cast.framework}function B(){if(Wt())return cast.framework.CastContext.getInstance()}function De(){var t;return(t=B())==null?void 0:t.getCurrentSession()}function tt(){var t;return(t=De())==null?void 0:t.getSessionObj().media[0]}function jt(t){return new Promise((i,e)=>{tt().editTracksInfo(t,i,e)})}function Yt(t){return new Promise((i,e)=>{tt().getStatus(t,i,e)})}function At(t){return B().setOptions({...kt(),...t})}function kt(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var it=new Ft,U=new WeakSet,C;Gt(t=>{t&&!C&&(C=cast.framework,B().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=N.get(e)).onCastStateChanged)==null?void 0:s.call(n,i)})}),B().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=N.get(e)).onSessionStateChanged)==null?void 0:s.call(n,i)})}),it.forEach(i=>{var e,n;return(n=(e=N.get(i)).init)==null?void 0:n.call(e)}))});var Ht=0,y,Ne,_,V,de,ce,W,nt,q,ae,st,Kt,Ve,St,ot,$t,qe,Rt,at,zt,Fe,Ct,rt=class extends EventTarget{constructor(e){super();c(this,q);c(this,st);c(this,Ve);c(this,ot);c(this,qe);c(this,at);c(this,Fe);c(this,y,void 0);c(this,Ne,void 0);c(this,_,void 0);c(this,V,void 0);c(this,de,"disconnected");c(this,ce,!1);c(this,W,new Set);c(this,nt,new WeakMap);u(this,y,e),it.add(this),N.set(this,{init:()=>k(this,qe,Rt).call(this),onCastStateChanged:()=>k(this,Ve,St).call(this),onSessionStateChanged:()=>k(this,ot,$t).call(this),getCastPlayer:()=>r(this,q,ae)}),k(this,qe,Rt).call(this)}get state(){return r(this,de)}async watchAvailability(e){if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");return r(this,nt).set(e,++Ht),r(this,W).add(e),Ht}async cancelWatchAvailability(e){if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");e?r(this,W).delete(e):r(this,W).clear()}async prompt(){var n,s;if(r(this,y).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");if(!Tt())throw new et("The RemotePlayback API is disabled on this platform.");let e=U.has(r(this,y));U.add(r(this,y)),At(r(this,y).castOptions),Object.entries(r(this,V)).forEach(([l,d])=>{r(this,_).controller.addEventListener(l,d)});try{await B().requestSession()}catch(l){if(l==="cancel"){e||U.delete(r(this,y));return}throw new Error(l)}(s=(n=N.get(r(this,y)))==null?void 0:n.loadOnPrompt)==null||s.call(n)}};y=new WeakMap,Ne=new WeakMap,_=new WeakMap,V=new WeakMap,de=new WeakMap,ce=new WeakMap,W=new WeakMap,nt=new WeakMap,q=new WeakSet,ae=function(){if(U.has(r(this,y)))return r(this,_)},st=new WeakSet,Kt=function(){U.has(r(this,y))&&(Object.entries(r(this,V)).forEach(([e,n])=>{r(this,_).controller.removeEventListener(e,n)}),U.delete(r(this,y)),r(this,y).muted=r(this,_).isMuted,r(this,y).currentTime=r(this,_).savedPlayerState.currentTime,r(this,_).savedPlayerState.isPaused===!1&&r(this,y).play())},Ve=new WeakSet,St=function(){let e=B().getCastState();if(U.has(r(this,y))&&e==="CONNECTING"&&(u(this,de,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ce)&&(e!=null&&e.includes("CONNECT"))){u(this,ce,!0);for(let n of r(this,W))n(!0)}else if(r(this,ce)&&(!e||e==="NO_DEVICES_AVAILABLE")){u(this,ce,!1);for(let n of r(this,W))n(!1)}},ot=new WeakSet,$t=async function(){var n;let{SESSION_RESUMED:e}=C.SessionState;if(B().getSessionState()===e&&r(this,y).castSrc===((n=tt())==null?void 0:n.media.contentId)){U.add(r(this,y)),Object.entries(r(this,V)).forEach(([s,l])=>{r(this,_).controller.addEventListener(s,l)});try{await Yt(new chrome.cast.media.GetStatusRequest)}catch(s){console.error(s)}r(this,V)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,V)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},qe=new WeakSet,Rt=function(){!C||r(this,Ne)||(u(this,Ne,!0),At(r(this,y).castOptions),r(this,y).textTracks.addEventListener("change",()=>k(this,Fe,Ct).call(this)),k(this,Ve,St).call(this),u(this,_,new C.RemotePlayer),new C.RemotePlayerController(r(this,_)),u(this,V,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:e})=>{e===!0?(u(this,de,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,st,Kt).call(this),u(this,de,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&r(this,y).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,y).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,y).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var e,n;((e=r(this,q,ae))==null?void 0:e.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,y).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(n=r(this,q,ae))==null?void 0:n.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&(await Promise.resolve(),k(this,at,zt).call(this))}}))},at=new WeakSet,zt=function(){k(this,Fe,Ct).call(this)},Fe=new WeakSet,Ct=async function(){var o,f,R,x,ne;if(!r(this,q,ae))return;let n=((f=(o=r(this,_).mediaInfo)==null?void 0:o.tracks)!=null?f:[]).filter(({type:A})=>A===chrome.cast.media.TrackType.TEXT),s=[...r(this,y).textTracks].filter(({kind:A})=>A==="subtitles"||A==="captions"),l=n.map(({language:A,name:se,trackId:L})=>{var M;let{mode:oe}=(M=s.find(mt=>mt.language===A&&mt.label===se))!=null?M:{};return oe?{mode:oe,trackId:L}:!1}).filter(Boolean),S=l.filter(({mode:A})=>A!=="showing").map(({trackId:A})=>A),E=l.find(({mode:A})=>A==="showing"),ie=(ne=(x=(R=De())==null?void 0:R.getSessionObj().media[0])==null?void 0:x.activeTrackIds)!=null?ne:[],I=ie;if(ie.length&&(I=I.filter(A=>!S.includes(A))),E!=null&&E.trackId&&(I=[...I,E.trackId]),I=[...new Set(I)],!((A,se)=>A.length===se.length&&A.every(L=>se.includes(L)))(ie,I))try{let A=new chrome.cast.media.EditTracksInfoRequest(I);await jt(A)}catch(A){console.error(A)}};var Xt=t=>{var i,e,n,s,l,d,b,E,Jt;return e=class extends t{constructor(){super(...arguments);c(this,d);c(this,E);c(this,n,{paused:!1});c(this,s,kt());c(this,l,void 0)}get remote(){return r(this,l)?r(this,l):Bt()?(Ut(),N.set(this,{loadOnPrompt:()=>k(this,E,Jt).call(this)}),u(this,l,new rt(this))):super.remote}attributeChangedCallback(o,f,R){if(super.attributeChangedCallback(o,f,R),o==="cast-receiver"&&R){r(this,s).receiverApplicationId=R;return}if(r(this,d,b))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var A,se;if(!r(this,d,b))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),f=[...this.querySelectorAll("track")].filter(({kind:L,src:oe})=>oe&&(L==="subtitles"||L==="captions")),R=[],x=0;f.length&&(o.tracks=f.map(L=>{let oe=++x;R.length===0&&L.track.mode==="showing"&&R.push(oe);let M=new chrome.cast.media.Track(oe,chrome.cast.media.TrackType.TEXT);return M.trackContentId=L.src,M.trackContentType="text/vtt",M.subtype=L.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,M.name=L.label,M.language=L.srclang,M})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let ne=new chrome.cast.media.LoadRequest(o);ne.currentTime=(A=super.currentTime)!=null?A:0,ne.autoplay=!r(this,n).paused,ne.activeTrackIds=R,await((se=De())==null?void 0:se.loadMedia(ne)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,d,b)){r(this,d,b).isPaused&&((o=r(this,d,b).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,d,b)){r(this,d,b).isPaused||(o=r(this,d,b).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,s)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,f,R;return(R=(f=this.getAttribute("cast-src"))!=null?f:(o=this.querySelector("source"))==null?void 0:o.src)!=null?R:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,f;return(f=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?f:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get readyState(){if(r(this,d,b))switch(r(this,d,b).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,b)?r(this,d,b).isPaused:super.paused}get muted(){var o;return r(this,d,b)?(o=r(this,d,b))==null?void 0:o.isMuted:super.muted}set muted(o){var f;if(r(this,d,b)){(o&&!r(this,d,b).isMuted||!o&&r(this,d,b).isMuted)&&((f=r(this,d,b).controller)==null||f.muteOrUnmute());return}super.muted=o}get volume(){var o,f;return r(this,d,b)?(f=(o=r(this,d,b))==null?void 0:o.volumeLevel)!=null?f:1:super.volume}set volume(o){var f;if(r(this,d,b)){r(this,d,b).volumeLevel=+o,(f=r(this,d,b).controller)==null||f.setVolumeLevel();return}super.volume=o}get duration(){var o,f,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(f=r(this,d,b))==null?void 0:f.duration)!=null?R:NaN:super.duration}get currentTime(){var o,f,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(f=r(this,d,b))==null?void 0:f.currentTime)!=null?R:0:super.currentTime}set currentTime(o){var f;if(r(this,d,b)){r(this,d,b).currentTime=o,(f=r(this,d,b).controller)==null||f.seek();return}super.currentTime=o}},n=new WeakMap,s=new WeakMap,l=new WeakMap,d=new WeakSet,b=function(){var o,f;return(f=(o=N.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:f.call(o)},E=new WeakSet,Jt=async function(){r(this,n).paused=Xe(e.prototype,this,"paused"),Xe(e.prototype,this,"pause").call(this),this.muted=Xe(e.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},v(e,"observedAttributes",[...(i=t.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),e};var F=class extends Event{constructor(e,n){super(e);v(this,"track");this.track=n.track}};var Lt=new WeakMap;function a(t){var i;return(i=Lt.get(t))!=null?i:ki(t,{})}function ki(t,i){let e=Lt.get(t);return e||Lt.set(t,e={}),Object.assign(e,i)}function dt(t,i){let e=t.videoTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in he.prototype||Object.defineProperty(he.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new F("addtrack",{track:i}))})}function ct(t){var n;let i=(n=a(t).media)==null?void 0:n.videoTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:t}))})}function Qt(t){var n;let i=(n=a(t).media.videoTracks)!=null?n:[],e=!1;for(let s of i)s!==t&&(s.selected=!1,e=!0);if(e){if(a(i).changeRequested)return;a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var j,Y,H,ue,Ge,he=class extends EventTarget{constructor(){super();c(this,ue);c(this,j,void 0);c(this,Y,void 0);c(this,H,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,ue,Ge).values()}get length(){return r(this,ue,Ge).size}getTrackById(e){var n;return(n=[...r(this,ue,Ge)].find(s=>s.id===e))!=null?n:null}get selectedIndex(){return[...r(this,ue,Ge)].findIndex(e=>e.selected)}get onaddtrack(){return r(this,j)}set onaddtrack(e){r(this,j)&&(this.removeEventListener("addtrack",r(this,j)),u(this,j,void 0)),typeof e=="function"&&(u(this,j,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,Y)}set onremovetrack(e){r(this,Y)&&(this.removeEventListener("removetrack",r(this,Y)),u(this,Y,void 0)),typeof e=="function"&&(u(this,Y,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,H)}set onchange(e){r(this,H)&&(this.removeEventListener("change",r(this,H)),u(this,H,void 0)),typeof e=="function"&&(u(this,H,e),this.addEventListener("change",e))}};j=new WeakMap,Y=new WeakMap,H=new WeakMap,ue=new WeakSet,Ge=function(){return a(this).trackSet};var G=class extends Event{constructor(e,n){super(e);v(this,"rendition");this.rendition=n.rendition}};function Zt(t,i){let e=a(t).media.videoRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in le.prototype||Object.defineProperty(le.prototype,s,{get(){return be(this)[s]}}),queueMicrotask(()=>{t.selected&&e.dispatchEvent(new G("addrendition",{rendition:i}))})}function ei(t){let i=a(t).media.videoRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.selected&&i.dispatchEvent(new G("removerendition",{rendition:t}))})}function ti(t){let i=a(t).media.videoRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.selected&&i.dispatchEvent(new Event("change"))}))}function be(t){return[...a(t).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...a(e).renditionSet])}var K,$,z,le=class extends EventTarget{constructor(){super(...arguments);c(this,K,void 0);c(this,$,void 0);c(this,z,void 0)}[Symbol.iterator](){return be(this).values()}get length(){return be(this).length}getRenditionById(e){var n;return(n=be(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return be(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of be(this).entries())s.selected=n===e}get onaddrendition(){return r(this,K)}set onaddrendition(e){r(this,K)&&(this.removeEventListener("addrendition",r(this,K)),u(this,K,void 0)),typeof e=="function"&&(u(this,K,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,$)}set onremoverendition(e){r(this,$)&&(this.removeEventListener("removerendition",r(this,$)),u(this,$,void 0)),typeof e=="function"&&(u(this,$,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,z)}set onchange(e){r(this,z)&&(this.removeEventListener("change",r(this,z)),u(this,z,void 0)),typeof e=="function"&&(u(this,z,e),this.addEventListener("change",e))}};K=new WeakMap,$=new WeakMap,z=new WeakMap;var ye,Be=class{constructor(){v(this,"src");v(this,"id");v(this,"width");v(this,"height");v(this,"bitrate");v(this,"frameRate");v(this,"codec");c(this,ye,!1)}get selected(){return r(this,ye)}set selected(i){r(this,ye)!==i&&(u(this,ye,i),ti(this))}};ye=new WeakMap;var Te,Ae=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,Te,!1)}addRendition(i,e,n,s,l,d){let S=new Be;return S.src=i,S.width=e,S.height=n,S.frameRate=d,S.bitrate=l,S.codec=s,Zt(this,S),S}removeRendition(i){ei(i)}get selected(){return r(this,Te)}set selected(i){r(this,Te)!==i&&(u(this,Te,i),i===!0&&Qt(this))}};Te=new WeakMap;function ii(t,i){let e=a(t).media.audioRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in fe.prototype||Object.defineProperty(fe.prototype,s,{get(){return ke(this)[s]}}),queueMicrotask(()=>{t.enabled&&e.dispatchEvent(new G("addrendition",{rendition:i}))})}function ri(t){let i=a(t).media.audioRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.enabled&&i.dispatchEvent(new G("removerendition",{rendition:t}))})}function ni(t){let i=a(t).media.audioRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.enabled&&i.dispatchEvent(new Event("change"))}))}function ke(t){return[...a(t).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...a(e).renditionSet])}var X,J,Q,fe=class extends EventTarget{constructor(){super(...arguments);c(this,X,void 0);c(this,J,void 0);c(this,Q,void 0)}[Symbol.iterator](){return ke(this).values()}get length(){return ke(this).length}getRenditionById(e){var n;return(n=ke(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return ke(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of ke(this).entries())s.selected=n===e}get onaddrendition(){return r(this,X)}set onaddrendition(e){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),u(this,X,void 0)),typeof e=="function"&&(u(this,X,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,J)}set onremoverendition(e){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),u(this,J,void 0)),typeof e=="function"&&(u(this,J,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,Q)}set onchange(e){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),u(this,Q,void 0)),typeof e=="function"&&(u(this,Q,e),this.addEventListener("change",e))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var Se,Ue=class{constructor(){v(this,"src");v(this,"id");v(this,"bitrate");v(this,"codec");c(this,Se,!1)}get selected(){return r(this,Se)}set selected(i){r(this,Se)!==i&&(u(this,Se,i),ni(this))}};Se=new WeakMap;function ht(t,i){let e=t.audioTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in pe.prototype||Object.defineProperty(pe.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new F("addtrack",{track:i}))})}function lt(t){var n;let i=(n=a(t).media)==null?void 0:n.audioTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:t}))})}function si(t){let i=a(t).media.audioTracks;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var Z,ee,te,Re,ut,pe=class extends EventTarget{constructor(){super();c(this,Re);c(this,Z,void 0);c(this,ee,void 0);c(this,te,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,Re,ut).values()}get length(){return r(this,Re,ut).size}getTrackById(e){var n;return(n=[...r(this,Re,ut)].find(s=>s.id===e))!=null?n:null}get onaddtrack(){return r(this,Z)}set onaddtrack(e){r(this,Z)&&(this.removeEventListener("addtrack",r(this,Z)),u(this,Z,void 0)),typeof e=="function"&&(u(this,Z,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,ee)}set onremovetrack(e){r(this,ee)&&(this.removeEventListener("removetrack",r(this,ee)),u(this,ee,void 0)),typeof e=="function"&&(u(this,ee,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,te)}set onchange(e){r(this,te)&&(this.removeEventListener("change",r(this,te)),u(this,te,void 0)),typeof e=="function"&&(u(this,te,e),this.addEventListener("change",e))}};Z=new WeakMap,ee=new WeakMap,te=new WeakMap,Re=new WeakSet,ut=function(){return a(this).trackSet};var Ce,Le=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,Ce,!1)}addRendition(i,e,n){let s=new Ue;return s.src=i,s.codec=e,s.bitrate=n,ii(this,s),s}removeRendition(i){ri(i)}get enabled(){return r(this,Ce)}set enabled(i){r(this,Ce)!==i&&(u(this,Ce,i),si(this))}};Ce=new WeakMap;var oi=ft(globalThis.HTMLMediaElement,"video"),ai=ft(globalThis.HTMLMediaElement,"audio");function di(t){if(!(t!=null&&t.prototype))return t;let i=ft(t,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"videoTracks",{get(){return Si(this)}});let e=ft(t,"audio");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"audioTracks",{get(){return Ri(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(l,d="",S=""){let E=new Ae;return E.kind=l,E.label=d,E.language=S,dt(this,E),E}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=ct),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(l,d="",S=""){let E=new Le;return E.kind=l,E.label=d,E.language=S,ht(this,E),E}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=lt),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get(){return n(this)}});let n=l=>{let d=a(l).videoRenditions;return d||(d=new le,a(d).media=l,a(l).videoRenditions=d),d};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get(){return s(this)}});let s=l=>{let d=a(l).audioRenditions;return d||(d=new fe,a(d).media=l,a(l).audioRenditions=d),d};return t}function ft(t,i){var e;if(t!=null&&t.prototype)return(e=Object.getOwnPropertyDescriptor(t.prototype,`${i}Tracks`))==null?void 0:e.get}function Si(t){var e;let i=a(t).videoTracks;if(!i&&(i=new he,a(t).videoTracks=i,oi)){let n=oi.call((e=t.nativeEl)!=null?e:t);for(let s of n)dt(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Ae)){for(let l of n)ct(l);return}dt(t,s.track)}),n.addEventListener("removetrack",s=>{ct(s.track)})}return i}function Ri(t){var e;let i=a(t).audioTracks;if(!i&&(i=new pe,a(t).audioTracks=i,ai)){let n=ai.call((e=t.nativeEl)!=null?e:t);for(let s of n)ht(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Le)){for(let l of n)lt(l);return}ht(t,s.track)}),n.addEventListener("removetrack",s=>{lt(s.track)})}return i}Qe.push("castchange","entercast","leavecast");var h={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",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"},Ci=Object.values(h),Li=_t(),Oi="mux-video",w,Oe,je,Pe,Ye,He,Ke,$e,Ie,pt,Ot=class extends Ze{constructor(){super();c(this,Ie);c(this,w,void 0);c(this,Oe,void 0);c(this,je,void 0);c(this,Pe,{});c(this,Ye,void 0);c(this,He,void 0);c(this,Ke,void 0);c(this,$e,void 0);u(this,je,(0,g.generatePlayerInitTime)())}static get observedAttributes(){var e;return[...Ci,...(e=Ze.observedAttributes)!=null?e:[]]}get preferCmcd(){var e;return(e=this.getAttribute(h.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?g.CmcdTypeValues.includes(e)?this.setAttribute(h.PREFER_CMCD,e):console.warn(`Invalid value for preferCmcd. Must be one of ${g.CmcdTypeValues.join()}`):this.removeAttribute(h.PREFER_CMCD))}get playerInitTime(){return r(this,je)}get playerSoftwareName(){var e;return(e=r(this,Ke))!=null?e:Oi}set playerSoftwareName(e){u(this,Ke,e)}get playerSoftwareVersion(){var e;return(e=r(this,He))!=null?e:Li}set playerSoftwareVersion(e){u(this,He,e)}get _hls(){var e;return(e=r(this,w))==null?void 0:e.engine}get mux(){var e;return(e=this.nativeEl)==null?void 0:e.mux}get error(){var e;return(e=(0,g.getError)(this.nativeEl))!=null?e:null}get errorTranslator(){return r(this,$e)}set errorTranslator(e){u(this,$e,e)}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get type(){var e;return(e=this.getAttribute(h.TYPE))!=null?e:void 0}set type(e){e!==this.type&&(e?this.setAttribute(h.TYPE,e):this.removeAttribute(h.TYPE))}get autoplay(){let e=this.getAttribute("autoplay");return e===null?!1:e===""?!0:e}set autoplay(e){let n=this.autoplay;e!==n&&(e?this.setAttribute("autoplay",typeof e=="string"?e:""):this.removeAttribute("autoplay"))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(h.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(h.DEBUG,""):this.removeAttribute(h.DEBUG))}get disableTracking(){return this.hasAttribute(h.DISABLE_TRACKING)}set disableTracking(e){e!==this.disableTracking&&this.toggleAttribute(h.DISABLE_TRACKING,!!e)}get disableCookies(){return this.hasAttribute(h.DISABLE_COOKIES)}set disableCookies(e){e!==this.disableCookies&&(e?this.setAttribute(h.DISABLE_COOKIES,""):this.removeAttribute(h.DISABLE_COOKIES))}get startTime(){let e=this.getAttribute(h.START_TIME);if(e==null)return;let n=+e;return Number.isNaN(n)?void 0:n}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(h.START_TIME):this.setAttribute(h.START_TIME,`${e}`))}get playbackId(){var e;return(e=this.getAttribute(h.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(h.PLAYBACK_ID,e):this.removeAttribute(h.PLAYBACK_ID))}get maxResolution(){var e;return(e=this.getAttribute(h.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(h.MAX_RESOLUTION,e):this.removeAttribute(h.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(h.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(h.MIN_RESOLUTION,e):this.removeAttribute(h.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(h.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(h.RENDITION_ORDER,e):this.removeAttribute(h.RENDITION_ORDER))}get customDomain(){var e;return(e=this.getAttribute(h.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(h.CUSTOM_DOMAIN,e):this.removeAttribute(h.CUSTOM_DOMAIN))}get ended(){return(0,g.getEnded)(this.nativeEl,this._hls)}get envKey(){var e;return(e=this.getAttribute(h.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(h.ENV_KEY,e):this.removeAttribute(h.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(h.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(h.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(h.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(h.STREAM_TYPE))!=null?e:(0,g.getStreamType)(this.nativeEl)}set streamType(e){e!==this.streamType&&(e?this.setAttribute(h.STREAM_TYPE,e):this.removeAttribute(h.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(0,g.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e,n;if(this.hasAttribute(h.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:s}=this,l=(e=this.nativeEl.seekable.end(0))!=null?e:0,d=(n=this.nativeEl.seekable.start(0))!=null?n:0;return Math.max(d,l-s)}return(0,g.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(h.LIVE_EDGE_OFFSET))return+this.getAttribute(h.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(h.LIVE_EDGE_OFFSET):this.setAttribute(h.LIVE_EDGE_OFFSET,`${+e}`))}get seekable(){return(0,g.getSeekable)(this.nativeEl)}async addCuePoints(e){return(0,g.addCuePoints)(this.nativeEl,e)}get activeCuePoint(){return(0,g.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,g.getCuePoints)(this.nativeEl)}getStartDate(){return(0,g.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,g.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let e=this.getAttribute(h.PREFER_PLAYBACK);if(e===g.PlaybackTypes.MSE||e===g.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===g.PlaybackTypes.MSE||e===g.PlaybackTypes.NATIVE?this.setAttribute(h.PREFER_PLAYBACK,e):this.removeAttribute(h.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(n=>n.startsWith("metadata-")&&![h.METADATA_URL].includes(n)).reduce((n,s)=>{let l=this.getAttribute(s);return l!=null&&(n[s.replace(/^metadata-/,"").replace(/-/g,"_")]=l),n},{}),...r(this,Pe)}}set metadata(e){u(this,Pe,e!=null?e:{}),this.mux&&this.mux.emit("hb",r(this,Pe))}get _hlsConfig(){return r(this,Ye)}set _hlsConfig(e){u(this,Ye,e)}load(){u(this,w,(0,g.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,g.teardown)(this.nativeEl,r(this,w)),u(this,w,void 0)}attributeChangedCallback(e,n,s){var d,S;switch(Ze.observedAttributes.includes(e)&&!["src","autoplay","preload"].includes(e)&&super.attributeChangedCallback(e,n,s),e){case h.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=s!=null?s:void 0;break;case h.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=s!=null?s:void 0;break;case"src":{let E=!!n,ie=!!s;!E&&ie?k(this,Ie,pt).call(this):E&&!ie?this.unload():E&&ie&&(this.unload(),k(this,Ie,pt).call(this));break}case"autoplay":if(s===n)break;(d=r(this,w))==null||d.setAutoplay(this.autoplay);break;case"preload":if(s===n)break;(S=r(this,w))==null||S.setPreload(s);break;case h.PLAYBACK_ID:this.src=(0,g.toMuxVideoURL)(this);break;case h.DEBUG:{let E=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=E);break}case h.METADATA_URL:s&&fetch(s).then(E=>E.json()).then(E=>this.metadata=E).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${s}!`));break;case h.STREAM_TYPE:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case h.TARGET_LIVE_WINDOW:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var e;(e=super.connectedCallback)==null||e.call(this),this.nativeEl&&this.src&&!r(this,w)&&k(this,Ie,pt).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,Oe=new WeakMap,je=new WeakMap,Pe=new WeakMap,Ye=new WeakMap,He=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Ie=new WeakSet,pt=async function(){r(this,Oe)||(await u(this,Oe,Promise.resolve()),u(this,Oe,null),this.load())};var We=class extends Xt(di(Ot)){};Je.customElements.get("mux-video")||(Je.customElements.define("mux-video",We),Je.MuxVideoElement=We);var Pi=We; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -14,9 +14,9 @@ { | ||
}, | ||
"../../node_modules/mux-embed/dist/mux.js": { | ||
"bytes": 86018, | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytes": 87160, | ||
"imports": [], | ||
"format": "cjs" | ||
"format": "esm" | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytes": 890477, | ||
"bytes": 993125, | ||
"imports": [], | ||
@@ -26,6 +26,6 @@ "format": "esm" | ||
"../playback-core/dist/index.mjs": { | ||
"bytes": 20548, | ||
"bytes": 20573, | ||
"imports": [ | ||
{ | ||
"path": "../../node_modules/mux-embed/dist/mux.js", | ||
"path": "../../node_modules/mux-embed/dist/mux.mjs", | ||
"kind": "import-statement", | ||
@@ -47,3 +47,3 @@ "original": "mux-embed" | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12216, | ||
@@ -399,3 +399,3 @@ "imports": [ | ||
"src/index.ts": { | ||
"bytes": 18382, | ||
"bytes": 18691, | ||
"imports": [ | ||
@@ -418,3 +418,3 @@ { | ||
{ | ||
"path": "node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -447,3 +447,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 2071425 | ||
"bytes": 2260797 | ||
}, | ||
@@ -460,19 +460,19 @@ "dist/mux-video.mjs": { | ||
"inputs": { | ||
"../../node_modules/mux-embed/dist/mux.js": { | ||
"bytesInOutput": 86421 | ||
}, | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 19219 | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytesInOutput": 86636 | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytesInOutput": 357479 | ||
"bytesInOutput": 392729 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 19202 | ||
}, | ||
"src/env.ts": { | ||
"bytesInOutput": 73 | ||
}, | ||
"node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5758 | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5739 | ||
}, | ||
@@ -528,8 +528,8 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
"src/index.ts": { | ||
"bytesInOutput": 8633 | ||
"bytesInOutput": 8830 | ||
} | ||
}, | ||
"bytes": 503068 | ||
"bytes": 538131 | ||
} | ||
} | ||
} |
@@ -9,2 +9,3 @@ import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
readonly DEBUG: "debug"; | ||
readonly DISABLE_TRACKING: "disable-tracking"; | ||
readonly DISABLE_COOKIES: "disable-cookies"; | ||
@@ -46,2 +47,3 @@ readonly ENV_KEY: "env-key"; | ||
debug: boolean; | ||
disableTracking: boolean; | ||
disableCookies: boolean; | ||
@@ -48,0 +50,0 @@ startTime: number | undefined; |
@@ -9,2 +9,3 @@ import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
readonly DEBUG: "debug"; | ||
readonly DISABLE_TRACKING: "disable-tracking"; | ||
readonly DISABLE_COOKIES: "disable-cookies"; | ||
@@ -55,2 +56,4 @@ readonly ENV_KEY: "env-key"; | ||
set debug(val: boolean); | ||
get disableTracking(): boolean; | ||
set disableTracking(val: boolean); | ||
get disableCookies(): boolean; | ||
@@ -57,0 +60,0 @@ set disableCookies(val: boolean); |
{ | ||
"name": "@mux/mux-video", | ||
"version": "0.17.5-canary.0-3abdbb8", | ||
"version": "0.17.5-canary.0-587a5ae", | ||
"description": "A custom mux video element for the browser that Just Works™", | ||
@@ -69,3 +69,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@mux/playback-core": "0.22.4-canary.0-3abdbb8", | ||
"@mux/playback-core": "0.22.4-canary.0-587a5ae", | ||
"castable-video": "~1.0.6", | ||
@@ -76,3 +76,2 @@ "custom-media-element": "~1.2.3", | ||
"devDependencies": { | ||
"@mux/test-esm-exports": "0.1.0", | ||
"@open-wc/testing": "^3.0.3", | ||
@@ -87,4 +86,3 @@ "@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"eslint": "^8.24.0", | ||
"hls.js": "~1.4.13", | ||
"mux-embed": "~4.30.0", | ||
"hls.js": "~1.5.8", | ||
"npm-run-all": "^4.1.5", | ||
@@ -91,0 +89,0 @@ "replace": "^1.2.1", |
@@ -96,2 +96,4 @@ <p align="center"> | ||
- `start-time: number (seconds)`: Set this to start playback of your media at some time other than 0 (or the "live edge" for live/"DVR" content). | ||
- `disable-tracking`: Disables Mux Data tracking. For more, check out the [Mux Docs](https://docs.mux.com/guides/data/monitor-html5-video-element#features) | ||
- `disable-cookies`: Disables cookies used by Mux Data. For more, check out the [Mux Docs](https://docs.mux.com/guides/data/monitor-html5-video-element#disable-cookies). | ||
@@ -98,0 +100,0 @@ All the other attributes that you would use on a `<video>` element like `poster`, `controls`, `muted` and `autoplay` are available and will work the same as they do with the HTML5 video element. One sidenote about `autoplay` though -- [read this to understand why that might not always work as expected](https://docs.mux.com/guides/video/web-autoplay-your-videos). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6076035
14
6885
311
+ Added@mux/playback-core@0.22.4-canary.0-587a5ae(transitive)
+ Addedhls.js@1.5.20(transitive)
+ Addedmux-embed@5.2.1(transitive)
- Removed@mux/playback-core@0.22.4-canary.0-3abdbb8(transitive)
- Removedhls.js@1.4.14(transitive)
- Removedmux-embed@4.30.0(transitive)